Newton

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

Newton

Post by peter » Tue Jan 12, 2010 10:32 am

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

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

Use code tags instead of quote tags next time, please.
-Dibalo


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

Re: Newton

Post by peter » Wed Jan 13, 2010 1:40 am

Hi Dibalo,

what is the difference between this both?

User avatar
Dibalo
Advanced Member
Posts: 298
Joined: Mon Aug 27, 2007 8:12 pm
Location: Espoo, Finland
Contact:

Re: Newton

Post by Dibalo » Wed Jan 13, 2010 2:17 am

Hi peter,

Code tags are designed for displaying source codes. As you can see, the result is much better looking than using a quote. It is easy to copy (thanks to the 'select all' button) codes and source codes takes less space. Thats why (imho) it's easier to read your post and to figure out the main points from it.
The darkest spells can be found from
http://tunkkaus.blogspot.fi

Post Reply