Platformer game - bugs found - Please help! No double jump / land on enemies head to kill actor
Hello All,
I am near finishing our latest app - a platform runner. I have two issues I cannot solve and need your amazing brains![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
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!
I am near finishing our latest app - a platform runner. I have two issues I cannot solve and need your amazing brains
![:) :)](http://forums.gamesalad.com/plugins/emojiextender/emoji/twitter/smile.png)
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
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
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!
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.
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!
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS