Page 1 of 1

the player randomely jumps without me pressing the jump button

Posted: Wed Mar 15, 2023 11:08 pm
by A-lox
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
help me out, please.
this game uses the "Windfield" library

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

Posted: Thu Mar 16, 2023 12:10 am
by Bigfoot71
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?

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

Posted: Thu Mar 16, 2023 1:05 am
by A-lox
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 :) :awesome:

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

Posted: Thu Mar 16, 2023 1:08 am
by A-lox
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
)

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

Posted: Thu Mar 16, 2023 1:09 am
by Bigfoot71
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.