aboutsummaryrefslogtreecommitdiff
path: root/src/entities/generale.c
diff options
context:
space:
mode:
authornathansmithsmith <nathansmith7@mailfence.com>2023-09-14 00:11:04 -0600
committernathansmithsmith <nathansmith7@mailfence.com>2023-09-14 00:11:04 -0600
commitb14a7bb1e4e2e71a8fef86fcfec4ad9501768e57 (patch)
treeb4dfb0b946c649583f4eebc8016e1d85c5984625 /src/entities/generale.c
parent3b22489413553e837a7da437b2c3cd69823095ab (diff)
Started laser and fixed world bug
Diffstat (limited to 'src/entities/generale.c')
-rw-r--r--src/entities/generale.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/entities/generale.c b/src/entities/generale.c
index 4868824..bc7c0f0 100644
--- a/src/entities/generale.c
+++ b/src/entities/generale.c
@@ -43,6 +43,15 @@ void closeGenerale(Entity * entity) {
entityFreeCollisionModel(entity->transformedCollisionModel);
}
+void updateGeneraleLaser(Game * game, Entity * entity) {
+ Entity * player = getEntityFromWorld(game->world, 0);
+ Generale * data = (Generale*)entity->data;
+
+ Vector3 direction = Vector3Subtract(player->position, entity->position);
+
+ DrawLine3D(entity->position, Vector3Add(entity->position, direction), RED);
+}
+
void updateGenerale(Game * game, Entity * entity) {
entityUpdateLastValues(entity);
@@ -70,6 +79,8 @@ void updateGenerale(Game * game, Entity * entity) {
void drawGenerale(Game * game, Entity * entity) {
entityDraw(entity);
+ updateGeneraleLaser(game, entity);
+
/*
Generale * data = (Generale*)entity->data;