Drei Extraleben, x 0 auch noch spielbar. Anzeigeschirm besser formatiert.
authorWintermate <wintermute@hannover.ccc.de>
Mon, 21 Oct 2013 00:14:19 +0000 (02:14 +0200)
committerWintermate <wintermute@hannover.ccc.de>
Mon, 21 Oct 2013 00:14:19 +0000 (02:14 +0200)
badge/jumpnrun/game_state.c
badge/jumpnrun/jumpnrun.c
badge/jumpnrun/stats.c
mock/Makefile

index d8186d5..1085e7f 100644 (file)
@@ -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) {
index b264696..e859503 100644 (file)
@@ -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;
index cbcb24b..9450d57 100644 (file)
@@ -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";
index 4414c13..11c7b7e 100644 (file)
@@ -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
This page took 0.023224 seconds and 4 git commands to generate.