formatting
[carveJwlIkooP6JGAAIwe30JlM.git] / player.h
index 25054e03f38db5040af9c9437364e99d9a4adc71..82381c27b84e14fbb0f706c62dc151e7f06fa04e 100644 (file)
--- a/player.h
+++ b/player.h
@@ -27,6 +27,7 @@ static float
    k_steer_air_lerp        = 0.3f,
    k_pump_force            = 0.0f,
    k_downforce             = 5.0f,
+   k_walk_downforce        = 8.0f,
    k_jump_charge_speed     = (1.0f/1.0f),
    k_jump_force            = 5.0f,
    k_pitch_limit           = 1.5f,
@@ -69,7 +70,10 @@ static struct gplayer
    phys, 
    phys_gate_frame;
 
-   int is_dead;
+   m4x3f visual_transform,
+         inv_visual_transform;
+
+   int is_dead, death_tick_allowance;
 
    v3f land_target;
    v3f land_target_log[22];
@@ -97,8 +101,10 @@ static struct gplayer
          fsetup,
          walk_timer,
          fjump,
-         fonboard;
+         fonboard,
+         frun;
 
+   float walk;
    int step_phase;
 
    /* player model */
@@ -113,7 +119,8 @@ static struct gplayer
                            *anim_push, *anim_push_reverse,
                            *anim_ollie, *anim_ollie_reverse,
                            *anim_grabs, *anim_stop,
-                           *anim_walk, *anim_run, *anim_idle;
+                           *anim_walk, *anim_run, *anim_idle,
+                           *anim_jump;
 
       u32 id_hip,
           id_ik_hand_l,
@@ -235,6 +242,7 @@ static void player_update_pre(void)
    if( vg_get_button_down( "reset" ) )
    {
       player.is_dead = 0;
+      player.death_tick_allowance = 30;
       player_restore_frame();
 
       if( !phys->on_board )
@@ -262,6 +270,9 @@ static void player_update_pre(void)
 
 static void player_update_fixed(void)                                    /* 2 */
 {
+   if( player.death_tick_allowance )
+      player.death_tick_allowance --;
+
    struct player_phys *phys = &player.phys;
 
    if( player.is_dead )
@@ -339,8 +350,11 @@ static float *player_get_pos(void)
 
 static void player_kill(void)
 {
-   player.is_dead = 1;
-   player_ragdoll_copy_model( player.phys.rb.v );
+   if( player.death_tick_allowance == 0 )
+   {
+      player.is_dead = 1;
+      player_ragdoll_copy_model( player.phys.rb.v );
+   }
 }
 
 static float *player_cam_pos(void)