Greetings…
New problem for you guys to chew on:
In my little shooter game I control the player movement with the arrow keys, space for shooting and wasd for aiming up,down,left and right.
If the player presses the w (aim north) AND the d (aim east) keys at the same time I want the player to aim northeast.
How do I achieve that?
Right now my aiming code looks like this:
//aiming
if (Key.isDown(87)) {
this._rotation = 0;
fire();
}
if (Key.isDown(83)) {
this._rotation = 180;
fire();
}
if (Key.isDown(68)) {
this._rotation = 90;
fire();
}
if (Key.isDown(65)) {
this._rotation = 270;
fire();
}
// aiming end