Game Development Community

Need help making an opening gate

by David Cox · in Torque Game Engine · 03/20/2010 (11:32 pm) · 4 replies

I was wondering if anyone knows of any tutorials on making a gate that will open once the player has obtained an item/defeats an enemy.

#1
03/21/2010 (4:14 am)
That's easy - just provide an "open_door" animation and a convex for collision with no rendering shape.
When you obtain your item, play your animation and delete the convex when animation is finished - this will allow the player to pass through.
#2
03/21/2010 (2:02 pm)
Well, I'm still new to this so really need a tutorial that shows all the steps to do that as wanting a gate for a demo I'm making for class.
#3
03/30/2010 (7:44 am)
This might be a good place to start:

www.torquepowered.com/community/resources/view/10200
#4
03/30/2010 (9:28 am)
for a defeated enemy you could place code in it's onDisabled callback. If the enemies state is dead, open the gate(animation or however you intend to open the gate).

for an item obtained you could place code in the players onCollision callback. This is executed every time the player runs into something(anything). If it is an item, the player will attempt to pick it up. Mark the item somehow (dynamic datablock field, etc) and check for that field in this callback. If its there, open the gate.