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_init(void)
52 void arrays_free(void)
55 bouncy_distros.clear();
56 broken_bricks.clear();
57 bouncy_bricks.clear();
58 floating_scores.clear();
61 std::vector<ParticleSystem*>::iterator i;
62 for(i = particle_systems.begin(); i != particle_systems.end(); ++i) {
65 particle_systems.clear();
68 void set_defaults(void)
75 timer_init(&super_bkgd_timer, true);
77 counting_distros = false;
82 /* set current song/music */
83 set_current_music(LEVEL_MUSIC);
86 void add_score(float x, float y, int s)
90 floating_score_type new_floating_score;
91 floating_score_init(&new_floating_score,x,y,s);
92 floating_scores.push_back(new_floating_score);
95 void add_bouncy_distro(float x, float y)
98 bouncy_distro_type new_bouncy_distro;
99 bouncy_distro_init(&new_bouncy_distro,x,y);
100 bouncy_distros.push_back(new_bouncy_distro);
103 void add_broken_brick(float x, float y)
105 add_broken_brick_piece(x, y, -1, -4);
106 add_broken_brick_piece(x, y + 16, -1.5, -3);
108 add_broken_brick_piece(x + 16, y, 1, -4);
109 add_broken_brick_piece(x + 16, y + 16, 1.5, -3);
112 void add_broken_brick_piece(float x, float y, float xm, float ym)
114 broken_brick_type new_broken_brick;
115 broken_brick_init(&new_broken_brick,x,y,xm,ym);
116 broken_bricks.push_back(new_broken_brick);
119 void add_bouncy_brick(float x, float y)
121 bouncy_brick_type new_bouncy_brick;
122 bouncy_brick_init(&new_bouncy_brick,x,y);
123 bouncy_bricks.push_back(new_bouncy_brick);
126 void add_bad_guy(float x, float y, BadGuyKind kind)
129 new_bad_guy.init(x,y,kind);
130 bad_guys.push_back(new_bad_guy);
133 void add_upgrade(float x, float y, int dir, int kind)
135 upgrade_type new_upgrade;
136 upgrade_init(&new_upgrade,x,y,dir,kind);
137 upgrades.push_back(new_upgrade);
140 void add_bullet(float x, float y, float xm, int dir)
142 bullet_type new_bullet;
143 bullet_init(&new_bullet,x,y,xm,dir);
144 bullets.push_back(new_bullet);
146 play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER);