From 17d82d40d17daa7cb01bc41f89dbbc3b982bca82 Mon Sep 17 00:00:00 2001 From: stian853 Date: Mon, 4 Dec 2023 09:45:56 +0100 Subject: [PATCH] small fun changes --- assets/highscore.csv | 4 ++-- src/Main_enemy.cc | 2 +- src/Player.cc | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/assets/highscore.csv b/assets/highscore.csv index b5732ab..fa967e1 100644 --- a/assets/highscore.csv +++ b/assets/highscore.csv @@ -1,5 +1,5 @@ Gorilla,36 +Gorilla,32 +Gorilla,30 Gorilla,27 Gorilla,24 -Gorilla,18 -Gorilla,18 diff --git a/src/Main_enemy.cc b/src/Main_enemy.cc index 2aaf506..f62c459 100644 --- a/src/Main_enemy.cc +++ b/src/Main_enemy.cc @@ -27,7 +27,7 @@ void Main_enemy::update(Context& context) { if(tumbling) { - sprite.rotate(rotation/FPS); + sprite.rotate(-1*std::copysign(1, direction.x)*rotation/FPS); tumble_degrees += rotation/FPS; if (tumble_degrees >= 360) { diff --git a/src/Player.cc b/src/Player.cc index 78750b9..1f131ce 100644 --- a/src/Player.cc +++ b/src/Player.cc @@ -31,7 +31,7 @@ Player::Player(json& params) : collected{0}, max_speed{params["max_speed"]}, tum void Player::collision(Object& other) { - + move(false); } @@ -67,7 +67,7 @@ void Player::update(Context& context) if(tumbling) { - sprite.rotate(rotation/FPS); + sprite.rotate(-1*std::copysign(1, direction.x)*rotation/FPS); tumble_degrees += rotation/FPS; if (tumble_degrees >= 360) { @@ -140,7 +140,6 @@ void Player::handle_input(sf::Event& event) direction.x /= sqrt(len); direction.y /= sqrt(len); } - std::cout << "x: " << direction.x << "Y: " << direction.y << std::endl; } } } -- 2.30.2