Removed player movement via right mouse button.
This commit is contained in:
parent
df94bad5e8
commit
e0ef9008c6
5 changed files with 9 additions and 19 deletions
15
README.txt
15
README.txt
|
@ -2,15 +2,14 @@
|
||||||
2d top down shooter with tactical gameplay set in a procedurally generated world.
|
2d top down shooter with tactical gameplay set in a procedurally generated world.
|
||||||
|
|
||||||
## Controls
|
## Controls
|
||||||
WASD: move
|
WASD: walk
|
||||||
Mouse: look
|
Mouse: aim
|
||||||
Lmb: shoot
|
Left Mouse Button: shoot
|
||||||
Rmb: walk to position
|
|
||||||
R: reload
|
R: reload
|
||||||
Q: use left Gadget
|
Q: use left gadget
|
||||||
E: use right Gadget
|
E: use right gadget
|
||||||
F: pick up item or swap Gadgets
|
F: pick up item or swap gadgets
|
||||||
Esc: exit
|
Esc: exit game
|
||||||
|
|
||||||
## Dependencies
|
## Dependencies
|
||||||
- SFML
|
- SFML
|
||||||
|
|
|
@ -322,10 +322,6 @@ Game::mouseDown(const sf::Event& event) {
|
||||||
case sf::Mouse::Left:
|
case sf::Mouse::Left:
|
||||||
mPlayer->pullTrigger();
|
mPlayer->pullTrigger();
|
||||||
break;
|
break;
|
||||||
case sf::Mouse::Right:
|
|
||||||
mPlayer->setDestination(convertCoordinates(event.mouseButton.x,
|
|
||||||
event.mouseButton.y));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,8 @@
|
||||||
|
|
||||||
#include "util/Vector.h"
|
#include "util/Vector.h"
|
||||||
|
|
||||||
|
// TODO: remove right click move (also in readme)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates Game object.
|
* Creates Game object.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -63,12 +63,6 @@ Player::setDirection(Direction direction, bool unset) {
|
||||||
setSpeed(dirVec, getMovementSpeed());
|
setSpeed(dirVec, getMovementSpeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
Player::setDestination(const Vector2f& destination) {
|
|
||||||
mDirection = 0;
|
|
||||||
Character::setDestination(destination);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if we arrived at destination, turn towards cursor.
|
* Check if we arrived at destination, turn towards cursor.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -37,7 +37,6 @@ public:
|
||||||
using Character::pullTrigger;
|
using Character::pullTrigger;
|
||||||
using Character::releaseTrigger;
|
using Character::releaseTrigger;
|
||||||
void setDirection(Direction direction, bool unset);
|
void setDirection(Direction direction, bool unset);
|
||||||
void setDestination(const Vector2f& destination);
|
|
||||||
using Character::getWeaponName;
|
using Character::getWeaponName;
|
||||||
using Character::reload;
|
using Character::reload;
|
||||||
using Character::toggleWeapon;
|
using Character::toggleWeapon;
|
||||||
|
|
Reference in a new issue