Game Development Community

Beta 4 Fish Game Tutorial Problem

by James Petruzzi · in Torque Game Builder · 05/27/2006 (9:12 pm) · 2 replies

I'm on OS X, and i'm having a problem with the collision detection in the Fish Game Tutorial. I've rechecked this like 80 times... For some reason the FishFood::OnCollision function is being called but not spawning a bubble.

function FishFood::onCollision(%srcObj, %dstObj, %srcRef, %dstRef, %time, %normal, %contactCount, %contacts)
{
	
   if(%dstObj.class $= "PlayerFish")
   {
      echo("wakka wakka wakka");
      %srcObj.spawn();

   }
}

the echo works when its outside the If statement, so i know the functions being called.

Also on page 6 of "5- Adding Gameplay" has an incorrect screenshot (Figure 5.2.2). It's suppose to be the final settings for collision detection, but the Callback button isn't checked and Superscribe Ellipse is still checked.

thanks!

edit: ok it was because i didnt have a class typed in, just the name. does the tutorial tell you to type in the class? i'll have to look again.

#1
05/28/2006 (12:57 am)
I haven't actually worked the tutorial, but the 1st thing I would do is check the collisionGroup mask on the involved sprites. I reported a bug where the level editor is saving incorrect collisionGroup mask. But again I have not actually worked the tutorial so it might be something else entirely.
#2
05/30/2006 (8:50 am)
I'm fairly sure it instructs you to type in the "class"... though If I'm incorrect please correct me :)