Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard controls #19

Open
AppPhil opened this issue Jul 8, 2016 · 4 comments
Open

Keyboard controls #19

AppPhil opened this issue Jul 8, 2016 · 4 comments

Comments

@AppPhil
Copy link
Contributor

AppPhil commented Jul 8, 2016

For testing TerraLegion on my computer I don't like using the joystick. When I press "A" or "D" the character moves to the left or to the right. When I press space I jump only sometimes when I'm not completely standing on a block. Do you understand what I mean?

@jmrapp1
Copy link
Owner

jmrapp1 commented Jul 8, 2016

Yeah I believe there is a small bug for the jumping which doesn't work when the space bar is pressed although it works with the joystick. It's very strange, but it needs to be looked at.

@AppPhil
Copy link
Contributor Author

AppPhil commented Jul 9, 2016

When I comment out this (

w1.setVelocity(w1.getVelX(), 0); //Stop all vertical movement
) and the line after jumping with the keyboard is working but then the player falls down very fast in some cases.

@jmrapp1
Copy link
Owner

jmrapp1 commented Jul 9, 2016

Yeah that needs to remain. We may need to add some special case to check if the player is trying to jump and if they are, don't do "some case" in the physics logic.

@AppPhil
Copy link
Contributor Author

AppPhil commented Jul 9, 2016

Here I tried to fix it: https://github.com/AppPhil/TerraLegion/commit/1c88eb0b6b8218e13dbeb7df6d48f0bed38dffe3

With this code you can jump with "W", "UP" or "SPACE" but when there's a block over you and you collide with it you stuck there for a short time. After that you normally fall down.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants