Scrolling Game Development Kit Forum

SGDK Version 1 => Help/FAQ => Topic started by: Out of Line on 2005-10-24, 09:41:33 AM

Title: How to make "enemy" sprites "explode" wh
Post by: Out of Line on 2005-10-24, 09:41:33 AM
What I have in mind for my upcoming game:
When an enemy gets shot, they get replaced by an "explosion".
What I don't know what to do is how to make the explosion sprite disappear after a while by itself.
Title: How to make "enemy" sprites "explode" wh
Post by: Out of Line on 2005-10-24, 09:42:19 AM
Looks like the hreader got cut off!  :-[
Title: How to make "enemy" sprites "explode" wh
Post by: durnurd on 2005-10-24, 10:26:59 AM
A sprite that explodes should be defined as a "Follow path exactly" sprite.  The path it's on should have one point only, and then one delay.  The delay should be equal to the length of the animation, which can be determined thus:

(26 - Animation_Speed) * Number_Of_Frames

Then, in the motion tab of the sprite template, for "At end of path" choose "Delete sprite"

This will cause the sprite to show up, animate once, then disappear.
Title: How to make "enemy" sprites "explode" wh
Post by: Anonymous on 2005-10-24, 01:30:50 PM
Quote from: "durnurd"
A sprite that explodes should be defined as a "Follow path exactly" sprite.  The path it's on should have one point only, and then one delay.  The delay should be equal to the length of the animation, which can be determined thus:

(26 - Animation_Speed) * Number_Of_Frames

Then, in the motion tab of the sprite template, for "At end of path" choose "Delete sprite"

This will cause the sprite to show up, animate once, then disappear.


I forgot to mention that the enemies explode when shot. Does the technique still work for that?
Title: How to make "enemy" sprites "explode" wh
Post by: bluemonkmn on 2005-10-25, 05:26:42 AM
If the sprite follows the path relative to the starting point, then you can still put it on a path and set it to "follow path exactly" as long as you get it started in the right place (presumably by starting it relative to the trigger point -- which would be a sprite collision).  Following a path relative to the sprite's starting point is a simple checkbox on the sprite definition, so that should be easy to work out.  That will allow it to use the same path regardless of where the sprite starts, and it will stay there instead of going exactly to where you drew the path on the map.