moar worldbuilding with textfile
This commit is contained in:
parent
b36c9a6d62
commit
a729b0459b
4 changed files with 5 additions and 10 deletions
4
Engine.c
4
Engine.c
|
@ -528,6 +528,7 @@ void mainmenu()
|
||||||
switch (menucounter)
|
switch (menucounter)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
playing = 1;
|
||||||
thisChunk = LEVEL1;
|
thisChunk = LEVEL1;
|
||||||
nextChunk = LEVEL1;
|
nextChunk = LEVEL1;
|
||||||
|
|
||||||
|
@ -539,7 +540,6 @@ void mainmenu()
|
||||||
hero->point.x = 160;
|
hero->point.x = 160;
|
||||||
hero->point.y = 90;
|
hero->point.y = 90;
|
||||||
|
|
||||||
playing = 1;
|
|
||||||
fclose(saveData);
|
fclose(saveData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -548,6 +548,7 @@ void mainmenu()
|
||||||
{
|
{
|
||||||
fscanf(saveData, "%d %d %d %d %lld", &level, &roomNo, &xPos, &yPos, &eventState);
|
fscanf(saveData, "%d %d %d %d %lld", &level, &roomNo, &xPos, &yPos, &eventState);
|
||||||
}
|
}
|
||||||
|
playing = 1;
|
||||||
thisChunk = (enum dataChunks)(level);
|
thisChunk = (enum dataChunks)(level);
|
||||||
nextChunk = (enum dataChunks)(level);
|
nextChunk = (enum dataChunks)(level);
|
||||||
|
|
||||||
|
@ -559,7 +560,6 @@ void mainmenu()
|
||||||
hero->point.y = yPos;
|
hero->point.y = yPos;
|
||||||
warpto(mapData[roomNo]);
|
warpto(mapData[roomNo]);
|
||||||
|
|
||||||
playing = 1;
|
|
||||||
fclose(saveData);
|
fclose(saveData);
|
||||||
printf("Loaded save: level %d, room %d (%d,%d) state: %lld\n", level, roomNo, xPos, yPos, eventState);
|
printf("Loaded save: level %d, room %d (%d,%d) state: %lld\n", level, roomNo, xPos, yPos, eventState);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -16,5 +16,5 @@ void cleanHyperKaos(HyperKaos* self);
|
||||||
|
|
||||||
void run(HyperKaos* self);
|
void run(HyperKaos* self);
|
||||||
void addKaos(HyperKaos* self, Kaos* target);
|
void addKaos(HyperKaos* self, Kaos* target);
|
||||||
int isCompleted(int x);
|
int hasCompleted(int x);
|
||||||
int notCompleted(int x);
|
int notCompleted(int x);
|
||||||
|
|
2
Player.c
2
Player.c
|
@ -243,6 +243,8 @@ int playerFaces(Player* self, char dir)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// collision helper functions
|
||||||
|
|
||||||
int playerIsInRect(Player* self, SDL_Rect* rect)
|
int playerIsInRect(Player* self, SDL_Rect* rect)
|
||||||
{
|
{
|
||||||
SDL_Rect* pBox = &(self->boundBox);
|
SDL_Rect* pBox = &(self->boundBox);
|
||||||
|
|
7
main.c
7
main.c
|
@ -14,12 +14,6 @@
|
||||||
#include "WorldData.h"
|
#include "WorldData.h"
|
||||||
#include "Scene.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 fullscreen = 0;
|
||||||
int playing = 0;
|
int playing = 0;
|
||||||
int quit = 0;
|
int quit = 0;
|
||||||
|
@ -79,7 +73,6 @@ int main (int argc, char* args[])
|
||||||
|
|
||||||
intro();
|
intro();
|
||||||
|
|
||||||
// main game loop
|
|
||||||
while (!quit)
|
while (!quit)
|
||||||
{
|
{
|
||||||
mainmenu();
|
mainmenu();
|
||||||
|
|
Loading…
Reference in a new issue