small fun changes
authorstian853 <stian853@su15-112.ad.liu.se>
Mon, 4 Dec 2023 08:45:56 +0000 (09:45 +0100)
committerstian853 <stian853@su15-112.ad.liu.se>
Mon, 4 Dec 2023 08:45:56 +0000 (09:45 +0100)
assets/highscore.csv
src/Main_enemy.cc
src/Player.cc

index b5732abe77c568c85a7d654cae28a587dd47292b..fa967e13cdf2920ddeed138aae1cc7289547ae81 100644 (file)
@@ -1,5 +1,5 @@
 Gorilla,36
+Gorilla,32
+Gorilla,30
 Gorilla,27
 Gorilla,24
-Gorilla,18
-Gorilla,18
index 2aaf50602fabc7fe5b73061d4a66c1849ab58321..f62c459ae220a5d3ebf3aee9bcb00380121a949e 100644 (file)
@@ -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)
         {
index 78750b9c99dfa35e4c09cb9df54bbda2bc66874c..1f131ce99754c6e920328274c93003ddecff0567 100644 (file)
@@ -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;
         }
     }  
 }