Quote Originally Posted by JSoftware
You could also just make it a procedure variable
[pascal]
Sprite = Object
public
x,y,xspeed,yspeed,gravity,lastx,lasty,collision: integer;
solid: boolean;
img: TBitmap;
procedure Create();
procedure Destroy();
Collide: procedure of object; // Empty by default. I want to override it.
end;
[/pascal]

And then do:
[pascal]
Player: Sprite;
Player := Sprite.Create;
Player.Collide := @PlayerCollide; // Yells at me here
[/pascal]

You can't do it the other way around unless you hack the vmt. And that's not bound to work the same way on all platforms
This works exactly as I want. How would I define the default procedure for Sprite.Collide though? (Is it possible?) Obviously "procedure Sprite.Collide begin end;" no longer worked

This seems like it could be a solution: http://www.swissdelphicenter.ch/torr...ode.php?id=799 , but is there a better solution?