From 0e142e7a8d04db5ceaa41a866f67ef6f92fcd189 Mon Sep 17 00:00:00 2001 From: Wintermate Date: Mon, 21 Oct 2013 02:14:19 +0200 Subject: [PATCH] Drei Extraleben, x 0 auch noch spielbar. Anzeigeschirm besser formatiert. --- badge/jumpnrun/game_state.c | 2 +- badge/jumpnrun/jumpnrun.c | 6 ++++-- badge/jumpnrun/stats.c | 4 ++-- mock/Makefile | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/badge/jumpnrun/game_state.c b/badge/jumpnrun/game_state.c index d8186d5..1085e7f 100644 --- a/badge/jumpnrun/game_state.c +++ b/badge/jumpnrun/game_state.c @@ -2,7 +2,7 @@ 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) { diff --git a/badge/jumpnrun/jumpnrun.c b/badge/jumpnrun/jumpnrun.c index b264696..e859503 100644 --- a/badge/jumpnrun/jumpnrun.c +++ b/badge/jumpnrun/jumpnrun.c @@ -244,7 +244,9 @@ uint8_t jumpnrun_play(char const *lvname) { 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); @@ -282,7 +284,7 @@ uint8_t jumpnrun_play(char const *lvname) { } } } - } + } 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; diff --git a/badge/jumpnrun/stats.c b/badge/jumpnrun/stats.c index cbcb24b..9450d57 100644 --- a/badge/jumpnrun/stats.c +++ b/badge/jumpnrun/stats.c @@ -13,8 +13,8 @@ void jumpnrun_show_lives_screen(jumpnrun_game_state const *state) { 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"; diff --git a/mock/Makefile b/mock/Makefile index 4414c13..11c7b7e 100644 --- a/mock/Makefile +++ b/mock/Makefile @@ -3,6 +3,7 @@ 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 @@ -43,7 +44,6 @@ CXXDEPS = $(BADGE_CXXSRCS:%.cc=%.dep) $(CONVERTER_SRCS:%.cc=%.dep) 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 -- 2.20.1