Want to make the mouse the "forward" direction of the player
Posted: Wed Feb 13, 2013 4:03 am
So here's my game that I've been working on. I've taken a break from it for a week or two because I got frustrated with it but now I'm ready to learn more about Lua and Love(No idea how to make the accent there.)
The reason I got frustrated is I want the player to move towards the mouse when they press "w." Right now, the game uses wasd to move around but "w" is "up" in terms of how the screen is. I need "up" to be where-ever the mouse happens to be. I'd like to keep the momentum thingy I've got going. I know about the atan2 thing, hence why my ship spins with the mouse. But the whole "moving towards the mouse" is throwing me off.
I'd still like the "asd" keys to move the ship "left, right, back" but only in relevance to where the mouse is, since the pointer is supposed to be "forward."
It's probably something right in front of me, like most of my problems, but as a beginner, I can't seem to figure it out.
WASD - move the player
Right Mouse - fire
Scroll Wheel - Change active colors
The reason I got frustrated is I want the player to move towards the mouse when they press "w." Right now, the game uses wasd to move around but "w" is "up" in terms of how the screen is. I need "up" to be where-ever the mouse happens to be. I'd like to keep the momentum thingy I've got going. I know about the atan2 thing, hence why my ship spins with the mouse. But the whole "moving towards the mouse" is throwing me off.
I'd still like the "asd" keys to move the ship "left, right, back" but only in relevance to where the mouse is, since the pointer is supposed to be "forward."
It's probably something right in front of me, like most of my problems, but as a beginner, I can't seem to figure it out.
WASD - move the player
Right Mouse - fire
Scroll Wheel - Change active colors