Game Development Community

Mouse && world limit question

by Michael S · in Torque Game Builder · 10/18/2006 (7:23 am) · 0 replies

I'm in training and i try to make feeding frenzy
i've 2 question about mouse
1.how to set mouse so it'cant leave window so it's locked on my window game
like feeding frenzy
2.i tried to make game feeding frenzy but i stumbled on this
i've a big background and a fish ( that's my player )
and i've mount my camera on it and if i move my mouse so do the fish
and i make the window status ( information about myfish live,score,food bar ) on top by using gui editor
the question is how to change myfish worldlimit so it didn't go over my window status on top

like the original feeding frenzy

here is my script

function SceneWindow2D::onMouseMove(%this, %mod, %worldPosition)
{
$nx=(getword(%worldPosition,0));
$ny=(getword(%worldPosition,1));
$fishDist = vectorDist($nx SPC $ny, myfish.getPosition);
if (myfish.getflipx()==true && $nx>myfish.getpositionx())
{myfish.setflipx(false);}
else if (myfish.getflipx()==false && $nx {myfish.setflipx(true);}
}

function fishlevel::onUpdateScene(%this)
{
myfish.moveTo($nx SPC $ny, $beeDist*1.2);}

// i tried this script to change myfish worldlimit but it didn't go like i want
//%ny=getword(scenewindow2d.getcurrentcameraposition(),1);
//%ny=%ny-20;
//mybee.worldlimitmin="-105 " @ %ny ;

}

could somebody help me please