Add mobile support
All checks were successful
Build & deploy web version / Build WebAssembly & deploy (push) Successful in 1m1s
All checks were successful
Build & deploy web version / Build WebAssembly & deploy (push) Successful in 1m1s
This commit is contained in:
parent
6e4f0428dc
commit
c4f7565d18
1 changed files with 567 additions and 69 deletions
|
|
@ -63,13 +63,11 @@ void movePlayer(unsigned char* keys, int deltaTime) {
|
|||
//<\input feldolgozása>
|
||||
//<sebesség kiszámítása>
|
||||
if(directionOfMovement != 0) {
|
||||
//billentyű lenyomás hatására elkezd gyorsulni
|
||||
if(abs(playerVelocity.x) < playerMaxVelocity.x) {
|
||||
//hogy ne lehesen gyorsabb a max sebességénél
|
||||
if(playerVelocity.x > playerMaxVelocity.x) playerVelocity.x = playerMaxVelocity.x;
|
||||
else if(playerVelocity.x < -playerMaxVelocity.x) playerVelocity.x = - playerMaxVelocity.x;
|
||||
playerVelocity.x += directionOfMovement * playerXAcceleration * deltaTime;
|
||||
}
|
||||
//billentyű lenyomás hatására elkezd gyorsulni, irányváltáskor pedig lefékez, majd megfordul
|
||||
playerVelocity.x += directionOfMovement * playerXAcceleration * deltaTime;
|
||||
//hogy ne lehesen gyorsabb a max sebességénél
|
||||
if(playerVelocity.x > playerMaxVelocity.x) playerVelocity.x = playerMaxVelocity.x;
|
||||
else if(playerVelocity.x < -playerMaxVelocity.x) playerVelocity.x = - playerMaxVelocity.x;
|
||||
}
|
||||
else {
|
||||
//lassulva megáll
|
||||
|
|
|
|||
Loading…
Reference in a new issue