2 // C Implementation: scene
7 // Author: Tobias Glaesser <tobi.web@gmx.de>, (C) 2004
9 // Copyright: See COPYING file that comes with this distribution
24 bool counting_distros;
26 timer_type super_bkgd_timer;
28 unsigned int global_frame_counter;
30 std::vector<bouncy_distro_type> bouncy_distros;
31 std::vector<broken_brick_type> broken_bricks;
32 std::vector<bouncy_brick_type> bouncy_bricks;
33 std::vector<BadGuy> bad_guys;
34 std::vector<floating_score_type> floating_scores;
35 std::vector<upgrade_type> upgrades;
36 std::vector<bullet_type> bullets;
37 std::vector<ParticleSystem*> particle_systems;
39 texture_type img_box_full;
40 texture_type img_box_empty;
41 texture_type img_mints;
42 texture_type img_coffee;
43 texture_type img_super_bkgd;
44 texture_type img_red_glow;
48 void arrays_free(void)
51 bouncy_distros.clear();
52 broken_bricks.clear();
53 bouncy_bricks.clear();
54 floating_scores.clear();
57 std::vector<ParticleSystem*>::iterator i;
58 for(i = particle_systems.begin(); i != particle_systems.end(); ++i) {
61 particle_systems.clear();
64 void set_defaults(void)
71 timer_init(&super_bkgd_timer, true);
73 counting_distros = false;
78 /* set current song/music */
79 set_current_music(LEVEL_MUSIC);
82 void add_score(float x, float y, int s)
86 floating_score_type new_floating_score;
87 floating_score_init(&new_floating_score,x,y,s);
88 floating_scores.push_back(new_floating_score);
91 void add_bouncy_distro(float x, float y)
94 bouncy_distro_type new_bouncy_distro;
95 bouncy_distro_init(&new_bouncy_distro,x,y);
96 bouncy_distros.push_back(new_bouncy_distro);
99 void add_broken_brick(float x, float y)
101 add_broken_brick_piece(x, y, -1, -4);
102 add_broken_brick_piece(x, y + 16, -1.5, -3);
104 add_broken_brick_piece(x + 16, y, 1, -4);
105 add_broken_brick_piece(x + 16, y + 16, 1.5, -3);
108 void add_broken_brick_piece(float x, float y, float xm, float ym)
110 broken_brick_type new_broken_brick;
111 broken_brick_init(&new_broken_brick,x,y,xm,ym);
112 broken_bricks.push_back(new_broken_brick);
115 void add_bouncy_brick(float x, float y)
117 bouncy_brick_type new_bouncy_brick;
118 bouncy_brick_init(&new_bouncy_brick,x,y);
119 bouncy_bricks.push_back(new_bouncy_brick);
122 void add_bad_guy(float x, float y, BadGuyKind kind)
125 new_bad_guy.init(x,y,kind);
126 bad_guys.push_back(new_bad_guy);
129 void add_upgrade(float x, float y, int dir, int kind)
131 upgrade_type new_upgrade;
132 upgrade_init(&new_upgrade,x,y,dir,kind);
133 upgrades.push_back(new_upgrade);
136 void add_bullet(float x, float y, float xm, int dir)
138 bullet_type new_bullet;
139 bullet_init(&new_bullet,x,y,xm,dir);
140 bullets.push_back(new_bullet);
142 play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER);