added applyBrakes routines

This commit is contained in:
Fennel Kora 2024-04-14 01:49:23 -04:00
parent 1bfb1ac80c
commit 62c94baacf

View file

@ -35,7 +35,8 @@ public class Vehicle {
} }
public void applyBrakes() { public void applyBrakes() {
currentSpeed = currentSpeed - 5; if (currentSpeed >= 5) {currentSpeed = currentSpeed - 5;}
else if (currentSpeed < 5) {currentSpeed = 0;}
} }
} }