"Death" animation question

mark0210mark0210 Member Posts: 8
edited November -1 in Working with GS (Mac)
Hello everyone, looked around the cookbook and forums, but couldn't find any solutions to this.

I've got the basic movement down for my character, and I'm starting to work with lives, scoring, and deaths. What I would like to happen is that when an actor gets hit by an enemy, projectile, or the Y position is less than or equal to zero, change his image to an explosion, play a noise, and reset the scene.

I have all the conditions for this set up, I believe. My problem lies in when the scene resets. I would like the image to change for 3 seconds, play the sound, and then reset when the animation and sound are done. I'm not sure how to set up the rules so that the scene resets only when the animation is done. Basically, I want a "death" animation like in old Mario or Donkey Kong Country games, but the scene reset happens to quickly. If anyone can help, that would be great. Thanks!

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    you can do when self.image= (last image of animation), reset scene

    if thats still reseting to quick you can add a timer in the self image rule to set it back even further
  • mark0210mark0210 Member Posts: 8
    I set the animation to run within a timer, at one frame/second for 3 seconds. I have 3 images in the animation, turned off the looping/actor reset, and set a rule so that when self.image = 4, the scene would reset. This, however, doesn't seem to do it. Am I correct in using a number to designate the image in the reset rule? Is there perhaps another way to work this? Thanks for your help.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    it needs to be the name of the last image

    cheers
  • mark0210mark0210 Member Posts: 8
    It appears that the field where I would enter the image name only accepts numbers, so I put in the number of the last animation image and still had no luck.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    mark0210 said:
    It appears that the field where I would enter the image name only accepts numbers, so I put in the number of the last animation image and still had no luck.

    yeah liek i said that wont work

    you need to put the name of the image, not sure why it would only accept numbers cause thats not the case
  • mark0210mark0210 Member Posts: 8
    So I've been at this for over an hour now, and I'm still not getting it. John, aside from your suggestion, is there any other way to do this that you know? I'd just like to change the image (decided to scrap animation) for 3 seconds when the actor dies, and then reset the scene. I have gotten your suggestion set up, but either the scene will not reset after the actor falls off, or there is no delay between the falling and the scene reset.

    Any other ways to go about this? I just cleared out the rule for death, so I will try out any suggestions that I can. Thanks again!
  • mark0210mark0210 Member Posts: 8
    Alright, so I sat down with my actor this morning and cleared the death rule out. I put in John's suggestion from scratch, and again, the scene is resetting too fast, or not at all. THe images are indeed typed in correctly, and I cannot find anything wrong with the rules. Any more ideas?
Sign In or Register to comment.