aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornathansmithsmith <thenathansmithsmith@gmail.com>2023-12-04 10:54:15 -0700
committernathansmithsmith <thenathansmithsmith@gmail.com>2023-12-04 10:54:15 -0700
commita14e6109a5096b23f9a27bcd2010c23e9ca1753f (patch)
treee54690d0b2628d0e50f582c00659350c11e5023a
parent8bd37d4fe75a43deab8d6f24b481c23d7f965c5a (diff)
Started level 4
-rw-r--r--src/levels.c1
-rw-r--r--src/levels.h2
-rw-r--r--src/levels/level3.c10
-rw-r--r--src/levels/level4.c16
-rw-r--r--src/levels/level4.h11
-rw-r--r--src/levelsInclude.h1
6 files changed, 33 insertions, 8 deletions
diff --git a/src/levels.c b/src/levels.c
index 71a4306..c41456f 100644
--- a/src/levels.c
+++ b/src/levels.c
@@ -8,6 +8,7 @@ const LevelInfo levelInfoList[LEVELS_COUNT] = {
(LevelInfo){initLevel1, closelevel1, updateLevel1},
(LevelInfo){initLevel2, closelevel2, updateLevel2},
(LevelInfo){initLevel3, closelevel3, updateLevel3},
+ (LevelInfo){initLevel4, closelevel4, updateLevel4},
(LevelInfo){initTestLevel, closeTestLevel, updateTestLevel}
};
diff --git a/src/levels.h b/src/levels.h
index 3f3419c..2c24536 100644
--- a/src/levels.h
+++ b/src/levels.h
@@ -5,7 +5,7 @@
#ifndef LEVELS_H
#define LEVELS_H
-#define LEVELS_COUNT 4
+#define LEVELS_COUNT 5
#define NO_LEVEL -1
diff --git a/src/levels/level3.c b/src/levels/level3.c
index 4d688fc..bd1f559 100644
--- a/src/levels/level3.c
+++ b/src/levels/level3.c
@@ -37,19 +37,15 @@ bool updateLevel3(Game * game, Levels * levels) {
Level3 * data = (Level3*)levels->data;
bool levelDone = false;
- Vector3 groups[] = {
- (Vector3){0.0, 0.0, 800.0},
- (Vector3){0.0, 0.0, -800.0}
- };
-
switch (data->stage) {
case 0:
if (game->world.entitiesCount == 1) {
Vector3 playerPosition = getEntityFromWorld(game->world, 0)->position;
Vector3 spacing = (Vector3){0.0, 15.0, 15.0};
- for (i = 0; i < sizeof(groups) / sizeof(Vector3); ++i)
- addSoldatoGroupWithLeader(game, ENTITY_CAPORALE, 3, Vector3Add(groups[i], playerPosition), spacing);
+ addSoldatoGroupWithLeader(game, ENTITY_CAPORALE, 3, Vector3Add((Vector3){0.0, 0.0, 800.0}, playerPosition), spacing);
+ spacing = Vector3Negate(spacing);
+ addSoldatoGroupWithLeader(game, ENTITY_CAPORALE, 3, Vector3Add((Vector3){0.0, 0.0, -800.0}, playerPosition), spacing);
data->stage = 1;
}
diff --git a/src/levels/level4.c b/src/levels/level4.c
new file mode 100644
index 0000000..ae9edaa
--- /dev/null
+++ b/src/levels/level4.c
@@ -0,0 +1,16 @@
+#include "game.h"
+#include "world.h"
+#include "entityGrouping.h"
+
+void initLevel4(Game * game, Levels * levels) {
+
+}
+
+void closelevel4(Levels * levels) {
+
+}
+
+bool updateLevel4(Game * game, Levels * levels) {
+
+ return false;
+}
diff --git a/src/levels/level4.h b/src/levels/level4.h
new file mode 100644
index 0000000..ef46789
--- /dev/null
+++ b/src/levels/level4.h
@@ -0,0 +1,11 @@
+#include "gameCommon.h"
+#include "levels.h"
+
+#ifndef LEVEL4_H
+#define LEVEL4_H
+
+void initLevel4(Game * game, Levels * levels);
+void closelevel4(Levels * levels);
+bool updateLevel4(Game * game, Levels * levels);
+
+#endif
diff --git a/src/levelsInclude.h b/src/levelsInclude.h
index b6a6156..15a2988 100644
--- a/src/levelsInclude.h
+++ b/src/levelsInclude.h
@@ -2,5 +2,6 @@
#include "levels/level1.h"
#include "levels/level2.h"
#include "levels/level3.h"
+#include "levels/level4.h"
// As you can tell I fucking hate your stupid fat ass