I am having trouble getting my head around the OO side of things, I have ripped apart a tutorial in Wave's beginners guide and tried to adapt it to an 'explosion Object'.
This is the code I have, if any could let me know what I am doing wrong be appreciated.
This is the code I have, if any could let me know what I am doing wrong be appreciated.
Strict Global explo:TList=New TList Type Texplo Field x,y,f#,al# Method update() f=+0.25 al=-0.05 SetAlpha(al) DrawImage(myexplo,x,y,f) End Method Function createexplo:Texplo(xx,yy,ff) Local ex:Texplo=New Texplo ex.x=xx+Rnd(60)-30 ex.y=yy+Rnd(40)-20 ex.f#=ff ex.al#=1-(Rnd(20)/100) explo.AddLast ex End Function End Type Graphics 800,600,0 SetBlend( AlphaBlend ) SetMaskColor 0,0,0 Global myexplo:Timage=LoadAnimImage("explosion-001.png",128,128,0,16) Local i Repeat If MouseHit(1) For i=0 To 8 Texplo.createexplo MouseX(),MouseY(),0 Next EndIf Local i=0 For Local e:Texplo =EachIn explo e.Update i=+1 Next Print i Flip;Cls Until KeyDown(Key_Escape)