User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 23

Thread: Platformer - kill player when fallen too far

  1. #1
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Platformer - kill player when fallen too far

    I'm using a custom platform engine. How do I kill the player if he's fallen too far down the screen? I can't use an active on the ground to kill the player because he needs to be able to walk across the same ground.

  2. #2
    Clicker Fusion 2.5 Developer

    Join Date
    Nov 2006
    Posts
    71
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can try this: when the player's animation "falling" is playing, at 1 to a hidden counter for every 1/4 of a second, or whatever. When the player's "stopped" or "walking" animation is playing, and if the counter is over a certain point, kill the player. Otherwise, just set to counter to 0. This what I did in one of my games, "Flight to Freedom". I hope this helps.

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks andy, I'll give that a try.

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That doesn't work andy. I think because my player has custom movement and not the default Clickteam platform movement.
    I have a fake player that follows the real hidden player. Animations for the fake player are set in conditions.

    The image below shows the conditions and events for the animations of my custom movement. I somehow need to add a condition that plays a falling animation but I can't get one to work.


  5. #5
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How about adding it to when the player isn't touching a backdrop? That's the same as falling, right? Every 1/4 second the player isn't touching a backdrop you could increase or decrease a counter that if the condition is met the player is killed? That's unless you expect the player to be airborne safely for more than the timed counter. or you might need to get fancy that while the player is not touching the backdrop if the difference betwen the extreme -Y value exceeds whatever number of the +Y when landing, the player dies. That would require some additional thinking to put in.

  6. #6
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    While that does appear to work and could be worked into a fall damage model, the counter still increases while standing on active objects such as the moving platforms, ladders, springs and other active objects I have with various gravity conditions (such as jelly blocks that make the player bounce wile walking on them).

    I'd have to set conditions for all of them to reset the counter to 0.

  7. #7
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is what I've got set up at the moment.

    "Detector" refers to the 1 pixel high purple line under the active that is my character for detecting when on backdrops. See image above. The player is the yellow active with the detector underneath.

    Condition: Detector is overlapping a backdrop --> Event (counter): Set Counter to 0

    Condition: Detector is NOT overlapping a backdrop --> Event (counter): Add 1 to Counter [every 00"-45]

    Condition: Counter >2 AND Detector collides with the background --> Event: Subtract 1 from Number of Lives (and respawn).

    While normal jumping the counter only reaches 1. With double-jump it reaches 2.
    When falling, the counter reaches 2 or 3 depending how high the fall is but the player doesn't lose a life when he hits the ground.

    I only lose a life if I remove the "AND Detector collides with background" condition. But this means I die while just jumping.

  8. #8
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    have you ever played around with limit conditions? What if you create another event for whenever you are overlapping the backdrop and limit the condition to only once when the condition loops, then set the timer to 0. This should zero it out for whenever you need to jump and land. Sorry, in the middle of something and wanted to post this before getting back to it.

  9. #9
    Clicker Multimedia Fusion 2

    Join Date
    Feb 2007
    Location
    UK
    Posts
    243
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I can't figure it out. Might have to think of another way that doesn't use counters. Or abandon the whole project, pointless making it if the player isn't killed when falling too far.

  10. #10
    No Products Registered

    Join Date
    Jan 2014
    Location
    Indiana, USA
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well that's not cool. Can you share it over a drop box or something if i sign a non-disclosure agreement?

    There's a few ways to accomplish this, actually.

    Correct me if I don't understand though, the only time the player is falling is when not overlapping a backdrop? If that's the case you can totally use the limit condition fairly easily. Remember, the timer should only increment while either jumping or not overlapping the backdrop. That's 1 event. A separate event is when either the 'jump' ends, or when the player touches a backdrop. That event gets limited once because it's an infinite loop. As soon as that happens, the timer gets set to 0.

    Another way (and maybe easier to wrap your head around) is using a flag or variable. When jumping or not overlapping, set a flag on the player to 'on' or set a variable you create on the player to 'on'. The next event is when the flag is set to on or the variable equals a certain value, increment the time by 1. When the player lands or touches a backdrop, you set the flag 'off' which stops the counter and then you also need to set the counter to 0.

    Using the limit condition is really useful in this case. It really helps you get around crazy programming issues when you end up in infinite loops.

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. enemy floats in air after i kill it
    By gamebuilder in forum The Games Factory 2 - Technical Support
    Replies: 5
    Last Post: 19th February 2013, 11:27 PM
  2. mario style kill
    By dray in forum Multimedia Fusion 2 - Technical Support
    Replies: 25
    Last Post: 9th October 2008, 10:04 PM
  3. Kill enemy from top ?
    By basit in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 11th September 2008, 01:59 AM

Posting Permissions

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