GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Help with Endless Runner game

Ok so I have been developing a endless runner game. And currently it is moving along very well. I have a small bug that I don't know how to fix however. Well of course in an endless runner the player moves across the screen and avoids the obstacles, all the while jumping. Right now I have it set so when the player collides or overlaps the floor he is allowed to jump again. However if you jump and aren't even on the platform, but just barely touch it, you can jump and escape inevitable death. Anyone have any ideas on how to fix this, thanks!

Answers

  • rvantilborgrvantilborg Posts: 185Member, PRO

    it sounds like its working 100% fine… could you explain a little better?? i just launched a endless runner last week) http://itunes.com/apps/hoopatube

  • Newdude33362Newdude33362 Posts: 7Member

    Okay so when you're jumping you don't want to be able to jump in mid-air right? You want to wait until the player hits the ground again to jump, well I did that by setting that if the player collides/overlaps the ground he can jump again. But when the player is jumping if I barely touch a platform or the ground it allowd the player to jump, I want it so the only way you can jump is if the bottom part of the player (aka the feet) are touching the platform or ground, not just the whole object itself. Know what I mean?

  • ookami007ookami007 Posts: 581Member

    If I understand correctly, your sprite is larger than the player graphic. So even though the actor is colliding, the player graphic isn't touching the platform.

    Is that it?

  • rvantilborgrvantilborg Posts: 185Member, PRO

    oh i think your problem is the image itself…. every image has a invisible border, square or circle shaped… you can try to select circle shape,if that does not improve you have to make an invisible actor that bounces when colliding with ground,and constrain your actor to it,first try the screenshot:

  • rvantilborgrvantilborg Posts: 185Member, PRO

    also google for (collision box gamesalad) it will definatly help you

  • GameAlchemistGameAlchemist Posts: 106Member

    One thing you can try is creating an invisible actor "player collider" and make its height as thin as player's feet and constrain its x and y position to player x and y. After that just apply whatever jumping behaviours you have on your player collider and remove those behaviours from the original player. By doing that your player's body won't make it jump again, instead the player's feet(player collider bottom) must touch the platform top in order to jump again.

  • Newdude33362Newdude33362 Posts: 7Member

    Thanks you guys, it actually isnt a player with feet, but a rolling ball. haha
    I just said feet so you guys would know I mean the bottom of the actor. I will go ahead and try your guys suggestions, and let you know how it works!

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,535Member

    If it's a rolling ball use the Circular collision shape instead of the Rectangular and you should be fine.

  • Newdude33362Newdude33362 Posts: 7Member

    Ok so how would I constrain the invisible actor to the player actor? I have the invisble actor made, and it's constrain from self.position.x and self.position.y

    How would I make a attribute that would represent the players x and y?

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,535Member

    @Newdude33362, is your actor actually a circle? If it is, it will be far simpler to use the Circular Collision shape.

  • Newdude33362Newdude33362 Posts: 7Member

    yes it's a circle, and I already have set circular collision shape. That is not the problem. I want it so the player, can only jump when the bottom part is colliding with a platform. Otherwise it can touch a platform on it's side and still be allowed to jump.

  • GameAlchemistGameAlchemist Posts: 106Member

    I'm guessing this is something you would like to do. wait till the platform is high enough and try to jump on it. You'll notice that you won't be able to jump again until you are on the platform. Player feet collider's visibility is turned off from the graphics menu. Turn it on to see how it works.

Sign In or Register to comment.