Door Problems
by Joshua Steffen · in Torque Game Builder · 08/15/2010 (8:54 pm) · 3 replies
a found a door script but it wont switch my level why?
and here is the link: http://tdn.garagegames.com/wiki/Torque_2D/GenreTutorials/PlatformerAdditional/Doors
and here is the link: http://tdn.garagegames.com/wiki/Torque_2D/GenreTutorials/PlatformerAdditional/Doors
About the author
I Use TGB.
#2
function Door::onCollision(%srcObj,%dstObj,%srcRef,%dstRef,%time,%normal,%contactCount,%contacts)
{
if(%dstObj.class$="PlayerClass")
{
sceneWindow2D.schedule(10,loadLevel,"platformer/data/levels/lvl2.t2d");
}
}
08/23/2010 (9:14 pm)
this is the codefunction Door::onCollision(%srcObj,%dstObj,%srcRef,%dstRef,%time,%normal,%contactCount,%contacts)
{
if(%dstObj.class$="PlayerClass")
{
sceneWindow2D.schedule(10,loadLevel,"platformer/data/levels/lvl2.t2d");
}
}
#3
08/24/2010 (11:51 am)
Use echo statements to confirm the logic is reaching where you expect:function Door::onCollision(%srcObj,%dstObj,%srcRef,%dstRef,%time,%normal,%contactCount,%contacts)
{
echo("Door::onCollision");
if(%dstObj.class$="PlayerClass")
{
echo("Door::onCollision: player");
sceneWindow2D.schedule(10,loadLevel,"platformer/data/levels/lvl2.t2d");
}
}
Torque Owner Kevin James