Game Development Community

"Subclassing" fxSceneObject2D

by Jason McIntosh · in Torque Game Builder · 03/02/2005 (11:47 am) · 3 replies

I want to create "subclasses" of fxSceneObject2D so I don't have to cram all my onCollision() handling into one function for every object in the game. I'm struggling on how to accomplish this, though. Is this even close?
$myObject = new fxSceneObject2D( MyClass ) {};
Could I then do:
MyClass::onCollision( etc etc )
{
    // Handle collision for this type of obj.
}
It's just too crazy not to modularize the code somehow.

#1
03/02/2005 (10:58 pm)
You'll probably need my OO code to get this working.
#2
03/03/2005 (2:49 am)
So stop talking about it and give it up :)