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



Recommended Posts

_KILLOCAN_    122
I already posted two topics, here they put I didn''t obtain answer, it would like a lot that somebody helps me her in the one that I am planning do. Mine doubts and as the code of a similar special effect the one of Castlevania Symphoni of the night, that that leaves a trace behind Alucard when he moves. If possible to explain to me or to indicate me where to find that. Thank you Killocan.

Share this post

Link to post
Share on other sites
hpox    122
Don''t worry, it''s just probably that the people who know the answer didnt see your thread.

Can you elaborate on the effect ? I havent played that game.

Share this post

Link to post
Share on other sites
invective    118
You posted a topic on a saturday, and you expect an answer less than an hour later? Aren't we demanding?

To answer your question, just keep a list of former coordinates and unpdate it at a fixed time (say every .25 seconds) and draw the after images there (maybe fading them out).
vector2 image [NUMBEROFIMAGES];

if ((elpased_time > image_time)
elapsed_time = 0;
//every image becomes the one before it

for (j=1; j < NUMBEROFIMAGES; j++)
image [j] = image [j-1];
//image zero goes to player position

image[0] = currentPlayerPosition;
//don't draw image [0] because that is where the player is now

for (j=1; j < NUMBEROFIMAGES; j++)
drawImage (image [j].x, image [j].y);
drawPlayer (currentPlayerPosition.x, currentPlayerPosition.y);

Its a little more complicated than that, since you need to store which frame of the animation to show, and adjust for when the player is not moving, but you should get the idea.

Edited by - invective on November 10, 2001 2:52:51 PM

Share this post

Link to post
Share on other sites