Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Sept 29, 2008 11:04:33 GMT -5
Hello members, a little fun physics. Graphics here: www.zshare.net/download/19638562e6d30cac/'Listing: option explicit Dim y,x,w,v,a Sub Main() Graphics.Initialize 640,480,false,16 Key.Initialize Mouse.Initialize a = graphics.loadImage("skull.png") y = 500 while Key.Pressed(vk_escape) = false if y >=470 then 'new skull randomize() x = rnd(600) y = rnd(100) v = rnd(1) * 30 -15 w = rnd(1) * (-20) end if graphics.clear if x < 8 then v = abs(v) * (1) if x > 590 then v = abs(v) * (-1) if y < 10 then w = abs(w) * (0.1) if y > 420 then w = abs(w) * (-0.1) w = w + 0.51 x = x + v y = y + w Graphics.Setxy a,x,y Graphics.SetImage a graphics.display 'graphics.setfPS 40 wend Graphics.Terminate Key.Terminate Mouse.Terminate End Sub call Main
|
|
|
Post by Guilect on Sept 29, 2008 17:57:51 GMT -5
I had to uncomment the line : graphics.setfPS 40 so that I could see what was going on. Otherwise it ran too fast.
Nice start, I can see using this type of routine in a platform style game.
|
|
|
Post by matthew on Oct 5, 2008 13:41:54 GMT -5
You should do some more of these Physics routines.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Oct 5, 2008 14:10:20 GMT -5
Hi Matthew,
alright !!
|
|