A little bit physics.
Code: Select all
SCREEN 300,300,16,2
FrameLimit 25
Global x,y,r,yvel,xyel,yacc,Font
x =20 : y =100 : r =10 : yvel =-10.0 : xvel =10.0 : yacc =.98
Font = LoadFont("comic.ttf ",24)
SetFont Font
While KeyDown(1) = False
ClsColor 0,120,205
yvel = yvel + yacc
y = y + yvel
x = x + xvel
If y > 289 Then
yvel = -0.9 * yvel : y = 289 : xvel = xvel * 0.9
End If
If x > 285 Then
xvel = -xvel : x = 285
End If
If x < 10 Then
xvel = -xvel : x = 10
End If
Color 255,255,0
Text 68,8,"Something Newton"
DrawBall()
If xvel * xvel < 0.0001 Then
Exit
End If
DrawScreen
Wend
End
Function DrawBall()
color 0,200,100
Circle x, y, r, 1
color 255,0,0
Circle x, y, r - 2
End Function
EDIT:
Use code tags instead of quote tags next time, please.
-Dibalo