add jumping
[carveJwlIkooP6JGAAIwe30JlM.git] / player.h
index 2c6ee19ef51b94e21e9df556a6ce0bb6a51f2d4c..57a862817038bb5bf798118617d42a3ed45d2589 100644 (file)
--- a/player.h
+++ b/player.h
@@ -12,8 +12,8 @@
 #include "bvh.h"
 
 static float 
-   k_walkspeed             = 7.0f,  /* no longer used */
-   k_runspeed              = 14.0f,
+   k_walkspeed             = 20.0f,  /* no longer used */
+   k_runspeed              = 20.0f,
    k_board_radius          = 0.3f,
    k_board_length          = 0.45f,
    k_board_allowance       = 0.04f,
@@ -27,11 +27,12 @@ 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,
    k_look_speed            = 2.0f,
-   k_walk_accel            = 5.0f,
+   k_walk_accel            = 150.0f,
    k_walk_friction         = 8.0f;
 
 static int freecam = 0;
@@ -113,7 +114,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,
@@ -232,7 +234,7 @@ static void player_update_pre(void)
 {
    struct player_phys *phys = &player.phys;
 
-   if( vg_get_axis("grabl")>0.0f)
+   if( vg_get_button_down( "reset" ) )
    {
       player.is_dead = 0;
       player_restore_frame();
@@ -252,6 +254,11 @@ static void player_update_pre(void)
    if( vg_get_button_down( "switchmode" ) )
    {
       phys->on_board ^= 0x1;
+
+      if( phys->on_board )
+      {
+         v3_muladds( phys->rb.v, phys->rb.forward, 0.2f, phys->rb.v );
+      }
    }
 }