Platformer game - bugs found - Please help! No double jump / land on enemies head to kill actor

dugisthekingdugistheking Member Posts: 83
edited July 2012 in Working with GS (Mac)
Hello All,

I am near finishing our latest app - a platform runner. I have two issues I cannot solve and need your amazing brains :)

Issue 1 - Kill enemy when jump on head only
What is the best way to do this ? I want it to be like mario - if player jumps on head only the enemy dies. If the player walks into enemy he should die as normal. Please help!

Issue 2 - On the game we have a jump. However I have discovered if you press jump repeately he keeps jumping! I need to be able to tell gamesalad that player only jumps when he is touching the platform. How do I do this?

I am sure these are simple issues but I just cant figure it out. It's been a long day ...... Would be a massive help to me to fix these . Many Many thanks in advance! Please explain yourself clearly!

Comments

  • s4ndm4ns4ndm4n Member Posts: 13
    Hi I can help on the double jump issue.
    The way i handled it was that if the actor overlaps/collides with ground then i have an attribute called grounded that = 1. If the actor doesn't overlap with ground then it is zero.
    When the player presses jump and grounded = 1 then jump will occur. this stopped the actor from jumping while in the air.

    i'd be interested to know the answer to the other question. i haven't tried it but was thinking of constraining another actor to the main player's feet and then a forth actor to the enemies head and when they collide the enemy dies. it might work but like i said I haven't tried it yet

    hope that helps
  • dugisthekingdugistheking Member Posts: 83
    thank you very much for the feedback! Lets hope someone else can help us with the jump on enemy issue. With the jump issue. Presumably we must set something to say when player jumps - attribute returns to 0 . Then when they land again it turns to 1 ? THat way if they try to jump mid air - nothing happens?
  • NmdogdudeNmdogdude Member Posts: 174
    Try creating separate actors for the top & sides. Then create a rule in the top part "when actor 'player' collides w/ top...delete actor", and in the player rule "when actor 'player' collids w/ actor side...delete actor".
  • dugisthekingdugistheking Member Posts: 83
    hi All,

    thanks for the feedback. Jump on actor seems to do the trick and currently testing. Still have problems with the jump though. Let me be more specific. Actor is running along a floor. He jump and runs on the ceiling. Then you can jump again and run onto the floor. Very enjoyable game play. My issue is this. How DO i tell GS not to jump again when in mid air? THe bug is if you jump constantly you can "float" between the floor and ceiling ! I cannot assign a timer attribute as sometimes you need to jump quickly.

    Please help!
  • rhinokeyrhinokey Member Posts: 158
    sandman (i'm not spelling it with numbers!) already answered that.

    put your platforms ceiling and floor under a tag called "platform) or whatever you wana call
    make a game boolean atribute called grounded.
    make a rule that says


    actor overlaps with tag platform
    set grounded to true,
    otherwise set grounded to false

    then in your rule for jump be sure to tell it to only jump when grounded is true.


    as for jumping on the monsters heads i would not do it with seperate objects, i would put a rule in the monster

    when collides with character
    and
    characters Y is> self.position y (if the char is taller than the mob you may have to tweak some values.

    you will need to make a tracking attribute in game. that keeps track of your characters postion. but i find thats usualy the first thing i make when doing a project always nice to know where that guy is.
  • ekelrockekelrock Member Posts: 34
    If you're already using a boolean (or an integer that flips back and forth between 0 and 1) to record when the player is on the ground to limit double jumps, you may be able to use the same method for jumping on the enemy's head. If the player is on the ground or ceiling AND it touches an enemy, that means he didn't land on them.

    The immediate issue I see in using this type of rule is that if the player jumps just before they hit the enemy, it would register as hitting the enemy while not touching the floor. It may be best to add the extra collision detectors to the actors, or use a rule based on the Y Position of the player, as others have suggested...

    Good luck!
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Use a magnitude offset when the actors overlap and collide.
Sign In or Register to comment.