intro function in Engine.c as opposed to its own include file
This commit is contained in:
parent
bff466bba7
commit
4c5fc21951
4 changed files with 31 additions and 33 deletions
28
Engine.c
28
Engine.c
|
@ -281,6 +281,34 @@ void cleanup()
|
||||||
printf("Cleanup complete\n");
|
printf("Cleanup complete\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void intro()
|
||||||
|
{
|
||||||
|
SDL_Color black = {0,0,0};
|
||||||
|
|
||||||
|
SLayer* nebula = newSLayer(loadImage("assets/img/backgrounds/presents.png"), 0,0,0,0,255);
|
||||||
|
SLayer* fogF = newSLayer(loadImage("assets/img/fx/fog.png"), 0,0,-1,0,128);
|
||||||
|
SLayer* fogB = newSLayer(loadImage("assets/img/fx/plasma.png"), -320,0,1,0,56);
|
||||||
|
SLayer* presents = newSLayer(TTF_RenderText_Solid(font, "nilFM presents", textColor), 120,84,0,0,128);
|
||||||
|
|
||||||
|
SLayer* menuTransition = newSLayer(loadImage("assets/img/backgrounds/mainmenu.png"),0,0,0,0,255);
|
||||||
|
|
||||||
|
Scene* intro = newScene(30,30, 200, black, black);
|
||||||
|
Scene* transition = newScene(30,0,30, black, black);
|
||||||
|
|
||||||
|
buildScene(intro, nebula);
|
||||||
|
buildScene(intro, fogB);
|
||||||
|
buildScene(intro, fogF);
|
||||||
|
buildScene(intro, presents);
|
||||||
|
|
||||||
|
buildScene(transition, menuTransition);
|
||||||
|
|
||||||
|
playScene(intro);
|
||||||
|
playScene(transition);
|
||||||
|
|
||||||
|
deleteScene(intro);
|
||||||
|
deleteScene(transition);
|
||||||
|
}
|
||||||
|
|
||||||
void mainmenu()
|
void mainmenu()
|
||||||
{
|
{
|
||||||
int menucounter = 0;
|
int menucounter = 0;
|
||||||
|
|
4
Engine.h
4
Engine.h
|
@ -30,8 +30,8 @@ void timeDilation();
|
||||||
|
|
||||||
void cleanup();
|
void cleanup();
|
||||||
|
|
||||||
|
void intro();
|
||||||
|
|
||||||
void mainmenu();
|
void mainmenu();
|
||||||
|
|
||||||
void filemenu();
|
|
||||||
|
|
||||||
void pausemenu();
|
void pausemenu();
|
||||||
|
|
25
intro.c
25
intro.c
|
@ -1,25 +0,0 @@
|
||||||
|
|
||||||
SDL_Color black = {0,0,0};
|
|
||||||
|
|
||||||
SLayer* nebula = newSLayer(loadImage("assets/img/backgrounds/presents.png"), 0,0,0,0,255);
|
|
||||||
SLayer* fogF = newSLayer(loadImage("assets/img/fx/fog.png"), 0,0,-1,0,128);
|
|
||||||
SLayer* fogB = newSLayer(loadImage("assets/img/fx/plasma.png"), -320,0,1,0,56);
|
|
||||||
SLayer* presents = newSLayer(TTF_RenderText_Solid(font, "nilFM presents", textColor), 120,84,0,0,128);
|
|
||||||
|
|
||||||
SLayer* menuTransition = newSLayer(loadImage("assets/img/backgrounds/mainmenu.png"),0,0,0,0,255);
|
|
||||||
|
|
||||||
Scene* intro = newScene(30,30, 200, black, black);
|
|
||||||
Scene* transition = newScene(30,0,30, black, black);
|
|
||||||
|
|
||||||
buildScene(intro, nebula);
|
|
||||||
buildScene(intro, fogB);
|
|
||||||
buildScene(intro, fogF);
|
|
||||||
buildScene(intro, presents);
|
|
||||||
|
|
||||||
buildScene(transition, menuTransition);
|
|
||||||
|
|
||||||
playScene(intro);
|
|
||||||
playScene(transition);
|
|
||||||
|
|
||||||
deleteScene(intro);
|
|
||||||
deleteScene(transition);
|
|
7
main.c
7
main.c
|
@ -70,12 +70,7 @@ int main (int argc, char* args[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
intro();
|
||||||
* intro discarded immediately after playing, so instead of increasing the
|
|
||||||
* complexity and offloading it somewhere, we just keep it in this include
|
|
||||||
* file for cleanliness and modularity
|
|
||||||
*/
|
|
||||||
#include "intro.c"
|
|
||||||
|
|
||||||
// main game loop
|
// main game loop
|
||||||
while (!quit)
|
while (!quit)
|
||||||
|
|
Loading…
Reference in a new issue