Mouseclick Movement
by Hugo Queiriga · in Torque Game Builder · 07/18/2006 (10:39 pm) · 2 replies
Hi, i've just inplemented mouse movement on my ship, but i would like to make the ship move on the mouse click i.e. comand and conquer type
I was wondering if i did this it would do it, however the ship goes at first but then just jets off with a massive impulse.
This is the code used.
function sceneWindow2D::onMouseDown(%this, %mod, %worldPosition, %mouseClicks)
%this.mouseMoveShip(%mod, %worldPosition);
Does anyone, got tips how to fix this and make it better? I also was wondering, if i clicked in the game map, the i would like for the sprite of my ship to rotate in the direction of the click so it looked like it was turning! if anyone could help me with that it would be appreciated.
Thanks in advance,
Hugo
I was wondering if i did this it would do it, however the ship goes at first but then just jets off with a massive impulse.
This is the code used.
function sceneWindow2D::onMouseDown(%this, %mod, %worldPosition, %mouseClicks)
%this.mouseMoveShip(%mod, %worldPosition);
Does anyone, got tips how to fix this and make it better? I also was wondering, if i clicked in the game map, the i would like for the sprite of my ship to rotate in the direction of the click so it looked like it was turning! if anyone could help me with that it would be appreciated.
Thanks in advance,
Hugo
#2
07/19/2006 (8:11 am)
Thanks Thomas, i'll have a look at it i think the turret is exactly what i was looking for, very usefull resources!
Torque Owner Thomas Buscaglia