How do I : Platform Behavior

0 favourites
  • 5 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • I am creating a prototype of Jetpack type game where the player flies and need to land on a platform on a projectile path.

    For the Player I have enabled two behaviors 1) platform and 2) physics. Given below are the key events/+actions I am using.

    1) For Player Jump/Jetpack -> On key Press, apply impulse of 0.2 to coordinates ( Player.X+10, Player.Y-10)

    2) To get the Parabolic Path of fall -> On release of key Press, apply impulse of 0 to angle 0 of the player

    The issues I am getting are given below. If anyone can help it will be great.

    1) The player is always shaking while standing on the platform. I have given the video link http://youtu.be/fsXKTc3HNSw. Please note that if I make set world gravity to 0 when the player is on the platform the shake is stopped.

    2) Even when the player is landing on the platform, it constantly triggers events related to Platform Falling. Why would that be?

  • for number 1) try to change your bounding box/collision polygon of the player sprite or even better: make an invisible sprite that is set at the position of your player and handles the collision/physics, and turn collision/physics for your player sprite off

    for number 2) without seeing your code i don't know, but physics is always problematic, special in fast action games. I always try to avoid physics and only use it, if i don't find another solution for getting the behavior i need.

  • 1) I can use the invisible sprite method to take care of the collision part. My worry remains that collision block would continue to shake and hence some of the physics would misbehave. Like the events of "Platform is falling" are continuously getting triggered while the platform is on landing position is not correct, is suppose. Need to find a way to stop the shake.

    2) I have attached the project here for enabling you to review the code. If you can think of an alternative approach I would be happy to try out.

    https://dl.dropboxusercontent.com/u/749 ... /JUMP.capx

  • Ok, i didn't see it, when i read your first post. You are using platform behavior & physics together, what is not a good idea to do. So, you have 2 solutions: stay with platform behavior and put the physics out (most time the better idea, for one game like this you don't really need physics) and emulate the physics behavior (for your player falling for example you can use 'simulate control pressing down')

    or

    you stay with physics and change the conditions to physic ones, like comparing y-velocity for falling etc.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • This is something that should be highlighted more strongly in the manual, but it is pointed to here: https://www.scirra.com/manual/98/physics.

    Basically, physics and other behaviors don't mix very well and can cause unpredictable results, such as teleporting.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)