Page 1 of 1

mouse tracker

PostPosted: Fri Jan 18, 2013 8:15 pm
by sonicforvergame
if somebody ever played sonic battle you will totally understand this

Sonic battle use an rpg and 2D battle style game
for the RPG part there is a cursor that you can move freely and when you click (the cursor) sonic will move to the cursor position
But i want to say that sonic dosen't directly go to the cursor he walk to it and you can see him going to the cursor

I wanted to do this on GE but i ended up having sonic directly going to the cursor this is why i talked about how sonic move in sonic battle
ANYWAY i want to make sonic walk to the cursor And for making sonic walk to the cursor i don't really know what to do

I would like some advice and help :D

Re: mouse tracker

PostPosted: Fri Jan 18, 2013 8:19 pm
by skydereign
Easiest way is to use the function MoveTo. You can look it up here http://game-editor.com/docs/script_reference.htm as well as on the forums. You may need to set the animation of sonic to reflect the proper direction of movement though.

Re: mouse tracker

PostPosted: Fri Jan 18, 2013 8:48 pm
by sonicforvergame
oh no i am just going to use left and right animation
it may sound weird but i will give a demo soon

Re: mouse tracker

PostPosted: Fri Jan 18, 2013 10:26 pm
by Hblade
draw actor of the tracker:
Code: Select all
angle=direction(xscreen, yscreen, xmouse, ymouse);
xvelocity=distance(xscreen, yscreen, xmouse, ymouse)/2;