Author Topic: How to make "enemy" sprites "explode" wh  (Read 3332 times)

Out of Line

  • Guest
How to make "enemy" sprites "explode" wh
« 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.

Out of Line

  • Guest
How to make "enemy" sprites "explode" wh
« Reply #1 on: 2005-10-24, 09:42:19 AM »
Looks like the hreader got cut off!  :-[

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
How to make "enemy" sprites "explode" wh
« Reply #2 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.
Edward Dassmesser

Anonymous

  • Guest
How to make "enemy" sprites "explode" wh
« Reply #3 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?

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
How to make "enemy" sprites "explode" wh
« Reply #4 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.