aboutsummaryrefslogtreecommitdiff
path: root/src/entities
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
parent3b22489413553e837a7da437b2c3cd69823095ab (diff)
Started laser and fixed world bug
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/generale.c11
-rw-r--r--src/entities/maresciallo.c4
-rw-r--r--src/entities/maresciallo.h2
3 files changed, 14 insertions, 3 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;
diff --git a/src/entities/maresciallo.c b/src/entities/maresciallo.c
index 826a7d4..98fc19f 100644
--- a/src/entities/maresciallo.c
+++ b/src/entities/maresciallo.c
@@ -115,7 +115,7 @@ void updateGunMaresciallo(Game * game, Entity * entity) {
Bullet bullet = createBulletFromDirection(*entity, direction, MARESCIALLO_BULLET_DAMAGE);
BulletHitInfo hit = shootBulletAtEntity(player, bullet);
- printf("This fucker hithit ajskdlfjkl %d\n", hit.hit);
+ //printf("This fucker hithit ajskdlfjkl %d\n", hit.hit);
data->timeSinceLastBulletShot = t;
}
@@ -146,12 +146,12 @@ void updateMaresciallo(Game * game, Entity * entity) {
// Fly away if to close to player.
if (dis < MARESCIALLO_CIRCLE_AT_DIS - 1 || dis >= MARESCIALLO_COME_BACK_AT_DIS) {
flyToPointMaresciallo(game, entity);
- updateMissilesMaresciallo(game, entity);
} else {
circlePlayerMaresciallo(game, entity);
}
updateGunMaresciallo(game, entity);
+ updateMissilesMaresciallo(game, entity);
entityCheckTransformedCollisionModel(entity);
}
diff --git a/src/entities/maresciallo.h b/src/entities/maresciallo.h
index d1d17af..6413fdb 100644
--- a/src/entities/maresciallo.h
+++ b/src/entities/maresciallo.h
@@ -13,7 +13,7 @@
#define MARESCIALLO_BULLET_DAMAGE 0.01
#define MARESCIALLO_CHANGE_OF_HIT 10
-#define MARESCIALLO_MISSILE_COOLDOWN 3.0
+#define MARESCIALLO_MISSILE_COOLDOWN 0.5
typedef struct Maresciallo {
EntityFlyToPointInfo flyToPoint;