Game Development Community

How do I get playerfish to flip with mouse movement

by Johnny · in Torque Game Builder · 03/28/2008 (4:02 pm) · 0 replies

I had found a addition fish tutorial upon poking around and in it it had a section to use the mouse to control the playerfish.

In the keyboard functions this works fine and flips the fish when needed.
Ima bit lost on the mouse functions and wanted to know how to detect direction and flip the player fish with mouse movement please

heres the snip for the code
function SceneWindow2D::onMouseMove(%this, %mod, %worldPosition)
{
//..
// Enable this to make the fish move with your mouse, but
// GUI interferes with it so you'd have to do it another
// way or know how to fix that. :) This makes the game
// way too easy anyway.
//..
//$FishPlayer.setPosition(%worldPosition);
}

the ref tut is:
http://tdn.garagegames.com/wiki/TGB/ScriptTutorials/ScoreTutorial

Thank you in advance for any help or code you may provide

About the author