Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

2D All the way! / creating a new sprite at the location of another sprite

Author
Message
quiz master
15
Years of Service
User Offline
Joined: 4th Jul 2008
Location:
Posted: 4th Jul 2008 09:59
How do I create a sprite at the same x and y of another sprite, but then have the new sprite stay in that same location while the old sprite continues on its way.

basically,
I'm trying to create an explosion animation at the point of collision between two sprites. Is there a way to store the x and y value of the sprites involved at that exact moment in a new variable?
flashing snall
18
Years of Service
User Offline
Joined: 8th Oct 2005
Location: Boston
Posted: 4th Jul 2008 16:21 Edited at: 4th Jul 2008 16:22
Its actually not as hard as one might think. You just need to use the Sprite X and Sprite Y commands.



The above code will have a red box moving around, and when you tap space, another red box should appear were the first just was. I havnt tested it though, i just wrote it here. Best of luck


This is my WIP, not even ready for a WIP thread yet though.http://smallgroupproductions.com/

Login to post a reply

Server time is: 2024-05-04 17:06:07
Your offset time is: 2024-05-04 17:06:07