![Sad :(](http://game-editor.com/forum/images/smilies/icon_sad.gif)
![Razz :P](http://game-editor.com/forum/images/smilies/icon_razz.gif)
Upload me a ged demo
reupload my ged file with the problem fixed
or explain it easily as a reply post
please reply, and I'll put your name in the credits of my new game
KnuckleCrunchGames
P.S here is the ged -
if(jump>0)
{
jump--;
player.yvelocity = -10;
}
skydereign wrote:If you don't understand what someone meant in a post, reply to that post asking instead of making a new topic. There's less clutter that way. But since you already created this topic, what schnellboot was getting at is the reason for multiple jumps is that there is no jump variable limiting the number of jumps the player can have. Typically people create a variable called jump, which when colliding with the ground actor is set to one. When you jump, you use code like this.
- Code: Select all
if(jump>0)
{
jump--;
player.yvelocity = -10;
}
Notice with that code, if jump was 0, the player can't jump anymore. And if jump was greater than or equal to 1, the player can jump (and it will reduce jump by 1, eventually stopping the player from jumping).
knucklecrunchgames wrote:I'm very sorry sky but I'm still confused. Do I enter in this code you gave to me?
skydereign wrote:knucklecrunchgames wrote:I'm very sorry sky but I'm still confused. Do I enter in this code you gave to me?
This is a very simple problem that doesn't apply to just endless runner games. You don't need an endless runner ged to figure this out. All you need to do is create a variable called jump. In the player's collision event with the ground, set jump to 1. In the player's jump event, check if jump is greater than 0, and if so set yvelocity for the player to the proper jump value and lower jump by 1. That last bit I already provided the code. If you still don't understand, there are plenty of demos already showing how to stop infinite jumping that you can search for on the forums.
Users browsing this forum: No registered users and 1 guest