Hi! I'm making an endless running side scrolling game and the jumping jumps too far when the speed is increased. The speed of the game is increased overtime and the jumping jumps further out.
For example at lets say at speed 1 when the player jumps the player moves 100 px, but at speed 5, when the player jumps the player moves 500 px. How can I make the player only jump a certain distance regardless of the speed?
Thanks in advanced for the help!
Player jumping increases with speed
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Player jumping increases with speed
- Attachments
-
- SideJump.love
- (186.41 KiB) Downloaded 151 times
Re: Player jumping increases with speed
I haven't looked at your code but, if you are using dt and you multiply it by the speed, make sure to divide it again by the speed when you are jumping.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Player jumping increases with speed
Well when the game speeds up, I add the speed to the scrolling so it speeds up the map movement. But, that results in the jumping to jump further.Davidobot wrote:I haven't looked at your code but, if you are using dt and you multiply it by the speed, make sure to divide it again by the speed when you are jumping.
Re: Player jumping increases with speed
That's because, as you are in the air, the map moves under you. You can try dividing the jump speed of the player by the speed?lieudusty wrote:Well when the game speeds up, I add the speed to the scrolling so it speeds up the map movement. But, that results in the jumping to jump further.Davidobot wrote:I haven't looked at your code but, if you are using dt and you multiply it by the speed, make sure to divide it again by the speed when you are jumping.
PM me on here or elsewhere if you'd like to discuss porting your game to Nintendo Switch via mazette!
personal page and a raycaster
personal page and a raycaster
Re: Player jumping increases with speed
In your place, I personally would leave it like it is, because this is the physically correct behavior.
If you still want to change it you have two options: Either change the jumping height (by making the initial jumping velocity smaller) or increase gravity. Since the games speed increases you have to decrease the air time of the player to keep the jumping distance constant.
If you still want to change it you have two options: Either change the jumping height (by making the initial jumping velocity smaller) or increase gravity. Since the games speed increases you have to decrease the air time of the player to keep the jumping distance constant.
Check out my blog on gamedev
Re: Player jumping increases with speed
Ah ok, I just added the map speed to the jumping velocity and now the jumping is relative to the map speed. Thanks!Davidobot wrote:That's because, as you are in the air, the map moves under you. You can try dividing the jump speed of the player by the speed?lieudusty wrote:Well when the game speeds up, I add the speed to the scrolling so it speeds up the map movement. But, that results in the jumping to jump further.Davidobot wrote:I haven't looked at your code but, if you are using dt and you multiply it by the speed, make sure to divide it again by the speed when you are jumping.
Re: Player jumping increases with speed
After I fixed it, it seemed a bit unnatural so I just kept it like it wasmicha wrote:In your place, I personally would leave it like it is, because this is the physically correct behavior.
If you still want to change it you have two options: Either change the jumping height (by making the initial jumping velocity smaller) or increase gravity. Since the games speed increases you have to decrease the air time of the player to keep the jumping distance constant.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 7 guests