diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a48f80e..439f848 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 diff --git a/src/gamestates/level.c b/src/gamestates/level.c index f594e43..f7096e2 100644 --- a/src/gamestates/level.c +++ b/src/gamestates/level.c @@ -20,13 +20,32 @@ */ #include #include -#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); } diff --git a/src/levels/level2.c b/src/levels/level2.c new file mode 100644 index 0000000..d5a0f55 --- /dev/null +++ b/src/levels/level2.c @@ -0,0 +1,72 @@ +/*! \file level2.c + * \brief Level 2 code. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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 +#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); +} diff --git a/src/levels/level2.h b/src/levels/level2.h new file mode 100644 index 0000000..ef704d0 --- /dev/null +++ b/src/levels/level2.h @@ -0,0 +1,34 @@ +/*! \file Level2.h + * \brief Level 2 headers. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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); diff --git a/src/levels/level3.c b/src/levels/level3.c new file mode 100644 index 0000000..902cefe --- /dev/null +++ b/src/levels/level3.c @@ -0,0 +1,72 @@ +/*! \file Level3.c + * \brief Level 3 code. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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 +#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); +} diff --git a/src/levels/level3.h b/src/levels/level3.h new file mode 100644 index 0000000..6993077 --- /dev/null +++ b/src/levels/level3.h @@ -0,0 +1,34 @@ +/*! \file Level3.h + * \brief Level 3 headers. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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); diff --git a/src/levels/level4.c b/src/levels/level4.c new file mode 100644 index 0000000..50d979f --- /dev/null +++ b/src/levels/level4.c @@ -0,0 +1,72 @@ +/*! \file Level4.c + * \brief Level 4 code. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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 +#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); +} diff --git a/src/levels/level4.h b/src/levels/level4.h new file mode 100644 index 0000000..d8a0c52 --- /dev/null +++ b/src/levels/level4.h @@ -0,0 +1,34 @@ +/*! \file Level4.h + * \brief Level 4 headers. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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); diff --git a/src/levels/level5.c b/src/levels/level5.c new file mode 100644 index 0000000..a582489 --- /dev/null +++ b/src/levels/level5.c @@ -0,0 +1,72 @@ +/*! \file Level5.c + * \brief Level 5 code. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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 +#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); +} diff --git a/src/levels/level5.h b/src/levels/level5.h new file mode 100644 index 0000000..5c70368 --- /dev/null +++ b/src/levels/level5.h @@ -0,0 +1,34 @@ +/*! \file Level5.h + * \brief Level 5 headers. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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); diff --git a/src/levels/level6.c b/src/levels/level6.c new file mode 100644 index 0000000..d4b36b6 --- /dev/null +++ b/src/levels/level6.c @@ -0,0 +1,72 @@ +/*! \file Level6.c + * \brief Level 6 code. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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 +#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); +} diff --git a/src/levels/level6.h b/src/levels/level6.h new file mode 100644 index 0000000..af7daa2 --- /dev/null +++ b/src/levels/level6.h @@ -0,0 +1,34 @@ +/*! \file Level6.h + * \brief Level 6 headers. + */ +/* + * Copyright (c) Sebastian Krzyszkowiak + * + * 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);