From 05135ab0a5730471bc4df9ad77bb7957c64f16ba Mon Sep 17 00:00:00 2001 From: Luna Date: Tue, 23 Jan 2018 21:35:24 -0500 Subject: [PATCH] [H0] Build jump speed; [H1] Fix error on click --- scripts/heroes/0.gd | 6 ++++-- scripts/heroes/1.gd | 11 ++++++----- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/heroes/0.gd b/scripts/heroes/0.gd index b21cca7..f2147e0 100644 --- a/scripts/heroes/0.gd +++ b/scripts/heroes/0.gd @@ -3,6 +3,7 @@ extends "res://scripts/player.gd" const wallride_speed_necessary = 2 const wallride_leap_height = 14 const wallride_leap_side = 8 +const wallride_leap_build = 0.01 var since_on_wall = 0 var last_wall_normal = Vector3() @@ -47,8 +48,9 @@ func wallride(state): apply_impulse(Vector3(), air_accel * aim[2] * get_mass()) # Allow jumping (for wall hopping!) if Input.is_action_just_pressed("jump"): - var jump_impulse = wallride_leap_side * last_wall_normal - jump_impulse.y += wallride_leap_height + var build_factor = 1 + switch_charge * wallride_leap_build + var jump_impulse = build_factor * wallride_leap_side * last_wall_normal + jump_impulse.y += build_factor * wallride_leap_height set_gravity_scale(1) # Jumping requires gravity state.apply_impulse(Vector3(), jump_impulse * get_mass()) else: diff --git a/scripts/heroes/1.gd b/scripts/heroes/1.gd index 1d30d9a..5f0843e 100644 --- a/scripts/heroes/1.gd +++ b/scripts/heroes/1.gd @@ -19,11 +19,6 @@ func _process(delta): # Make a floating placement wall placing_wall_node = add_wall() is_placing_wall = true - if Input.is_action_just_pressed("hero_1_confirm_wall"): - finalize_wall(placing_wall_node) - rpc("slave_place_wall", placing_wall_node.get_transform()) - placing_wall_node = null - is_placing_wall = false if is_placing_wall: # Find the point we're looking at, and put the wall there @@ -35,6 +30,12 @@ func _process(delta): var up = -aim[2] # Wall should be horizontal to my view placing_wall_node.look_at(towards, up) + if Input.is_action_just_pressed("hero_1_confirm_wall"): + finalize_wall(placing_wall_node) + rpc("slave_place_wall", placing_wall_node.get_transform()) + placing_wall_node = null + is_placing_wall = false + slave func slave_place_wall(tf): var wall = add_wall() finalize_wall(wall, tf)