Sprunghöhe besser kontrollierbar.
authorWintermute <wintermute@hannover.ccc.de>
Sun, 13 Oct 2013 00:33:01 +0000 (02:33 +0200)
committerWintermute <wintermute@hannover.ccc.de>
Sun, 13 Oct 2013 00:33:01 +0000 (02:33 +0200)
badge/jumpnrun/enemies.c
badge/jumpnrun/jumpnrun.c

index 4ba4e07..7d31eed 100644 (file)
@@ -90,8 +90,8 @@ void enemy_collision_player_jumpable(jumpnrun_enemy      *self,
   if(rectangle_intersect(&rect_self, &rect_hacker)) {
     if(fixed_point_gt(state->inertia.y, FIXED_POINT(0, 0))) {
       self->flags &= ~JUMPNRUN_ENEMY_SPAWNED;
-      state->inertia_mod.y = FIXED_POINT(0, -250);
-      state->jumpable_frames = 8;
+      state->inertia_mod.y = FIXED_POINT(0, -167);
+      state->jumpable_frames = 12;
     } else {
       state->status = JUMPNRUN_DEAD;
     }
@@ -129,7 +129,7 @@ jumpnrun_enemy_type const jumpnrun_enemy_type_data[JUMPNRUN_ENEMY_TYPE_COUNT] =
     enemy_collision_player_jumpable,
     enemy_tick_cat
   }, {
-    16, ARRAY_SIZE(anim_mushroom), anim_mushroom,
+    12, ARRAY_SIZE(anim_mushroom), anim_mushroom,
     { FIXED_POINT_I(0, -50), FIXED_POINT_I(0, 0) },
     enemy_collision_tiles_bounce_horiz,
     enemy_collision_player_jumpable,
index 9f4df56..87b4d36 100644 (file)
@@ -16,7 +16,7 @@
 static vec2d       const gravity      = { FIXED_POINT_I(0,   0), FIXED_POINT_I(0,  56) };
 static vec2d       const move_max     = { FIXED_POINT_I(0, 600), FIXED_POINT_I(1, 300) };
 static fixed_point const accel_horiz  =   FIXED_POINT_I(0,  50);
-static fixed_point const accel_vert   =   FIXED_POINT_I(0, 250);
+static fixed_point const accel_vert   =   FIXED_POINT_I(0, 167);
 static fixed_point const drag_factor  =   FIXED_POINT_I(0, 854);
 static fixed_point const speed_jump_x =   FIXED_POINT_I(0, 600);
 
@@ -244,7 +244,10 @@ void jumpnrun_level_tick(jumpnrun_level      *lv,
   }
 
   state->inertia = state->inertia_mod;
-  state->tick_minor = (state->tick_minor + 1) % 3;
+  ++state->tick_minor;
+  if(state->tick_minor == 3) {
+    state->tick_minor = 0;
+  }
 }
 
 uint8_t jumpnrun_play(char const *lvname) {
@@ -268,7 +271,7 @@ uint8_t jumpnrun_play(char const *lvname) {
         uint8_t new_buttons = new_state & (old_state ^ new_state);
 
         if((new_buttons & BADGE_EVENT_KEY_BTN_A) && gs.touching_ground) {
-          gs.jumpable_frames = 8;
+          gs.jumpable_frames = 12;
         }
 
         break;
This page took 0.026983 seconds and 4 git commands to generate.