void jumpnrun_game_state_init(jumpnrun_game_state *state, jumpnrun_level const *lv) {
memset(state, 0, sizeof(*state));
- jumpnrun_player_spawn(&state->player, lv->start_pos, 5);
+ jumpnrun_player_spawn(&state->player, lv->start_pos, 3);
}
void jumpnrun_game_state_respawn(jumpnrun_game_state *state, jumpnrun_level const *lv) {
jumpnrun_game_state gs;
- for(jumpnrun_game_state_init(&gs, &lv); (gs.flags & JUMPNRUN_STATE_WON) == 0 && gs.player.lives != 0; --gs.player.lives) {
+ jumpnrun_game_state_init(&gs, &lv);
+
+ do {
jumpnrun_show_lives_screen(&gs);
jumpnrun_game_state_respawn(&gs, &lv);
}
}
}
- }
+ } while((gs.flags & JUMPNRUN_STATE_WON) == 0 && gs.player.lives-- != 0);
if(gs.flags & JUMPNRUN_STATE_WON) { return JUMPNRUN_WON; }
if(gs.player.lives == 0) return JUMPNRUN_LOST;
int8_t y_upper = BADGE_DISPLAY_HEIGHT / 2 - BADGE_FONT_HEIGHT;
int8_t y_lower = (BADGE_DISPLAY_HEIGHT + BADGE_FONT_HEIGHT) / 2;
- int8_t x_left = BADGE_DISPLAY_WIDTH / 2 - fixed_point_cast_int(jumpnrun_player_extents().y) - BADGE_FONT_WIDTH - 5;
- int8_t x_mid = (BADGE_DISPLAY_WIDTH - BADGE_FONT_WIDTH) / 2;
+ int8_t x_mid = (BADGE_DISPLAY_WIDTH - BADGE_FONT_WIDTH ) / 2;
+ int8_t x_left = x_mid - BADGE_FONT_WIDTH - 5;
int8_t x_right = x_mid + BADGE_FONT_WIDTH + 5;
char buf[] = "x";
CPPFLAGS = $$(pkg-config --cflags gtkmm-3.0) -I. -I ../badge
CFLAGS = -Wall -Wextra -pedantic -std=c99 -Werror -O0 -g -fstack-protector-all
CXXFLAGS = -Wall -Wextra -pedantic -std=c++0x -Werror -O0 -g -fstack-protector-all
+LDLIBS = $$(pkg-config --libs gtkmm-3.0)
BADGE = badge
CONVERTER = level-converter
FARDEPS = $(BADGE_FAROBJS:%.o=%.dep)
DEPS = $(CDEPS) $(CXXDEPS) $(FARDEPS)
-LDLIBS = $$(pkg-config --libs gtkmm-3.0)
RM = rm -f
.PHONY: all dep clean distclean play