CodeBase - Having An Object At The Mouse Pointer

Return to the CodeBase listing

Category: 3D

Version: 1.0

0
0

Information

Uploaded: 12th May 2004 12:54

Modified: 1st Jan 1970 01:00

Author:  WhizzRich

Summary

Source code for keeping an object at the mouse pointer, which is a must for RPG and RTS style games.

Full Description

Unfortunately this code is only for top-down games, although I imagine it shouldn't be too much hassle to change it. It might even work already for a slanted camera, I haven't tried it. The mousesensitivity# is how quickly the mouse should move across the screen; the higher the value the slower the mouse will move.<br /> <br /> Logically, the code works by checking how much the mouse has moved from it's position in the last game sync, and moving the object (which I called mouse) this amount. The mouse pointer is then moved to the object's screen co-ords.<br /> <br /> This is a definate must for all RPG and RTS style games (how can you play this type of game without the mouse?).<br /> <br /> If you have any questions feel free to post a comment.<br /> <br /> Thanks,<br /> Rich (WhizzRich)

Comments

No comments yet.