mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2024-12-13 04:27:59 +01:00
split each level to separate file
This commit is contained in:
parent
8c24ebd982
commit
1f3f99936e
12 changed files with 593 additions and 42 deletions
|
@ -1,17 +1,22 @@
|
|||
SET(SRC_LIST
|
||||
main.c
|
||||
allegro_utils.c
|
||||
main.c
|
||||
allegro_utils.c
|
||||
config.c
|
||||
timeline.c
|
||||
gamestates/about.c
|
||||
gamestates/disclaimer.c
|
||||
gamestates/intro.c
|
||||
gamestates/level.c
|
||||
gamestates/loading.c
|
||||
gamestates/map.c
|
||||
gamestates/menu.c
|
||||
gamestates/pause.c
|
||||
levels/level1.c
|
||||
timeline.c
|
||||
gamestates/about.c
|
||||
gamestates/disclaimer.c
|
||||
gamestates/intro.c
|
||||
gamestates/level.c
|
||||
gamestates/loading.c
|
||||
gamestates/map.c
|
||||
gamestates/menu.c
|
||||
gamestates/pause.c
|
||||
levels/level1.c
|
||||
levels/level2.c
|
||||
levels/level3.c
|
||||
levels/level4.c
|
||||
levels/level5.c
|
||||
levels/level6.c
|
||||
levels/moonwalk.c
|
||||
levels/dodger.c
|
||||
levels/actions.c
|
||||
|
|
|
@ -20,13 +20,32 @@
|
|||
*/
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "../levels/moonwalk.h"
|
||||
#include "../levels/level1.h"
|
||||
#include "../levels/level2.h"
|
||||
#include "../levels/level3.h"
|
||||
#include "../levels/level4.h"
|
||||
#include "../levels/level5.h"
|
||||
#include "../levels/level6.h"
|
||||
#include "../config.h"
|
||||
#include "pause.h"
|
||||
#include "level.h"
|
||||
#include "../timeline.h"
|
||||
|
||||
#define LEVELS(name, ...) switch (game->level.current_level) { \
|
||||
case 1: \
|
||||
Level1_ ## name (__VA_ARGS__); break;\
|
||||
case 2: \
|
||||
Level2_ ## name (__VA_ARGS__); break;\
|
||||
case 3: \
|
||||
Level3_ ## name (__VA_ARGS__); break;\
|
||||
case 4: \
|
||||
Level4_ ## name (__VA_ARGS__); break;\
|
||||
case 5: \
|
||||
Level5_ ## name (__VA_ARGS__); break;\
|
||||
case 6: \
|
||||
Level6_ ## name (__VA_ARGS__); break;\
|
||||
}
|
||||
|
||||
void SelectDerpySpritesheet(struct Game *game, char* name) {
|
||||
struct Spritesheet *tmp = game->level.derpy_sheets;
|
||||
PrintConsole(game, "Selecting Derpy spritesheet: %s", name);
|
||||
|
@ -106,11 +125,7 @@ void Level_Passed(struct Game *game) {
|
|||
}
|
||||
|
||||
void Level_Logic(struct Game *game) {
|
||||
if (game->level.current_level==1) {
|
||||
Level1_Logic(game);
|
||||
} else {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
LEVELS(Logic, game);
|
||||
|
||||
if ((game->level.sheet_speed) && (game->level.sheet_speed_modifier)) {
|
||||
game->level.sheet_tmp+=1;
|
||||
|
@ -144,16 +159,14 @@ void Level_Logic(struct Game *game) {
|
|||
void Level_Resume(struct Game *game) {
|
||||
al_set_sample_instance_position(game->level.music, game->level.music_pos);
|
||||
al_set_sample_instance_playing(game->level.music, true);
|
||||
if (game->level.current_level==1) Level1_Resume(game);
|
||||
else Moonwalk_Resume(game);
|
||||
LEVELS(Resume, game);
|
||||
TM_Resume();
|
||||
}
|
||||
|
||||
void Level_Pause(struct Game *game) {
|
||||
game->level.music_pos = al_get_sample_instance_position(game->level.music);
|
||||
al_set_sample_instance_playing(game->level.music, false);
|
||||
if (game->level.current_level==1) Level1_Pause(game);
|
||||
else Moonwalk_Pause(game);
|
||||
LEVELS(Pause, game);
|
||||
TM_Pause();
|
||||
}
|
||||
|
||||
|
@ -165,8 +178,7 @@ void Level_Draw(struct Game *game) {
|
|||
al_draw_bitmap(game->level.stage, (-game->level.st_pos)*al_get_bitmap_width(game->level.stage), 0 ,0);
|
||||
al_draw_bitmap(game->level.stage, (1+(-game->level.st_pos))*al_get_bitmap_width(game->level.stage), 0 ,0);
|
||||
|
||||
if (game->level.current_level==1) Level1_Draw(game);
|
||||
else Moonwalk_Draw(game);
|
||||
LEVELS(Draw, game);
|
||||
|
||||
if (!game->level.foreground) return;
|
||||
|
||||
|
@ -206,10 +218,7 @@ void Level_Load(struct Game *game) {
|
|||
game->level.debug_show_sprite_frames=false;
|
||||
al_clear_to_color(al_map_rgb(0,0,0));
|
||||
TM_Init(game);
|
||||
if (game->level.current_level!=1) Moonwalk_Load(game);
|
||||
else {
|
||||
Level1_Load(game);
|
||||
}
|
||||
LEVELS(Load, game);
|
||||
}
|
||||
|
||||
int Level_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
|
@ -222,8 +231,7 @@ int Level_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
|||
} else if ((game->debug) && (ev->keyboard.keycode==ALLEGRO_KEY_F4)) {
|
||||
game->level.debug_show_sprite_frames = !game->level.debug_show_sprite_frames;
|
||||
}
|
||||
if (game->level.current_level==1) Level1_Keydown(game, ev);
|
||||
else Moonwalk_Keydown(game, ev);
|
||||
LEVELS(Keydown, game, ev);
|
||||
if (ev->keyboard.keycode==ALLEGRO_KEY_ESCAPE) {
|
||||
game->gamestate = GAMESTATE_PAUSE;
|
||||
game->loadstate = GAMESTATE_LEVEL;
|
||||
|
@ -234,8 +242,7 @@ int Level_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
|||
}
|
||||
|
||||
void Level_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
if (game->level.current_level==1) Level1_ProcessEvent(game, ev);
|
||||
else Moonwalk_ProcessEvent(game, ev);
|
||||
LEVELS(ProcessEvent, game, ev);
|
||||
TM_HandleEvent(ev);
|
||||
}
|
||||
|
||||
|
@ -252,8 +259,7 @@ void Level_Preload(struct Game *game, void (*progress)(struct Game*, float)) {
|
|||
//TODO: load proper music file for each level
|
||||
game->level.sample = al_load_sample( GetDataFilePath("levels/1/music.flac") );
|
||||
|
||||
if (game->level.current_level==1) Level1_Preload(game);
|
||||
else Moonwalk_Preload(game);
|
||||
LEVELS(Preload, game);
|
||||
|
||||
Level_PreloadBitmaps(game, progress);
|
||||
|
||||
|
@ -276,8 +282,7 @@ void Level_Unload(struct Game *game) {
|
|||
al_destroy_sample_instance(game->level.music);
|
||||
al_destroy_sample(game->level.sample);
|
||||
Level_UnloadBitmaps(game);
|
||||
if (game->level.current_level!=1) Moonwalk_Unload(game);
|
||||
else Level1_Unload(game);
|
||||
LEVELS(Unload, game);
|
||||
TM_Destroy();
|
||||
}
|
||||
|
||||
|
@ -289,8 +294,7 @@ void Level_UnloadBitmaps(struct Game *game) {
|
|||
al_destroy_bitmap(tmp->bitmap);
|
||||
tmp = tmp->next;
|
||||
}
|
||||
if (game->level.current_level!=1) Moonwalk_UnloadBitmaps(game);
|
||||
else Level1_UnloadBitmaps(game);
|
||||
LEVELS(UnloadBitmaps, game);
|
||||
al_destroy_bitmap(game->level.foreground);
|
||||
al_destroy_bitmap(game->level.background);
|
||||
al_destroy_bitmap(game->level.clouds);
|
||||
|
@ -302,8 +306,21 @@ void Level_UnloadBitmaps(struct Game *game) {
|
|||
}
|
||||
|
||||
int Level_PreloadSteps(struct Game *game) {
|
||||
if (game->level.current_level==1) return Level1_PreloadSteps();
|
||||
else return Moonwalk_PreloadSteps();
|
||||
switch (game->level.current_level) {
|
||||
case 1:
|
||||
return Level1_PreloadSteps(); break;
|
||||
case 2:
|
||||
return Level2_PreloadSteps(); break;
|
||||
case 3:
|
||||
return Level3_PreloadSteps(); break;
|
||||
case 4:
|
||||
return Level4_PreloadSteps(); break;
|
||||
case 5:
|
||||
return Level5_PreloadSteps(); break;
|
||||
case 6:
|
||||
return Level6_PreloadSteps(); break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
|
@ -349,6 +366,5 @@ void Level_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, floa
|
|||
void ChildProgress(struct Game* game, float p) {
|
||||
if (progress) (*progress)(game, load_p+=1/load_a);
|
||||
}
|
||||
if (game->level.current_level!=1) Moonwalk_PreloadBitmaps(game, &ChildProgress);
|
||||
else Level1_PreloadBitmaps(game, &ChildProgress);
|
||||
LEVELS(PreloadBitmaps, game, &ChildProgress);
|
||||
}
|
||||
|
|
72
src/levels/level2.c
Normal file
72
src/levels/level2.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*! \file level2.c
|
||||
* \brief Level 2 code.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
void Level2_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
}
|
||||
|
||||
void Level2_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
}
|
||||
|
||||
void Level2_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
}
|
||||
|
||||
void Level2_Preload(struct Game *game) {
|
||||
Moonwalk_Preload(game);
|
||||
}
|
||||
|
||||
inline int Level2_PreloadSteps() {
|
||||
return 0+Moonwalk_PreloadSteps();
|
||||
}
|
||||
|
||||
void Level2_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level2_PreloadSteps());
|
||||
Moonwalk_PreloadBitmaps(game, progress);
|
||||
}
|
||||
|
||||
void Level2_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Level2_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Level2_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_Keydown(game, ev);
|
||||
}
|
||||
|
||||
void Level2_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
}
|
||||
|
||||
void Level2_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
}
|
||||
|
||||
void Level2_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
}
|
34
src/levels/level2.h
Normal file
34
src/levels/level2.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*! \file Level2.h
|
||||
* \brief Level 2 headers.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
void Level2_Load(struct Game *game);
|
||||
void Level2_Unload(struct Game *game);
|
||||
void Level2_UnloadBitmaps(struct Game *game);
|
||||
void Level2_Preload(struct Game *game);
|
||||
void Level2_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
inline int Level2_PreloadSteps();
|
||||
void Level2_Draw(struct Game *game);
|
||||
void Level2_Logic(struct Game *game);
|
||||
void Level2_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level2_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level2_Resume(struct Game *game);
|
||||
void Level2_Pause(struct Game *game);
|
72
src/levels/level3.c
Normal file
72
src/levels/level3.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*! \file Level3.c
|
||||
* \brief Level 3 code.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
void Level3_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
}
|
||||
|
||||
void Level3_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
}
|
||||
|
||||
void Level3_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
}
|
||||
|
||||
void Level3_Preload(struct Game *game) {
|
||||
Moonwalk_Preload(game);
|
||||
}
|
||||
|
||||
inline int Level3_PreloadSteps() {
|
||||
return 0+Moonwalk_PreloadSteps();
|
||||
}
|
||||
|
||||
void Level3_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level3_PreloadSteps());
|
||||
Moonwalk_PreloadBitmaps(game, progress);
|
||||
}
|
||||
|
||||
void Level3_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Level3_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Level3_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_Keydown(game, ev);
|
||||
}
|
||||
|
||||
void Level3_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
}
|
||||
|
||||
void Level3_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
}
|
||||
|
||||
void Level3_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
}
|
34
src/levels/level3.h
Normal file
34
src/levels/level3.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*! \file Level3.h
|
||||
* \brief Level 3 headers.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
void Level3_Load(struct Game *game);
|
||||
void Level3_Unload(struct Game *game);
|
||||
void Level3_UnloadBitmaps(struct Game *game);
|
||||
void Level3_Preload(struct Game *game);
|
||||
void Level3_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
inline int Level3_PreloadSteps();
|
||||
void Level3_Draw(struct Game *game);
|
||||
void Level3_Logic(struct Game *game);
|
||||
void Level3_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level3_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level3_Resume(struct Game *game);
|
||||
void Level3_Pause(struct Game *game);
|
72
src/levels/level4.c
Normal file
72
src/levels/level4.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*! \file Level4.c
|
||||
* \brief Level 4 code.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
void Level4_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
}
|
||||
|
||||
void Level4_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
}
|
||||
|
||||
void Level4_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
}
|
||||
|
||||
void Level4_Preload(struct Game *game) {
|
||||
Moonwalk_Preload(game);
|
||||
}
|
||||
|
||||
inline int Level4_PreloadSteps() {
|
||||
return 0+Moonwalk_PreloadSteps();
|
||||
}
|
||||
|
||||
void Level4_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level4_PreloadSteps());
|
||||
Moonwalk_PreloadBitmaps(game, progress);
|
||||
}
|
||||
|
||||
void Level4_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Level4_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Level4_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_Keydown(game, ev);
|
||||
}
|
||||
|
||||
void Level4_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
}
|
||||
|
||||
void Level4_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
}
|
||||
|
||||
void Level4_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
}
|
34
src/levels/level4.h
Normal file
34
src/levels/level4.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*! \file Level4.h
|
||||
* \brief Level 4 headers.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
void Level4_Load(struct Game *game);
|
||||
void Level4_Unload(struct Game *game);
|
||||
void Level4_UnloadBitmaps(struct Game *game);
|
||||
void Level4_Preload(struct Game *game);
|
||||
void Level4_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
inline int Level4_PreloadSteps();
|
||||
void Level4_Draw(struct Game *game);
|
||||
void Level4_Logic(struct Game *game);
|
||||
void Level4_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level4_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level4_Resume(struct Game *game);
|
||||
void Level4_Pause(struct Game *game);
|
72
src/levels/level5.c
Normal file
72
src/levels/level5.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*! \file Level5.c
|
||||
* \brief Level 5 code.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
void Level5_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
}
|
||||
|
||||
void Level5_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
}
|
||||
|
||||
void Level5_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
}
|
||||
|
||||
void Level5_Preload(struct Game *game) {
|
||||
Moonwalk_Preload(game);
|
||||
}
|
||||
|
||||
inline int Level5_PreloadSteps() {
|
||||
return 0+Moonwalk_PreloadSteps();
|
||||
}
|
||||
|
||||
void Level5_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level5_PreloadSteps());
|
||||
Moonwalk_PreloadBitmaps(game, progress);
|
||||
}
|
||||
|
||||
void Level5_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Level5_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Level5_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_Keydown(game, ev);
|
||||
}
|
||||
|
||||
void Level5_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
}
|
||||
|
||||
void Level5_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
}
|
||||
|
||||
void Level5_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
}
|
34
src/levels/level5.h
Normal file
34
src/levels/level5.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*! \file Level5.h
|
||||
* \brief Level 5 headers.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
void Level5_Load(struct Game *game);
|
||||
void Level5_Unload(struct Game *game);
|
||||
void Level5_UnloadBitmaps(struct Game *game);
|
||||
void Level5_Preload(struct Game *game);
|
||||
void Level5_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
inline int Level5_PreloadSteps();
|
||||
void Level5_Draw(struct Game *game);
|
||||
void Level5_Logic(struct Game *game);
|
||||
void Level5_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level5_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level5_Resume(struct Game *game);
|
||||
void Level5_Pause(struct Game *game);
|
72
src/levels/level6.c
Normal file
72
src/levels/level6.c
Normal file
|
@ -0,0 +1,72 @@
|
|||
/*! \file Level6.c
|
||||
* \brief Level 6 code.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "../gamestates/level.h"
|
||||
#include "moonwalk.h"
|
||||
|
||||
void Level6_Load(struct Game *game) {
|
||||
Moonwalk_Load(game);
|
||||
}
|
||||
|
||||
void Level6_Unload(struct Game *game) {
|
||||
Moonwalk_Unload(game);
|
||||
}
|
||||
|
||||
void Level6_UnloadBitmaps(struct Game *game) {
|
||||
Moonwalk_UnloadBitmaps(game);
|
||||
}
|
||||
|
||||
void Level6_Preload(struct Game *game) {
|
||||
Moonwalk_Preload(game);
|
||||
}
|
||||
|
||||
inline int Level6_PreloadSteps() {
|
||||
return 0+Moonwalk_PreloadSteps();
|
||||
}
|
||||
|
||||
void Level6_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float)) {
|
||||
//PROGRESS_INIT(Level6_PreloadSteps());
|
||||
Moonwalk_PreloadBitmaps(game, progress);
|
||||
}
|
||||
|
||||
void Level6_Draw(struct Game *game) {
|
||||
Moonwalk_Draw(game);
|
||||
}
|
||||
|
||||
void Level6_Logic(struct Game *game) {
|
||||
Moonwalk_Logic(game);
|
||||
}
|
||||
|
||||
void Level6_Keydown(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_Keydown(game, ev);
|
||||
}
|
||||
|
||||
void Level6_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev) {
|
||||
Moonwalk_ProcessEvent(game, ev);
|
||||
}
|
||||
|
||||
void Level6_Resume(struct Game *game) {
|
||||
Moonwalk_Resume(game);
|
||||
}
|
||||
|
||||
void Level6_Pause(struct Game *game) {
|
||||
Moonwalk_Pause(game);
|
||||
}
|
34
src/levels/level6.h
Normal file
34
src/levels/level6.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*! \file Level6.h
|
||||
* \brief Level 6 headers.
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) Sebastian Krzyszkowiak <dos@dosowisko.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
#include "../main.h"
|
||||
|
||||
void Level6_Load(struct Game *game);
|
||||
void Level6_Unload(struct Game *game);
|
||||
void Level6_UnloadBitmaps(struct Game *game);
|
||||
void Level6_Preload(struct Game *game);
|
||||
void Level6_PreloadBitmaps(struct Game *game, void (*progress)(struct Game*, float));
|
||||
inline int Level6_PreloadSteps();
|
||||
void Level6_Draw(struct Game *game);
|
||||
void Level6_Logic(struct Game *game);
|
||||
void Level6_Keydown(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level6_ProcessEvent(struct Game *game, ALLEGRO_EVENT *ev);
|
||||
void Level6_Resume(struct Game *game);
|
||||
void Level6_Pause(struct Game *game);
|
Loading…
Reference in a new issue