I'm making a top-down view game and having trouble implementing a WASD + Mouse control scheme. Any pointers/tutorials?
Printable View
I'm making a top-down view game and having trouble implementing a WASD + Mouse control scheme. Any pointers/tutorials?
Yup, you've got the w,a,s,d bit down, for the mouse control, have a top "torso" and legs "bottom" have the bottom controlled by the keyboard, and have the top half look at the mouse pointer, you have to make a second object set to the mouse's x,y position "always" because there is no look at mouse pointer event. Make it a crosshairs or something.
Thank you so much!
Look at mouse pointer event? Sounds interesting.
I'm having a problem with this. My game area is bigger than any one screen, and I have to set the mouse-controlled (crosshair) object's area to that whole area. But this makes the player's rotation uneven (smooth when the cursor is near, choppy when it's off-screen) and also has the obvious problem of letting the cursor go off-screen. Any ideas?
Heh Novabrain, this would probably be really easy to add to MMF but not as an extension, as part of MMF. :)
No, your using the wrong method. :)
Remove the Mouse controlled Movement completely and add this code as a behavior inside your crosshairs.
Always
Set Crosshairs X Position to X Mouse
Set Crosshairs Y Position to Y Mouse
You can find the Mouse controls in the list of options to apply to the crosshairs object look for Position Set X Set Y, then you can Choose in the expression evaluator [color:#FF0000][Retrieve data from object][/color]Once on that form Choose [color:#FFFF00][The Mouse Pointer and Keyboard][/color] Remember you have to do this for the X Position of your Crosshairs and the Y Position of your Crosshairs.
Now that I think about it, it is a bit complicated if you don't have experience. :crazy:
[color:#33CC00]
P.S. I'm telling you to go into the Behaviors of your crosshairs to add the CODE to keep the confusion down, it's harder from the main event editor because there is so much data to examine.[/color] :grin:
Hey, thanks! Now things are working really well.