]> git.seodisparate.com - LD53/commitdiff
Rename static vars
authorStephen Seo <seo.disparate@gmail.com>
Sat, 29 Apr 2023 03:34:44 +0000 (12:34 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sat, 29 Apr 2023 03:34:44 +0000 (12:34 +0900)
src/helpers.rs

index 9b448d0885d69deb26466bd7f3c1c984e064d276..52d9cebd363a3195569c31d997f37fcf587275b7 100644 (file)
@@ -1,5 +1,5 @@
-static mut car_state: u8 = 0;
-static mut car_state_frames: u8 = 0;
+static mut CAR_STATE: u8 = 0;
+static mut CAR_STATE_FRAMES: u8 = 0;
 const CAR_FRAMES: u8 = 10;
 
 pub fn fill(color: u8) {
@@ -29,15 +29,15 @@ pub fn draw_mouse() -> Option<(i16, i16)> {
 
 pub fn toggle_car_state() -> bool {
     unsafe {
-        car_state_frames += 1;
-        if car_state_frames >= CAR_FRAMES {
-            car_state_frames = 0;
-            if car_state == 0 {
-                car_state = 1;
+        CAR_STATE_FRAMES += 1;
+        if CAR_STATE_FRAMES >= CAR_FRAMES {
+            CAR_STATE_FRAMES = 0;
+            if CAR_STATE == 0 {
+                CAR_STATE = 1;
             } else {
-                car_state = 0;
+                CAR_STATE = 0;
             }
         }
-        car_state != 0
+        CAR_STATE != 0
     }
 }