Strict Graphics 1024,768,16,0 Global particle_count:Int = 0 Global particle_list:TList = New TList SetMaskColor 255,0,255 Global particles:TImage = LoadImage("particle.png",MASKEDIMAGE) Type particle Field x:Int, y:Int, s:Int Function create() While particle_count = 0 For Local i:Int = 0 To 100 p:particle = New particle p.x = MouseX() p.y = MouseY() p.s = Rand(3,10) list.addlast particle,partical_list If i:Int >=100 particle_count = 1 EndIf Next Wend End Function Method destroy(p:particle) For Local p:particle = EachIn particle_list If p.x >1026 Or p.x < -2 p.particle = Null EndIf If p.y > 770 Or p.y < -2 p.particle = Null EndIf Next Return p:particle End Method Method update() For Local p:particle = EachIn particle_list p.x:+3 Next End Method Method draw() For Local p:particle = EachIn particle_list DrawImage particles,p.x,p.y,0 Next End Method End Type Repeat Cls p.create() p.draw() p.update() Flip Until KeyHit(KEY_ESCAPE)
As you can see from the above I have no clue as to what I'm doing.
Dont worry about the update() method it just has a simple thing in it. All I'm trying to do now is get it to work but it doesnt. I still have not grasped OOP.