aboutsummaryrefslogtreecommitdiff
path: root/src/entities/antifaShip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities/antifaShip.c')
-rw-r--r--src/entities/antifaShip.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/entities/antifaShip.c b/src/entities/antifaShip.c
index fb307fb..bd64545 100644
--- a/src/entities/antifaShip.c
+++ b/src/entities/antifaShip.c
@@ -29,6 +29,7 @@ void initAntifaShip(Entity * entity, Game * game) {
AntifaShip * data = (AntifaShip*)entity->data;
data->lastMouse = GetMousePosition();
data->forwardSpeed = 0.0;
+ data->shouldInitMousePosition = true;
}
void closeAntifaShip(Entity * entity) {
@@ -77,6 +78,12 @@ void controlAntifaShipJoystick(Game * game, Entity * entity) {
void controlAntifaShipKeyboardAndMouse(Game * game, Entity * entity) {
AntifaShip * data = (AntifaShip*)entity->data;
+ // Resets mouse on init.
+ if (data->shouldInitMousePosition) {
+ data->shouldInitMousePosition = false;
+ SetMousePosition(0, 0);
+ }
+
// Get mouse values.
Vector2 mouse = GetMousePosition();
float speed = GetMouseWheelMove();