Setting Destination with Mouse Down
by rennie moffat · in Torque Game Builder · 08/06/2009 (9:04 am) · 1 replies
PLEASE EXCUSE MY NOOBIENESS...
I am really struggling in how to grasp using a mouseDown event to determine the destination of my object.
So far my idea is...
I am very confused, mainly because the methods I want or think I should use, appear as functions to me with their own variables, and as such I am unsure of how to implement what I think should be pretty simple for anyone with relatively good experience. Please help a newb.
I am really struggling in how to grasp using a mouseDown event to determine the destination of my object.
So far my idea is...
function setCubeDestination::onMouseDown(%this, %worldPos, %clicks)
{
///my first line of code must set or record the position of the mouse when clicked but I am unsure how as setPosition is for an object, not a mouse click, but can a mouse click be an object?
///my second line must determine that this record of the mouse clicked position, is the destination for the object. setPositionTarget?
///my third line of code must tell the object to move there at said speed, using X animation. moveTo? animation can come later
}I am very confused, mainly because the methods I want or think I should use, appear as functions to me with their own variables, and as such I am unsure of how to implement what I think should be pretty simple for anyone with relatively good experience. Please help a newb.
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
Torque Owner rennie moffat
Renman3000
with this code I set the target position. Now I obviously want X and Y to be dependent on what area of the world I select. So would %x %y do for my needs? just thinking aloud.