If velocity can't be less than zero, then you can delete the if(velocity == 0) in blue, above.
An else is all that you need there.
Type: Posts; User: Adak
If velocity can't be less than zero, then you can delete the if(velocity == 0) in blue, above.
An else is all that you need there.
change this line:
else(velocity == 0)
//to
else if(velocity == 0)