added applyBrakes routines
This commit is contained in:
parent
1bfb1ac80c
commit
62c94baacf
1 changed files with 2 additions and 1 deletions
|
@ -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;}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue