I can't get collision detection to return an object, well, I can but I can't use methods in that object. That which makes it pretty useless. I check to see if the object is the correct type (TPill), then I try to call a method in the super of TPill (that is TEntity, method is Destory).
The compile error I get is: Identifier 'Destroy' not found
Checking for a collision:
Local c:Object[]=CollideRect(X-8,Y-8,24,24,1,0)
If c.length>0 And c[0]<>Null
If TPill(c[0])
c[0].Destroy()
EndIf
EndIf
Adding the collision thingy to the thingy system before collision code is ran: (in a method)
CollideRect(X*32+12,Y*32+12,4,4,0,1,Self)
Actual collision works, but its useless if I can't access the methods of the object it collides with.
Thanks ;)
|