SuperStrict
Global objects:TList = New TList
Graphics(800, 600)
Global spr:TImage = LoadImage("test.bmp")
Global test:Particle = Particle.Create(100, 100, spr)
While(Not KeyDown(KEY_ESCAPE))
For Local o:Entity = EachIn(objects)
o.Think()
Next
Flip(0)
Cls
EndWhile
Type Entity
Field x:Float
Field y:Float
Method New()
objects.AddLast(Self)
End Method
Method Think()
End Method
EndType
Type Particle Extends Entity
Field Sprite:TImage
Method New()
objects.AddLast(Self)
End Method
Method Think()
DrawImage(Sprite, x, y)
End Method
Function Create:Particle(x:Float, y:Float, sprite:TImage)
Local newParticle:Particle = New Particle
newParticle.x = x
newParticle.y = y
newParticle.Sprite = sprite
Return newParticle
EndFunction
EndType