diff options
author | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-07-07 00:57:19 -0600 |
---|---|---|
committer | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-07-07 00:57:19 -0600 |
commit | 028cf5d33d99274deea9567159a4eb07c13ef85c (patch) | |
tree | b2d9f0ae8fb640fdbe1a41114c7c8314f9223103 /src/entities | |
parent | 416a5cbab21c480ae9e85b07fd9424452cbcb611 (diff) |
This fucker is flying
Diffstat (limited to 'src/entities')
-rw-r--r-- | src/entities/antifaShip.c | 27 | ||||
-rw-r--r-- | src/entities/antifaShip.h | 12 |
2 files changed, 39 insertions, 0 deletions
diff --git a/src/entities/antifaShip.c b/src/entities/antifaShip.c new file mode 100644 index 0000000..2552d24 --- /dev/null +++ b/src/entities/antifaShip.c @@ -0,0 +1,27 @@ +#include "antifaShip.h" +#include <raylib.h> + +void initAntifaShip(Entity * entity) { + entity->model = LoadModel("/home/nathan/Documents/KillaFacsista/assets/antifaShip.obj"); +} + +void closeAntifaShip(Entity * entity) { + UnloadModel(entity->model); +} + +void updateAntifaShip(Game * game, Entity * entity, EntityId id) { +} + +void drawAntifaShip(Game * game, Entity * entity, EntityId id) { + entityDraw(entity); + + Vector3 stick = (Vector3){ + GetGamepadAxisMovement(0, 1), + -GetGamepadAxisMovement(0, 0), + GetGamepadAxisMovement(0, 2) + }; + + stick = Vector3Scale(stick, 0.5); + + entityJoystickControl(entity, stick, fabs(GetGamepadAxisMovement(0, 3) * 50.0 + 5.0)); +} diff --git a/src/entities/antifaShip.h b/src/entities/antifaShip.h new file mode 100644 index 0000000..15e9009 --- /dev/null +++ b/src/entities/antifaShip.h @@ -0,0 +1,12 @@ +#include "gameCommon.h" +#include "entity.h" + +#ifndef ANTIFA_SHIP_H +#define ANTIFA_SHIP_H + +void initAntifaShip(Entity * entity); +void closeAntifaShip(Entity * entity); +void updateAntifaShip(Game * game, Entity * entity, EntityId id); +void drawAntifaShip(Game * game, Entity * entity, EntityId id); + +#endif |