I can't get the following code to work. I created it to learn the basics of OOP. At the line e:enemy=e.create("bmax120.png") the execution stops without a message. Can anyone help me?
P.S: I can see the potential of Bmax but Blitzplus was a hell lot easier to learn.
Nathan.
P.S: I can see the potential of Bmax but Blitzplus was a hell lot easier to learn.
Nathan.
Strict Graphics 800,600,0 Global List:TList = New TList Type enemy Field x:Int Field y:Int Field dx:Int Field dy:Int Field gfx:Timage Function Create:enemy(f:String) e:enemy=New enemy e.x=Rnd(0,799) e.y=Rnd(0,599) e.dx=1 e.dy=1 e.gfx=LoadImage(f) List.addlast e Return e End Function Method Draw() DrawImage(gfx,x,y) If x>800 Then dx=-1 If x<0 Then dx=1 If y>600 Then dx=-1 If y<0 Then dy=1 x=x+dx y=y+dy End Method End Type Global e:enemy Global j:Int '***** MAIN ***** DebugStop() List:TList=CreateList() For j=0 To 2 e:enemy=e.create("bmax120.png") Next While Not KeyDown(KEY_ESCAPE) Cls DebugStop() For e:enemy=EachIn List e.draw() Next Flip FlushMem Wend EndGraphics