aboutsummaryrefslogtreecommitdiff
path: root/src/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/antifaShip.c27
-rw-r--r--src/entities/antifaShip.h12
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