Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   Share Worlds (http://www.alice.org/community/forumdisplay.php?f=6)
-   -   mouse tracking engine (follows mouse, no clicking required) (http://www.alice.org/community/showthread.php?t=3351)

arty-fishL 11-07-2009 03:27 PM

mouse tracking engine (follows mouse, no clicking required)
 
1 Attachment(s)
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: [url=http://www.foxytunes.com/artist/david+guetta+ft.+akon/track/sexy+female dog]David Guetta ft. Akon - Sexy Female dog[/url]
via [url=http://www.foxytunes.com/signatunes/]FoxyTunes[/url]

rich0e0rick 11-09-2009 04:31 PM

sweet
 
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 12: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 02: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 05:44 PM

Good job, but like I said...glitches or no

jtrawker 05-04-2010 01: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 01:39 PM

[QUOTE=jtrawker;20745]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?[/QUOTE]
Use this engine, and whenever the mouse is clicked, simply have the tank move to where the cursor object is.

jediaction 05-04-2010 02:22 PM

Rememerb my Hero's Tadctics, i ahd the saem problem, no body answered my question

[QUOTE=zarfang8;15050]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.[/QUOTE]

thanks

jtrawker 05-05-2010 12:36 PM

[QUOTE=zonedabone;20746]Use this engine, and whenever the mouse is clicked, simply have the tank move to where the cursor object is.[/QUOTE]

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

jediaction 05-05-2010 01: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:


All times are GMT -5. The time now is 11:18 PM.

Copyright ©2022, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.