When building the code below, I keep getting an error saying:
Compile Error
Unable to create new object of abstract "Type"
With no debugger, I'm clueless as to what I'm doing wrong. I am new to all this OOP stuff, but from what I've learned so far my code should be fine. Could someone enlighten me? :)
Compile Error
Unable to create new object of abstract "Type"
With no debugger, I'm clueless as to what I'm doing wrong. I am new to all this OOP stuff, but from what I've learned so far my code should be fine. Could someone enlighten me? :)
'CREATE GLOBAL LIST FOR SPRITE Global SpriteList:TList = CreateList() 'OBJECT: '--- A simpler way to work with Images Type tSprite '--- SPRITE PROPERTIES --- Field Image:TImage Field Mode:Int Field ScaleX:Float Field ScaleY:Float Field Angle:Float Field Alpha:Float Field Tint:Int [3] '------------------------- '--- SPRITE CONSTRUCTOR --- Function Create:tSprite (_Image:TImage, _Mode:Int = SOLIDBLEND) '--- CREATE NEW SPRITE Local o:tSprite = New tSprite '--- INITIATE SPRITE WITH DEFAULTS o.Image = _Image o.Mode = _Mode o.ScaleX = 1.0 o.ScaleY = 1.0 o.Angle = 0.0 o.Alpha = 1.0 o.Tint = [255,255,255] '--- ADD NEW SPRITE TO LIST SpriteList.AddLast(o) '--- RETURN CREATED OBJECT Return o End Function '-------------------------- '--- RENDER METHOD --- Method Render (_X:Float, _Y:Float, _Frame:Int = -1) '--- CREATE TEMPORARY VARIABLES Local _ScaleX:Float Local _ScaleY:Float Local _Angle:Float Local _Alpha:Float Local _Mode:Int Local _Tint:Int [3] '--- STORE CURRENT SETTINGS _Angle = GetRotation () _Alpha = GetAlpha () _Mode = GetBlend () GetScale _ScaleX,_ScaleY GetColor _Tint[0],_Tint[1],_Tint[2] '--- SET OBJECTS SETTINGS SetScale ScaleX, ScaleY SetRotation Angle SetAlpha Alpha SetBlend Mode SetColor Tint[0], Tint[1], Tint[2] '--- SET FRAME If _Frame = -1 Then _Frame = Frame '--- DRAW IMAGE DrawImage Image, _X, _Y, _Frame '--- RESTORE SETTINGS SetScale _ScaleX, _ScaleY SetRotation _Angle SetAlpha _Alpha SetBlend _Mode SetColor Tint[0], Tint[1], Tint[2] End Method '----------------------- Method Update() Abstract End Type