Game Development Community

Level transition trigger

by Rich Wilson · in Torque X 2D · 09/16/2007 (11:50 am) · 2 replies

I'm about to implement a level transition trigger region, and I'm trying to think of the best way to do it. I have certain parameters that I want to be able to set on a per region basis in the editor, namely the destination level (and starting position in that level, but that will come online when I have a persistent data registry set up, etc. ).

So I was thinking about having a levelTransition component that I attach to the region that has both the string parameter of the scene to load and the onCollision delegate that the region will refer to when the player enters.

The only thing I'm trying to think of is how to get the delegate to know what the parameter is, since delegates are more of a singleton sort of thing, with no instance information. Or are they?

#1
09/16/2007 (12:07 pm)
My initial thought was working with my levelTransition component in addition to a collision component, but my current thinking is that I'll inherit from collision component and override the OnCollision code so there's no need for a delegate at all. This should do the trick.
#2
09/19/2007 (7:01 pm)
Yep, sounds good to me. In fact, that's how the triggers in the Platformer Kit work. :)