[ad_1]
Game Development Stack Exchange is a query and reply website for skilled and impartial recreation builders. It solely takes a minute to enroll.
Anybody can ask a query
Anybody can reply
The greatest solutions are voted up and rise to the highest
Asked
Viewed
2 instances
I’ve scoured by means of the web to discover a answer of this however that is the one answer that I might discover however it cancels the “yMove += jumpingVelocity * deltatime” as quickly as collision shouldn’t be detected anymore thus it immediately simply goes down. If I take away the isJumping the character continues to go up so long as the bounce button is pressed.
xMove = 0;
yMove = 0;
if (handler.getKeyManager().left) xMove -= movementVelocity * deltaTime;
if (handler.getKeyManager().proper) xMove += movementVelocity * deltaTime;
if (handler.getKeyManager().bounce && onFloor && !isJumping) {
yMove += jumpingVelocity * deltaTime;
isJumping = true;
}
else{
isJumping = false;
}
// gravity
yMove += gravity * deltaTime;
dechire is a brand new contributor to this website. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
$endgroup$
lang-java
[ad_2]