PDA

View Full Version : Mouse Cursor Aiming!


zero00
06-30-2011, 10:58 PM
I was inspired by the game, Sin and Punishment, recently and I wanted to try and make a cursor that moved in real time when the mouse moved. This experiment is working pretty well so far. (Had to do some difficult math and guesswork, though) :D

The cursor aiming code is bit "laggy", but I'll figure out to do fix it! (possibly...maybe)

BTW the spinning icosahedron is simply there for me to visually check for lag. It does nothing else. Also, after clicking the dot, do not resize the window, and if there any black bars around the window, please close the world and reopen it until they are gone.

Here it is!

Please download this and, if you want, see if you can find any way to improve this code!

Edit: I've streamlined the code a little. It runs much smoother! :D Please download Test 2!

x2495iiii
07-01-2011, 12:46 AM
Nice. Now we just need a way to detect whether a mouse click happens at the same time an object is under the cursor object (not the mouse cursor) without the use of physical bullets.

zero00
07-01-2011, 09:11 PM
Thanks to this post (http://www.alice.org/community/showthread.php?t=1975&highlight=quaternion), I was able to further optimize the mouse cursor...thing...

Anyway, here it is! Enjoy! :D

sfunk
07-01-2011, 09:18 PM
Nice. Now we just need a way to detect whether a mouse click happens at the same time an object is under the cursor object (not the mouse cursor) without the use of physical bullets.

you could always use my laser technique to do that (the elongated cylinder)

David B
08-02-2011, 07:18 AM
I checked it out, and I thought it was pretty good!

zero00
08-02-2011, 07:21 AM
Thanks! :D
I've been thinking of some interesting uses for this world.

Nighthawk0973
08-02-2011, 10:10 AM
Try and make it more responsive. It would be nice if the crosshair would go wherever your mouse went.