PDA

View Full Version : mouse tracking engine (follows mouse, no clicking required)


arty-fishL
11-07-2009, 04:27 PM
Mouse tracking engine (follows mouse, no clicking required).

Alice has no function for making an object follow the mouse.
I solved this problem.
Hope you can use this engine in your worlds somehow, but if you do use it then post back to me so I can see what you've made of it (not so i can steal the credits for it).
The 'sensitivity' global variable can be refined to make the ball move at the same speed as the mouse.

What happens is it senses changes in mouse distances from the edges, then it translates these into directions for the on screen ball to move and calculates the ammount of metres equal to mouse distances for it to move.
it also uses a scale factor to fit different screen settings.

:)ps this is quite complicated just for a mouse movement tracker.


----------------
Now playing: David Guetta ft. Akon - Sexy Female dog (http://www.foxytunes.com/artist/david+guetta+ft.+akon/track/sexy+female dog)
via FoxyTunes (http://www.foxytunes.com/signatunes/)

rich0e0rick
11-09-2009, 05:31 PM
lol, this is weird, i just did a world like that to, but my code is much simpler, im gona post the world soon, its a jet fighter controlled by the mouse... lol, i play with the game more than i work on it...

good job man!!! the way you did it seems impossible!!, i just use the mouse distance to edges and used the X math formula to switch it into meters from 10 meters away from the camera... yours looks like plain code!!!! sweet!!!!

again, good work!

:D:D rick :D:D

jediaction
12-22-2009, 01:26 PM
It was ok, because on my computer, i dont know if it was supposed to go off, because when i moved the mouse in teh end, it went off and was following teh mouse very incorrectly, but other than that...GREAT JOB!

zarfang8
12-22-2009, 03:07 PM
I have actually never done a thing with following the mouse cursor. I have never been good with that, but I know that Jediaction uses a lot of 1st person shooters with mouse cursor aiming. I liked it though, that's really a lot of coding you did.

jediaction
02-06-2010, 06:44 PM
Good job, but like I said...glitches or no

jtrawker
05-04-2010, 02:07 PM
ok. but how would I get a series of object to move via a series of clicks? in other words, if i have a company of tanks how do i get them to move where i want them to by clicking?

zonedabone
05-04-2010, 02:39 PM
ok. but how would I get a series of object to move via a series of clicks? in other words, if i have a company of tanks how do i get them to move where i want them to by clicking?
Use this engine, and whenever the mouse is clicked, simply have the tank move to where the cursor object is.

jediaction
05-04-2010, 03:22 PM
Rememerb my Hero's Tadctics, i ahd the saem problem, no body answered my question

I have actually never done a thing with following the mouse cursor. I have never been good with that, but I know that Jediaction uses a lot of 1st person shooters with mouse cursor aiming. I liked it though, that's really a lot of coding you did.

thanks

jtrawker
05-05-2010, 01:36 PM
Use this engine, and whenever the mouse is clicked, simply have the tank move to where the cursor object is.

ok... but how would i do that multiple times? like for a different number of tanks?

jediaction
05-05-2010, 02:15 PM
Im waiting for the same answer to. I started and posted my game and still no one has helped me...so...waiting:confused:

AA3nut
06-03-2010, 07:55 PM
@jedi action
Well, you could make a system for selecting a number of tanks, and if you use the mouse tracker, you could make the object's turn to face and then mavoe forward the distance to the object.

jediaction
06-04-2010, 05:42 PM
@jedi action
Well, you could make a system for selecting a number of tanks, and if you use the mouse tracker, you could make the object's turn to face and then mavoe forward the distance to the object.

Have you even seen my game? Please take a look and help from there. Ok, thanks:D