1 /*
2  * level.h - code for the game levels
3  * Copyright (C) 2008-2010  Alexandre Martins <alemartf(at)gmail(dot)com>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef _LEVEL_H
21 #define _LEVEL_H
22 
23 #include "../core/v2d.h"
24 #include "../core/audio.h"
25 #include "../entities/player.h"
26 #include "../entities/item.h"
27 #include "../entities/enemy.h"
28 #include "../entities/brick.h"
29 
30 
31 /* use this before pushing the level scene into the stack */
32 void level_setfile(const char *level);
33 
34 /* scene methods */
35 void level_init();
36 void level_update();
37 void level_render();
38 void level_release();
39 
40 /* useful stuff */
41 float level_gravity();
42 int level_player_id();
43 void level_change_player(int id);
44 void level_create_particle(image_t *image, v2d_t position, v2d_t speed, int destroy_on_brick);
45 player_t* level_player();
46 brick_t* level_create_brick(int type, v2d_t position);
47 item_t* level_create_item(int type, v2d_t position);
48 enemy_t* level_create_enemy(const char *name, v2d_t position);
49 item_list_t* level_item_list();
50 enemy_list_t* level_enemy_list();
51 v2d_t level_brick_move_actor(brick_t *brick, actor_t *act);
52 void level_add_to_score(int score);
53 item_t* level_create_animal(v2d_t position);
54 void level_set_camera_focus(actor_t *act);
55 int level_editmode();
56 v2d_t level_size();
57 void level_override_music(sound_t *sample);
58 void level_set_spawn_point(v2d_t newpos);
59 void level_clear(actor_t *end_sign);
60 void level_add_to_secret_bonus(int value);
61 void level_call_dialogbox(char *title, char *message);
62 void level_hide_dialogbox();
63 int level_boss_battle();
64 void level_kill_all_baddies();
65 void level_lock_camera(int x1, int y1, int x2, int y2);
66 void level_unlock_camera();
67 void level_restore_music();
68 
69 #endif
70