Object wierdness
BlitzMax Forums/BlitzMax Beginners Area/Object wierdness
| ||
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 |
| ||
Your base class entity_t has three abstract methods. The wall_t type extends this class but only defines one of the abstract methods. If you define the other two abstact methods I suspect the program will compile. |
| ||
Ahhhhh. Yup, that did the trick :) Thanks John |