aboutsummaryrefslogtreecommitdiff
path: root/src/entities
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-11-17 18:47:34 -0700
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-11-17 18:47:34 -0700
commit6e10d35ca6dc47b2b3ad47dbce0f5c6245a8da72 (patch)
treedc1601132a1d908c9b51eed56f456b472fcdaddd /src/entities
parente7008ea5e51d657782d8facbf52e988bf3f9f7e1 (diff)
Starting on level 1
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/antifaShip.h2
-rw-r--r--src/entities/soldato.c23
-rw-r--r--src/entities/soldato.h2
3 files changed, 26 insertions, 1 deletions
diff --git a/src/entities/antifaShip.h b/src/entities/antifaShip.h
index a99e419..c88cde4 100644
--- a/src/entities/antifaShip.h
+++ b/src/entities/antifaShip.h
@@ -8,7 +8,7 @@
#define ANTIFA_SHIP_MAX_SPEED 200.0
#define ANTIFA_BULLET_COOLDOWN 0.5
#define ANTIFA_DRAW_BULLET_FOR 0.05
-#define ANTIFA_BULLET_DAMAGE 0.5
+#define ANTIFA_BULLET_DAMAGE 0.125
// Auto target shit.
#define ANTIFA_START_AUTO_TARGET_MAX 0.5 // How far off auto target can be entail it drops.
diff --git a/src/entities/soldato.c b/src/entities/soldato.c
index 28e9b67..917a615 100644
--- a/src/entities/soldato.c
+++ b/src/entities/soldato.c
@@ -1,5 +1,7 @@
#include "soldato.h"
#include "game.h"
+#include "entity.h"
+#include "world.h"
void initSoldato(Entity * entity, Game * game) {
entity->model = &game->assets.models[SOLDATO_ASSET];
@@ -7,6 +9,8 @@ void initSoldato(Entity * entity, Game * game) {
entity->transformedCollisionModel = entityCreateCollisionModel(*entity->model);
setEntityRadius(entity);
+ entity->health = 0.125;
+
// Acceleration.
entity->useAcceleration = false;
@@ -216,3 +220,22 @@ void setSoldatoLeader(Entity * entity1, Entity * entity2) {
leader->follow.followerId = follower->id;
leader->follow.followerFingerprint = follower->fingerprint;
}
+
+void addSoldatoGroupToWorld(Game * game, int groupSize, Vector3 position, Vector3 spacing) {
+ int i;
+ WorldEntry entries[groupSize];
+
+ for (i = 0; i < groupSize; ++i)
+ entries[i] = (WorldEntry){
+ ENTITY_SOLDATO,
+ Vector3Add(position, Vector3Multiply((Vector3){i, i, i}, spacing)),
+ QuaternionIdentity()
+ };
+
+ addEntriesToWorld(
+ &game->world,
+ game,
+ entries,
+ sizeof(entries) / sizeof(WorldEntry)
+ );
+}
diff --git a/src/entities/soldato.h b/src/entities/soldato.h
index 392be54..d05a42d 100644
--- a/src/entities/soldato.h
+++ b/src/entities/soldato.h
@@ -26,4 +26,6 @@ void drawSoldato(Game * game, Entity * entity);
void setSoldatoLeader(Entity * entity1, Entity * entity2);
+void addSoldatoGroupToWorld(Game * game, int groupSize, Vector3 position, Vector3 spacing);
+
#endif