Move all particles

Pandavim

Member
Hey everyone,
I was wondering if anyone could tell me how I can move all my particles in my game by a certain x and y value?
Thanks, Jude
 
P

Paolo Mazzon

Guest
If they are particles, there is going to be a ton of them. Since you want to move them all, this means you will have to loop through them all, and then perform some math on them; this is going to be quite taxing on the cpu. Might I ask why you want to move every particle? Perhaps there is a better solution.
 

Pandavim

Member
I'm developing a scrolling game called Extra Galactic, here is an enemy test video (sorry about the low quality):
All the particles in that video are actually instances, and I'm currently working on a particle system instead to make the game much easier to run. I create the scrolling effect by moving the world around the player, so I need to move the particles by the speed of the player. Would you recommend that I just make the direction of the particles opposite to that of the ship to make it run better (although it could look a little weird whilst the ship is turning).
 

Pandavim

Member
Hmm, would it be a better idea if I made my own particle system where I stored each point in a DS_list and redrew them every frame?
 
No that would probably be very slow (unless maybe with the YYC compiler).

I think all you'd have to do is position the particle system at negative the ship's x and y position. I'm assuming you are keeping track of its x and y positions somewhere or I don't see how you can position other objects in the room relative to it. BTW, I get the feeling you are reinventing the wheel here and you might make your life easier if you learn about how views work.

Maybe the solutions presented so far aren't what you are looking for. You'll need to explain your problem in more detail then.
 
P

Paolo Mazzon

Guest
Looking at that video, you are using hundreds of particles at a time, so no. That would mean you're looping through hundreds of positions each frame and drawing each one. I'd recommend using the built in particle system, benchmarking it, then try the ds_list option and see which one is better just in case I'm wrong.
 
Top