## Newton

Do you have something to share with us? A tip for newbies, perhaps? Post it here.
peter
Active Member
Posts: 123
Joined: Mon Oct 22, 2007 2:31 pm

### Newton

For own games or for fun.
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

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
``````
Best Regards.
EDIT:

-Dibalo

peter
Active Member
Posts: 123
Joined: Mon Oct 22, 2007 2:31 pm

### Re: Newton

Hi Dibalo,

what is the difference between this both?

Dibalo