mirror of
https://github.com/Kapendev/parin.git
synced 2025-04-26 04:59:54 +03:00
Small coin example change.
This commit is contained in:
parent
7a801a02bc
commit
5f7972d438
1 changed files with 4 additions and 12 deletions
|
@ -27,18 +27,10 @@ void ready() {
|
|||
bool update(float dt) {
|
||||
// Move the player.
|
||||
auto playerDirection = Vec2();
|
||||
if (Keyboard.left.isDown || 'a'.isDown) {
|
||||
playerDirection.x = -1;
|
||||
}
|
||||
if (Keyboard.right.isDown || 'd'.isDown) {
|
||||
playerDirection.x = 1;
|
||||
}
|
||||
if (Keyboard.up.isDown || 'w'.isDown) {
|
||||
playerDirection.y = -1;
|
||||
}
|
||||
if (Keyboard.down.isDown || 's'.isDown) {
|
||||
playerDirection.y = 1;
|
||||
}
|
||||
if (Keyboard.left.isDown || 'a'.isDown) playerDirection.x = -1;
|
||||
if (Keyboard.right.isDown || 'd'.isDown) playerDirection.x = 1;
|
||||
if (Keyboard.up.isDown || 'w'.isDown) playerDirection.y = -1;
|
||||
if (Keyboard.down.isDown || 's'.isDown) playerDirection.y = 1;
|
||||
player.position += playerDirection * playerSpeed * Vec2(dt);
|
||||
|
||||
// Check if the player is touching some coins and remove those coins.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue