Author Topic: Animating Deaths  (Read 5327 times)

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Animating Deaths
« on: 2006-07-17, 12:47:17 AM »
So far when i die or i kill an enemy they just disapear. can i show them setting on fire or something and then die preferably without script

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Animating Deaths
« Reply #1 on: 2006-07-17, 06:04:56 AM »
You should be able to activate a function that creates a sprite at the "trigger point" (where the collision happened that caused the death to occur).  The sprite can be set to follow a 1-point path that has the right delay on the point to last just long enough to play its animation once.  Check the box on the sprite definition for "follow path relative to starting point" and the sprite will stay wherever it gets created as it runs through its animation.  Then you can also set the sprite to delete itself at the end of the path so it automatically goes away when it's done animating (if you set the delay properly).

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: Animating Deaths
« Reply #2 on: 2006-07-17, 11:55:03 PM »
Is there a way so after the 'death' sprite gets deleted for the original sprite to start at the start of its :-\ path again

eric22222

  • Fanatic
  • ***
  • Posts: 177
    • View Profile
    • Eric Online
    • Email
Re: Animating Deaths
« Reply #3 on: 2006-07-18, 01:21:23 AM »
Assuming you're handling the enemy's death through collisions, have the collision activate a function. Have this function activate a series of functions:
  • delete the sprite (this could also be done from the collision window)
  • create the death animation sprite
  • create the enemy sprite

This would create the enemy before the death animation completes, though. Not sure if that's a problem.

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Animating Deaths
« Reply #4 on: 2006-07-18, 05:49:20 AM »
Instead of setting the sprite to delete itself at the end of its path, you could tell it to "Activate EOP_<SpriteName>*", which would cause it to activate all functions on the layer whose name starts with "EOP_MyDyingSprite" (where MyDyingSprite is the name of the sprite definition).  You could make EOP_MyDyingSpriteDelete delete all instances of MyDyingSprite and you could make another function EOP_MyDyingSpriteReset create a new instance of MySprite.

Jam0864

  • Contributor
  • Fanatic
  • **
  • Posts: 744
    • MSN Messenger - marmalade0864@hotmail.com
    • View Profile
    • Jam0864's Content Dump
    • Email
Re: Animating Deaths
« Reply #5 on: 2006-07-19, 01:37:31 AM »
Cool that works really well thanks  ;D

billybob884

  • Contributor
  • Fanatic
  • **
  • Posts: 355
    • AOL Instant Messenger - billybob884
    • View Profile
Re: Animating Deaths
« Reply #6 on: 2006-07-27, 10:30:45 PM »
the only problem ive had with this method is that if you shoot its right side, the dead sprite will be created 1 space over, becasue its created at the point of contact
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." :: Hitchhiker's Guide to the Galaxy

bluemonkmn

  • SGDK Author
  • Administrator
  • Fanatic
  • *****
  • Posts: 2761
    • ICQ Messenger - 2678251
    • MSN Messenger - BlueMonkMN@gmail.com
    • View Profile
    • http://sgdk2.sf.net/
    • Email
Re: Animating Deaths
« Reply #7 on: 2006-07-28, 05:57:27 AM »
If you switch sprite A and B in the collision definition, then I think the problem of creating the dead sprite where the bullet was instead of where the sprite was would go away.

durnurd

  • Lead Lemming
  • Expert
  • Fanatic
  • *****
  • Posts: 1234
  • Games completed so far: 0
    • MSN Messenger - durnurd@hotmail.com
    • View Profile
    • Find My Ed
Re: Animating Deaths
« Reply #8 on: 2006-07-28, 07:55:22 AM »
As an addendum, the process is done by creating a death animation sprite at the "Trigger".  The Trigger is the location of Sprite A in any sprite collisions.
Edward Dassmesser