aboutsummaryrefslogtreecommitdiff
path: root/src/entities
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 02:24:09 -0600
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-07-07 02:24:09 -0600
commita90e1987de75cfecc2693952625af8cce507ae95 (patch)
tree5a0c3b195db071563e028b839b5dbd34157ec546 /src/entities
parent028cf5d33d99274deea9567159a4eb07c13ef85c (diff)
Added acceleration
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/antifaShip.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/entities/antifaShip.c b/src/entities/antifaShip.c
index 2552d24..1944053 100644
--- a/src/entities/antifaShip.c
+++ b/src/entities/antifaShip.c
@@ -3,6 +3,14 @@
void initAntifaShip(Entity * entity) {
entity->model = LoadModel("/home/nathan/Documents/KillaFacsista/assets/antifaShip.obj");
+
+ entity->useAcceleration = true;
+ entity->acceleration = (EntityAcceleration){
+ .speedUp = 30.0,
+ .speedDown = 15,
+ .rotationUp = (Vector3){0.6, 0.6, 0.6},
+ .rotationDown = (Vector3){0.6, 0.6, 0.6}
+ };
}
void closeAntifaShip(Entity * entity) {
@@ -18,10 +26,10 @@ void drawAntifaShip(Game * game, Entity * entity, EntityId id) {
Vector3 stick = (Vector3){
GetGamepadAxisMovement(0, 1),
-GetGamepadAxisMovement(0, 0),
- GetGamepadAxisMovement(0, 2)
+ GetGamepadAxisMovement(0, 2) * 0.25
};
stick = Vector3Scale(stick, 0.5);
- entityJoystickControl(entity, stick, fabs(GetGamepadAxisMovement(0, 3) * 50.0 + 5.0));
+ entityJoystickControl(entity, stick, fabs(GetGamepadAxisMovement(0, 3) * 300.0));
}