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 int global_frame_counter;
29 std::vector<bouncy_distro_type> bouncy_distros;
30 std::vector<broken_brick_type> broken_bricks;
31 std::vector<bouncy_brick_type> bouncy_bricks;
32 std::vector<BadGuy> bad_guys;
33 std::vector<floating_score_type> floating_scores;
34 std::vector<upgrade_type> upgrades;
35 std::vector<bullet_type> bullets;
37 texture_type img_box_full;
38 texture_type img_box_empty;
39 texture_type img_mints;
40 texture_type img_coffee;
41 texture_type img_super_bkgd;
42 texture_type img_red_glow;
46 void arrays_init(void)
50 void arrays_free(void)
53 bouncy_distros.clear();
54 broken_bricks.clear();
55 bouncy_bricks.clear();
56 floating_scores.clear();
61 void set_defaults(void)
68 timer_init(&super_bkgd_timer, true);
70 counting_distros = false;
75 /* set current song/music */
76 set_current_music(LEVEL_MUSIC);
79 void add_score(float x, float y, int s)
83 floating_score_type new_floating_score;
84 floating_score_init(&new_floating_score,x,y,s);
85 floating_scores.push_back(new_floating_score);
88 void add_bouncy_distro(float x, float y)
91 bouncy_distro_type new_bouncy_distro;
92 bouncy_distro_init(&new_bouncy_distro,x,y);
93 bouncy_distros.push_back(new_bouncy_distro);
96 void add_broken_brick(float x, float y)
98 add_broken_brick_piece(x, y, -1, -4);
99 add_broken_brick_piece(x, y + 16, -1.5, -3);
101 add_broken_brick_piece(x + 16, y, 1, -4);
102 add_broken_brick_piece(x + 16, y + 16, 1.5, -3);
105 void add_broken_brick_piece(float x, float y, float xm, float ym)
107 broken_brick_type new_broken_brick;
108 broken_brick_init(&new_broken_brick,x,y,xm,ym);
109 broken_bricks.push_back(new_broken_brick);
112 void add_bouncy_brick(float x, float y)
114 bouncy_brick_type new_bouncy_brick;
115 bouncy_brick_init(&new_bouncy_brick,x,y);
116 bouncy_bricks.push_back(new_bouncy_brick);
119 void add_bad_guy(float x, float y, BadGuyKind kind)
122 new_bad_guy.init(x,y,kind);
123 bad_guys.push_back(new_bad_guy);
126 void add_upgrade(float x, float y, int dir, int kind)
128 upgrade_type new_upgrade;
129 upgrade_init(&new_upgrade,x,y,dir,kind);
130 upgrades.push_back(new_upgrade);
133 void add_bullet(float x, float y, float xm, int dir)
135 bullet_type new_bullet;
136 bullet_init(&new_bullet,x,y,xm,dir);
137 bullets.push_back(new_bullet);
139 play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER);