Much though I love the OO aspects of BlitzMax (Mac version), I'm experiencing some wierdness.
I have the following user type defined:
Type entity_t
Field x,y
Method Update() Abstract
Method DrawGame() Abstract
Method DrawMap() Abstract
End Type
This type is then extend as follows:
Type wall_t Extends entity_t
Method DrawMap()
drawimage editWALL, x*16, y*16
End Method
Function Create:wall_t(dx:Int,dy:Int)
Local w:wall_t = New wall_t
w.x = dx
w.y = dy
Return w
End Function
End Type
I attempt to create a new instance of the type using:
levelList.AddLast(wall_t.create(x,y))
and the compile fails with:
Compile Error:Unable to create new object of abstract type 'Type'
The lines generating the error is this one:
Local w:wall_t = New wall_t
Anyone have any ideas what I'm doing wrong?
Cheers
John
I have the following user type defined:
Type entity_t
Field x,y
Method Update() Abstract
Method DrawGame() Abstract
Method DrawMap() Abstract
End Type
This type is then extend as follows:
Type wall_t Extends entity_t
Method DrawMap()
drawimage editWALL, x*16, y*16
End Method
Function Create:wall_t(dx:Int,dy:Int)
Local w:wall_t = New wall_t
w.x = dx
w.y = dy
Return w
End Function
End Type
I attempt to create a new instance of the type using:
levelList.AddLast(wall_t.create(x,y))
and the compile fails with:
Compile Error:Unable to create new object of abstract type 'Type'
The lines generating the error is this one:
Local w:wall_t = New wall_t
Anyone have any ideas what I'm doing wrong?
Cheers
John