Whack a Mole Tutorial work around?
by Ecliptic · in iTorque 2D · 03/25/2010 (4:15 pm) · 2 replies
Here guys, I am trying to help a friend out who is going through the tutorials and I can not come up with a work around for this... Because of the changes to the onLevelLoaded with the new updates, the tutorial doesn't work. If one wanted to create a simset, we could have that happen by adding a "Start button" that creates the simSet durring the transitions but how would you add the spawn points to the simSet without having them each a unique class to be manually added in?
Thanks guys!
Dane
///Create the Simset for the Moles spawn points...
function moleLevel::onLevelLoaded(%this)
{
%this.respawnPointSet = new SimSet();
}
function moleLevel::onLevelEnded(%this)
{
%this.respawnPointSet.delete();
}
///This is to add the spawnpoints to the simSet List.
function respawnPoint::onLevelLoaded(%this, %level)
{
%level.respawnPointSet.add(%this);
}
function respawnPoint::onLevelEnded(%this, %level)
{
if( isObject( %level.respawnPointSet ) )
%level.respawnPointSet.remove(%this);
}Thanks guys!
Dane
#2
03/28/2010 (3:49 pm)
Anyone..? There is no callback we can use to solve this solution in a simple manner?
Torque Owner Ecliptic
Is there a way to have all class sceneobjects added to a simSet in one line of code? Say my level is setUp with 7 holes with the class "SpawnPoint" as the class. The way the "onLevelLoaded" works, it is sending a message to all the respawnPoints at the moment the level is detected adding them to the set. How could we get this to work when using just a button with a "OnMouseDown" function without having to have every spawn point a separate class?