I'm trying to get a good bounce but each arc is higher than the last. I should bounce lower and lower until it rolls. Where is my error?
Width = 800
Height = 600
Depth = 32
SET DISPLAY MODE Width, Height, Depth
X AS WORD `Location 'X'
X = 0
Y AS WORD `Location 'Y'
Y = Height/2
XVel AS FLOAT `Velocity 'X'
XVel = 1
YVel AS FLOAT `Velocity 'Y'
YVel = -4
Gravity AS FLOAT
Gravity = 0.225
TempA AS FLOAT
CIRCLE X, Y, 10
DOT X, Y
SLEEP 1500
WHILE X < 640
SLEEP 50
YVel = Yvel + Gravity
X = X + XVel
Y = Y + YVel
IF Y >= Height
TempA = Height - Y
Y = Height + TempA
YVel = YVel * -1
ENDIF
DOT X, Y
ENDWHILE
If there's anything else wrong with my code, or it could be more streamlined, I could you use the help. Mostly I just want the dot to bounce.
Thanks!
I do not feel pain; only the lack of a controller.