Strict Incbin "ball.png" Global ball_list:TList = CreateList() Type ball Field x:Int,y:Int,s:Int Global ballcount = 0 Method create() b:ball = New ball ListAddLast ball_list,b b.x = Rnd(10,630) b.y = Rnd(10,470) b.s = Rnd(3,8) ballcount :+1 End Method End Type Graphics 640,480,16,0 Repeat Cls For b:ball = EachIn ball_list If b.ballcount < 100 b.create EndIf Next FlushMem;Flip Until KeyHit(KEY_ESCPE)
The above code does not work. I have a method that creates a new ball. The problem is when I try to call the mothod from within a loop it throws an error. Can anyone help?
Just to say that I have been using BlitzMax now for quite some time but without trying any of the OOP stuff. This is my second attempt at OOP and its beyond me for now.