## the player randomely jumps without me pressing the jump button

Show off your games, demos and other (playable) creations.
A-lox
Prole
Posts: 43
Joined: Sun Apr 10, 2022 1:58 am

### the player randomely jumps without me pressing the jump button

The player randomly jumps when I move around
to move left and right press the "arrow keys" to press the "z" key.
Press "l" to load a test map
this game uses the "Windfield" library
Attachments
Game.zip
the game
Last edited by A-lox on Thu Mar 16, 2023 1:09 am, edited 1 time in total.
Bigfoot71
Party member
Posts: 235
Joined: Fri Mar 11, 2022 11:07 am

### Re: the player randomely jumps without me pressing the jump button

The controls are a bit risky but good work and no one will laugh, it's not the purpose of the forum I assure you

However I did not understand:
The player randomly jumps when I move around
Is this a problem you encounter?
My avatar code for the curious V1, V2.
A-lox
Prole
Posts: 43
Joined: Sun Apr 10, 2022 1:58 am

### Re: the player randomely jumps without me pressing the jump button

Bigfoot71 wrote: Thu Mar 16, 2023 12:10 am The controls are a bit risky but good work and no one will laugh, it's not the purpose of the forum I assure you

However I did not understand:
The player randomly jumps when I move around
Is this a problem you encounter?
yes, that is the problem that I encountered.
thank you for playing it
Last edited by A-lox on Thu Mar 16, 2023 1:10 am, edited 1 time in total.
A-lox
Prole
Posts: 43
Joined: Sun Apr 10, 2022 1:58 am

### Re: the player randomely jumps without me pressing the jump button

sorry I did not mean to comment this(

[quot=Bigfoot71 post_id=253900 time=1678925406 user_id=188439]
The controls are a bit risky but good work and no one will laugh, it's not the purpose of the forum I assure you

However, I did not understand:
The player randomly jumps when I move around
Is this a problem you encounter?
[/quo
how would you go about making the controls less risky and less jittery
)
Last edited by A-lox on Thu Mar 16, 2023 1:11 am, edited 3 times in total.
Bigfoot71
Party member
Posts: 235
Joined: Fri Mar 11, 2022 11:07 am

### Re: the player randomely jumps without me pressing the jump button

Well precisely I did not encounter this problem personally, but it is not due to this L207 from main.lua (?):

Code: Select all

    if player.hitbox:enter('jump') then
player.hitbox:applyLinearImpulse(0, -900)
end
I only skimmed the code I didn't go deeper than that, but this line checks the collision with an object of the "jump" class and if the player collides with it, what is it? supposed to mean?

Is this normal, or if it is is it due to an object that is of class "jump" when it shouldn't?

Otherwise for the controls I will simply find the right balance between the left/right velocity and the jump

I also noticed that when jumping when going against a wall (not sure what collision class this is referring to) the character no longer falls due to setLinearVelocity with 0 on Y.

You might be able to solve this by getting the velocity on Y upstream and applying that to the new one and applying that X to the new velocity. It's a simple suggestion, give it a try.
My avatar code for the curious V1, V2.

### Who is online

Users browsing this forum: No registered users and 22 guests