* General Public License for more details.
*/
-#include <stdio.h> /* Necessary for sprintf() line 128 */.
+#include <stdio.h>
#include "gui.h"
#include "game.h"
int id, jd, kd;
- struct level_game *lg = curr_lg(); /* Note: const removed. Is this really needed? */
+ struct level_game *lg = curr_lg();
const struct level *l = lg->level;
int high;
{
int gid;
- if(lg->mode == MODE_CHALLENGE && lg->bonus > 0)
+ if (lg->mode == MODE_CHALLENGE && lg->bonus)
{
- lg->bonus = 0;
- lg->bonusid += 1;
- char buf[MAXSTR] = {0};
+ char buf[MAXSTR];
+ sprintf(buf, _("You have unlocked bonus level %s!"),
+ lg->bonus_repr);
- const char *roman[] =
- {
- "",
- "I", "II", "III", "IV", "V",
- "VI", "VII", "VIII", "IX", "X",
- "XI", "XII", "XIII", "XIV", "XV",
- "XVI", "XVII", "XVIII", "XIX", "XX",
- "XXI", "XXII", "XXIII", "XXIV", "XXV"
- };
- sprintf(buf, "You Have Unlocked Bonus Level %s!", roman[lg->bonusid]);
gid = gui_label(id, s3, GUI_MED, GUI_ALL, gui_grn, gui_red);
gid = gui_label(id, buf, GUI_SML, GUI_ALL, gui_blu, gui_grn);
+
+ lg->bonus = 0;
+ lg->bonus_repr = NULL;
}
if (high)
static void goal_timer(int id, float dt)
{
- static float DT = 0.0f;
+ static float t = 0.0f;
float g[3] = { 0.0f, 9.8f, 0.0f };
- DT += dt;
+ t += dt;
if (time_state() < 1.f)
{
+ demo_play_step();
game_step(g, dt, 0);
- demo_play_step(dt);
}
- else if (DT > 0.05f && coins_id)
+ else if (t > 0.05f && coins_id)
{
int coins = gui_value(coins_id);
audio_play(AUD_BALL, 1.0f);
}
}
- DT = 0.0f;
+ t = 0.0f;
}
gui_timer(id, dt);
goal_timer,
shared_point,
shared_stick,
+ shared_angle,
shared_click,
NULL,
goal_buttn,