diff options
-rw-r--r-- | sim.cpp | 10 | ||||
-rw-r--r-- | sim.hpp | 2 |
2 files changed, 8 insertions, 4 deletions
@@ -685,9 +685,13 @@ void sim_frame(Frame *frame) { if (keys_pressed[KEY_R]) { // toggle rotating platform - platform_building->rotates = !platform_building->rotates; - if (platform_building->rotate_speed == 0) { - platform_building->rotate_speed = 1; + bool rotates = platform_building->rotates = !platform_building->rotates; + if (rotates) { + if (platform_building->rotate_speed == 0) { + platform_building->rotate_speed = 1; + } + } else { + platform_building->rotate_speed = 0; } } @@ -139,7 +139,7 @@ typedef struct { v2 move_p1; v2 move_p2; - float rotate_speed; + float rotate_speed; // rotation speed. if this isn't a rotating platform, this should be 0 u32 color; } Platform; |