Skip to content

Commit

Permalink
Regrab cursor
Browse files Browse the repository at this point in the history
  • Loading branch information
bit69tream committed Dec 27, 2023
1 parent eead644 commit d9a6b04
Showing 1 changed file with 23 additions and 16 deletions.
39 changes: 23 additions & 16 deletions src/sinister.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,30 +98,37 @@ void UpdateDrawFrame(void) {
Vector2Clamp(mouseCursor,
Vector2Zero(),
screen);

if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
DisableCursor();
}
}

#define PLAYER_MOVEMENT_SPEED 3

if (IsKeyDown(KEY_E)) {
player.position.y -= PLAYER_MOVEMENT_SPEED;
}
{
if (IsKeyDown(KEY_E)) {
player.position.y -= PLAYER_MOVEMENT_SPEED;
}

if (IsKeyDown(KEY_S)) {
player.position.x -= PLAYER_MOVEMENT_SPEED;
}
if (IsKeyDown(KEY_S)) {
player.position.x -= PLAYER_MOVEMENT_SPEED;
}

if (IsKeyDown(KEY_D)) {
player.position.y += PLAYER_MOVEMENT_SPEED;
}
if (IsKeyDown(KEY_D)) {
player.position.y += PLAYER_MOVEMENT_SPEED;
}

if (IsKeyDown(KEY_F)) {
player.position.x += PLAYER_MOVEMENT_SPEED;
}
if (IsKeyDown(KEY_F)) {
player.position.x += PLAYER_MOVEMENT_SPEED;
}

player.position =
Vector2Clamp(player.position,
Vector2Zero(),
screen);
player.position =
Vector2Clamp(player.position,
Vector2Zero(),
screen);

}

float background_x = Lerp(0, BACKGROUND_PARALLAX_OFFSET,
player.position.x / screen.x);
Expand Down

0 comments on commit d9a6b04

Please sign in to comment.