Wotcha folks,
After several months of dipping my toes into DarkBasic, I'm back to Blitz once more (I should have learnt by now).
Just to get me started I've typed in one of my bouning ball routines but am puzzled as to why it's coughing and spluttering along.
I seem to remember writing something like this before and having literally thousands bouncing all over the place.
Also, if you swap oval for rect, why is it faster?
Have I missed something obvious?
Many thanks in advance.
Tobo.
After several months of dipping my toes into DarkBasic, I'm back to Blitz once more (I should have learnt by now).
Just to get me started I've typed in one of my bouning ball routines but am puzzled as to why it's coughing and spluttering along.
Graphics 800,600,32,2 SetBuffer BackBuffer() SeedRnd MilliSecs() ;set up ball type Type balls Field x,y,xx,yy End Type createballs() ;main While Not KeyHit(1) Cls drawballs() Flip Wend End ;draw balls Function drawballs() For ball.balls = Each balls ball\x=ball\x+ball\xx ball\y=ball\y+ball\yy If ball\x>780 Then ball\xx=-1 If ball\x<1 Then ball\xx=1 If ball\y>580 Then ball\yy=-1 If ball\y<1 Then ball\yy=1 Oval ball\x,ball\y,20,20 Next End Function ;create balls Function createballs() For f=0 To 1000 ball.balls = New balls ball\x=Rnd(700) ball\y=Rnd(500) ball\xx=1 ball\yy=1 Next End Function
I seem to remember writing something like this before and having literally thousands bouncing all over the place.
Also, if you swap oval for rect, why is it faster?
Have I missed something obvious?
Many thanks in advance.
Tobo.