User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16

Thread: How do I destroy an enemy after a delay

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I destroy an enemy after a delay

    Warning: New User

    I have a collision detection event between my Player and an Object which plays a sound, adds to the score, and destroys the second object.

    How do I actually change the image of the second object, wait 1 second, and then do the destroy event? I can't seem to find a way to make the events work synchronously. This is a major concept I have not been able to figure out.

    Your help is appreciated.

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: How do I destroy an enemy after a delay

    If you change the Disappearing animation, you can just have it be the image you want for a second. The Disappearing animation is played for you when you destroy the object, just as the Appearing animation is played when you create it.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export Module

    Join Date
    Aug 2011
    Location
    Beverly Hills, CA USA
    Posts
    508
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do I destroy an enemy after a delay

    This is good and it worked , but what would I use if I wanted to chain a series of events together one after the other? Is there no way to do step 1, when step 1 finishes do step 2, etc.?

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: How do I destroy an enemy after a delay

    You could manually play the animation and when it is over do something else.
    Working as fast as I can on Fusion 3

  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,393
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Re: How do I destroy an enemy after a delay

    I'd use an alterable value - it gives you more flexibility.

    eg. Give the object an alterable value called "Delay", with a default value of -1, and then say something like:

    + Player collides with Object
    -> Object: Set Delay to 200

    + Always
    -> Object: Subtract 1 from Delay

    + Object: Delay = 150
    -> Do something...

    + Object: Delay = 100
    -> Do something else...

    + Object: Delay = 0
    -> Destroy Object

    It's pretty easy to calculate exactly what values you need to use.
    If your game's framerate is 50fps, a delay of 50 = 1 second. If an object has an animation speed of 50, each game frame will last 50% as long as each animation frame (ie. an "always" event will run twice in the time it takes an animation to change frame once).

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heya.
    Pulling up old threads here, but just wondering how to make this happen. How exactly do I "Give the object an alterable value called "Delay"? I'm trying to make this work but I'm lost in the syntax. Greatly appreciated if anyone could give me a break down on how to implement this in MMF2.
    Cheers

  7. #7
    Clicker iOS Export Module

    Join Date
    Feb 2010
    Location
    Behind the tree!
    Posts
    200
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You just click on the object, then in the properties panel select the tab with alterable values. Click add value, it will come up as "alterable value A". Double click to rename it.

  8. #8
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Bigfoot,
    that helped a lot, thanks. What about the remaining part where it says

    "+ Player collides with Object (Ok I know where this is)
    -> Object: Set Delay to 200 (I'm lost here...)

    + Always
    -> Object: Subtract 1 from Delay

    + Object: Delay = 150
    -> Do something...

    + Object: Delay = 100
    -> Do something else...

    + Object: Delay = 0
    -> Destroy Object"

    ?

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically what he means is..

    Object is referring to the object with the alterable value that you are setting. Delay obviously being the name of that value. So because you have the "Always Subtract 1 from Alterable Value A(Delay) of Object" each frame it will subtract 1 from it's value. With the collision it sets the value to 200.

    So then, when that value hits >200-0 you can set it to do something. Like change animation or something of that nature. In this case what the user wants is a delay before the enemy is destroyed. So with a value of 200, and at an FPS of 60, the delay will be 3.33 seconds.

    Hope that makes sense.

  10. #10
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2012
    Location
    Miami, FL
    Posts
    40
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    knpdude,
    thanks for the explanation, appreciate you taking time to explain it. But how do I actually apply this in MMF2 to my project? Such as "go here, click this object, type this...". Maybe i'm getting confused in the mechanics and steps (ok not maybe, for sure).

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How to destroy an enemy
    By videogiochi in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 12th June 2012, 09:27 PM
  2. Only added score of single enemy when destroy multiple enemies at a time.
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 11th April 2012, 11:26 AM
  3. Destroy Enemy with Feet?
    By Drew_Brightwell in forum The Games Factory 2 - Technical Support
    Replies: 3
    Last Post: 15th April 2011, 04:55 AM
  4. Enemy 'destroy' issues
    By K12Student in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 15th May 2010, 12:40 PM
  5. Delay! help
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 7th February 2010, 04:20 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •