diff options
author | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-12-04 12:15:19 -0700 |
---|---|---|
committer | nathansmithsmith <thenathansmithsmith@gmail.com> | 2023-12-04 12:15:19 -0700 |
commit | f70e2018a4d3f979e1108981284a09a44bd11542 (patch) | |
tree | 796d7f3b75070f91bd61ddf75e4aa41122fd2545 | |
parent | a3957cac6cbc33f5ec88b9c15aeaf267f2bcd6b8 (diff) |
Made level 5 a bit better
-rw-r--r-- | src/entities/antifaShip.c | 8 | ||||
-rw-r--r-- | src/entities/antifaShip.h | 3 | ||||
-rw-r--r-- | src/levels/level5.c | 10 |
3 files changed, 18 insertions, 3 deletions
diff --git a/src/entities/antifaShip.c b/src/entities/antifaShip.c index 1ba8db9..342f0f9 100644 --- a/src/entities/antifaShip.c +++ b/src/entities/antifaShip.c @@ -203,9 +203,15 @@ void controlAntifaShipKeyboardAndMouse(Game * game, Entity * entity) { data->lastMouse = Vector2Zero(); } - // Kill me hehehe +#ifdef DEBUG_KEYS + // Kill me. if (IsKeyPressed(KEY_K)) entity->health = 0.0; + // Kill everyone else. + if (IsKeyPressed(KEY_L)) + for (int i = 1; i < game->world.entitiesCount; ++i) + game->world.entities[i].health = 0.0; +#endif // Shoot bullet. if (IsMouseButtonPressed(MOUSE_RIGHT_BUTTON)) diff --git a/src/entities/antifaShip.h b/src/entities/antifaShip.h index c88cde4..c0e43ee 100644 --- a/src/entities/antifaShip.h +++ b/src/entities/antifaShip.h @@ -14,6 +14,9 @@ #define ANTIFA_START_AUTO_TARGET_MAX 0.5 // How far off auto target can be entail it drops. #define ANTIFA_TARGETING_SPEED 6.0 +// Some keys for debugging. +#define DEBUG_KEYS + typedef struct AntifaShip { Vector2 lastMouse; float forwardSpeed; diff --git a/src/levels/level5.c b/src/levels/level5.c index d08cec6..bc29b29 100644 --- a/src/levels/level5.c +++ b/src/levels/level5.c @@ -35,7 +35,8 @@ void closelevel5(Levels * levels) { bool updateLevel5(Game * game, Levels * levels) { Level5 * data = (Level5*)levels->data; bool levelDone = false; - Vector3 playerPosition = getEntityFromWorld(game->world, 0)->position; + Entity * player = getEntityFromWorld(game->world, 0); + Vector3 playerPosition = player->position; switch (data->stage) { case 0: @@ -60,11 +61,16 @@ bool updateLevel5(Game * game, Levels * levels) { break; case 1: if (game->world.entitiesCount == 1) { + float distanceFromPlayer = 1500.0; + addEntityGroupToWorld( game, ENTITY_SOLDATO, 10, - Vector3Add((Vector3){1000.0, 0.0, 1000.0}, playerPosition), + Vector3Add( + Vector3Scale(Vector3RotateByQuaternion((Vector3){0.5, 0.0, 1.0}, player->rotation), distanceFromPlayer), + playerPosition + ), (Vector3){0.0, 10.0, 10.0} ); |