Archived

This topic is now archived and is closed to further replies.

R3alTiMe

Particles tutorial problem....

Recommended Posts

Hi I have been reading the particles tutorial and I am not sure whether its a problem or something I cant understand. It occurus on just the begining of the drawing (like first cycle of the first particles group). Lets say my ship is positioned at x=5; y=5; particle[loop].x=0.0f; particle[loop].y=0.0f; particle[loop].z=0.0f; Those lines the tutorial used used to reset the particles position to center of the screen. I changed the 0.0 to the x and y position of the ship. It works but with only one flaw. Theres a "first group" of particles that are being drawn for about 1 second on the center of the screen and while they dissapear new particles begin to appear at the x,y position coordinates i specified. I believe the problem is at the begining of the loop where its written: float x=particle[loop].x; / float y=particle[loop].y; float z=particle[loop].z+zoom; I checked and those values are never reset on initialiasiation and im positive thats the problem. Anyone know how can I fix it? I tried various things and I couldnt figure out how. Thanks. Rotem Tal . [edited by - R3alTiMe on October 20, 2002 11:53:38 PM]

Share this post


Link to post
Share on other sites
you also have to set particle position at your origin when you create particel array (somewhere in setup stage)

You should never let your fears become the boundaries of your dreams.

Share this post


Link to post
Share on other sites
Thats the problem. I cant setup particle[].x or .y b4 the game starts...
Those explosions appear after collision detect.
Lets say after collision i keep in variables xpos and ypos the coordinates of the emitter. How can I set it up ?
It WILL work but only after the first group of particles will be shown at point 0,0.
I debugged and
float x=particle[loop].x;
float y=particle[loop].y;

does evaluate x and y to 0. How else I can assign different values?

Share this post


Link to post
Share on other sites