Merge branch 'main' of yibble.dev:bulmanator/ld58

This commit is contained in:
2025-10-07 14:14:51 +01:00
13 changed files with 168 additions and 55 deletions

View File

@@ -24,6 +24,7 @@
#include "game/impl/world.c"
#include "game/impl/npc.c"
#include "game/impl/bandit.c"
#include "game/impl/outfit.c"
int main(int argc, char **argv)
{
@@ -90,7 +91,7 @@ int main(int argc, char **argv)
world->arena = arena;
world->random = Random_Seed(29237489723847);
world->npcCount = 127;
world->npcCount = 12;
for(U32 i = 0; i < world->npcCount; i++) {
NPC *npc1 = &world->npcs[i];
npc1->collision.pos.x = 0;
@@ -103,6 +104,7 @@ int main(int argc, char **argv)
npc1->waitTime = 0;
npc1->maxWaitTime = 1;
npc1->currentNavNode = 0;
GenOutfit(&npc1->outfit,world,game);
}
Bandit *badman = &world->bandit;
@@ -116,7 +118,7 @@ int main(int argc, char **argv)
badman->maxWaitTime = 2;
badman->poiCount = 2;
badman->shootoutTimer = 1.5;
badman->agroRadius = 600.0;
badman->agroRadius = 6.0;
badman->bullets = 6;
badman->shootDelay = 1;
badman->accuracyRange = 0.25;
@@ -124,6 +126,8 @@ int main(int argc, char **argv)
badman->reloadTimer = 0;
badman->pointsOfInterest[0] = 937;
badman->pointsOfInterest[1] = 12;
badman->outfitChoices = GenOutfit(&badman->outfit, world, game);
badman->currentArea = WORLD_AREA_OUTSIDE;
world->npcPOI[0] = 100;
@@ -236,6 +240,7 @@ int main(int argc, char **argv)
Player *player = &game->world->player;
switch (e.key.key) {
case SDLK_R: { PlayerInit(game, player); } break;
case SDLK_F: {game->world->showPoster=!game->world->showPoster;}break;
}
}
@@ -408,8 +413,19 @@ int main(int argc, char **argv)
D_Begin(&game->draw, frame, D_MAX_RECTS);
RenderWorld(game->world, &game->draw);
R3f bounds = G_CameraBounds(&game->camera);
if (game->world->showPoster) {
D_Rect(&game->draw, bounds.min.x + 4.8f, bounds.min.y + 6.4f, .texture = D_ImageHandle(&game->draw, S("poster")), .scale = 12.0f);
}
for (U32 i = 0; i < game->world->player.health; i++) {
D_Rect(&game->draw, (bounds.max.x - 3) + i, bounds.min.y + 1, .texture = D_ImageHandle(&game->draw, S("heart")));
}
//D_Text(&game->draw, game->draw.fonts, S("Small Test"), 0, 0);
if(game->editor.enabled) {