all repos — hyperkaos @ a729b0459bfdf971a296989677f1fb6ad10a6657

lightweight modular puzzle/adventure game engine in C with SDL 1.2

moar worldbuilding with textfile
Iris Lightshard nilix@nilfm.cc
commit

a729b0459bfdf971a296989677f1fb6ad10a6657

parent

b36c9a6d62996fe3726f359cfc429f81e5af076c

4 files changed, 5 insertions(+), 10 deletions(-)

jump to
M Engine.cEngine.c

@@ -528,6 +528,7 @@ if (quit) return;

switch (menucounter) { case 0: + playing = 1; thisChunk = LEVEL1; nextChunk = LEVEL1;

@@ -539,7 +540,6 @@ warpto(mapData[0]);

hero->point.x = 160; hero->point.y = 90; - playing = 1; fclose(saveData); break;

@@ -548,6 +548,7 @@ if (saveData)

{ fscanf(saveData, "%d %d %d %d %lld", &level, &roomNo, &xPos, &yPos, &eventState); } + playing = 1; thisChunk = (enum dataChunks)(level); nextChunk = (enum dataChunks)(level);

@@ -559,7 +560,6 @@ hero->point.x = xPos;

hero->point.y = yPos; warpto(mapData[roomNo]); - playing = 1; fclose(saveData); printf("Loaded save: level %d, room %d (%d,%d) state: %lld\n", level, roomNo, xPos, yPos, eventState); break;
M HyperKaos.hHyperKaos.h

@@ -16,5 +16,5 @@ void cleanHyperKaos(HyperKaos* self);

void run(HyperKaos* self); void addKaos(HyperKaos* self, Kaos* target); -int isCompleted(int x); +int hasCompleted(int x); int notCompleted(int x);
M Player.cPlayer.c

@@ -243,6 +243,8 @@ }

return 0; } +// collision helper functions + int playerIsInRect(Player* self, SDL_Rect* rect) { SDL_Rect* pBox = &(self->boundBox);
M main.cmain.c

@@ -14,12 +14,6 @@ #include "HyperKaos.h"

#include "WorldData.h" #include "Scene.h" -/*const int SCREEN_WIDTH = 320; -const int SCREEN_HEIGHT = 180; -const int SCREEN_BPP = 32; - -const int FRAMES_PER_SECOND = 30;*/ - int fullscreen = 0; int playing = 0; int quit = 0;

@@ -79,7 +73,6 @@ }

intro(); - // main game loop while (!quit) { mainmenu();