diff --git a/scripts/heroes/0.gd b/scripts/heroes/0.gd index 80d0ec0..83736e6 100644 --- a/scripts/heroes/0.gd +++ b/scripts/heroes/0.gd @@ -15,6 +15,8 @@ func _ready(): air_accel *= 2 jump_speed *= 1 air_speed_build *= 2 + # Since movement is the only ability of this hero, it builds charge more + movement_charge *= 2 func control_player(state): .control_player(state) diff --git a/scripts/heroes/3.gd b/scripts/heroes/3.gd index 8112291..c904333 100644 --- a/scripts/heroes/3.gd +++ b/scripts/heroes/3.gd @@ -1,3 +1,5 @@ +# Hero three boosts a friend, making them faster + extends "res://scripts/player.gd" var merge_power = .75 diff --git a/scripts/objective.gd b/scripts/objective.gd index 94111b9..9a82243 100644 --- a/scripts/objective.gd +++ b/scripts/objective.gd @@ -58,7 +58,6 @@ func _process(delta): update_count += delta if is_network_master() and update_count > update_frequency: update_count = 0 - print("updatey counts") rset("left", left) rset("right", right) diff --git a/scripts/player.gd b/scripts/player.gd index 31a67ac..494a35d 100644 --- a/scripts/player.gd +++ b/scripts/player.gd @@ -1,4 +1,5 @@ # Original: https://raw.githubusercontent.com/Calinou/fps-test/master/scripts/player.gd +# All heroes extend from here. Implements all common behavior extends RigidBody @@ -19,7 +20,8 @@ sync var switch_charge = 0 var switch_charge_cap = 200 # While switching is always at 100, things like speed boost might go higher! var movement_charge = 0.1 # In percent per meter (except when heroes change that) -const fall_height = -50 +var fall_height = -400 # This is essentially the respawn timer +var switch_height = -150 # At this point, stop adding to switch_charge. This makes falls not charge you too much var debug_node var recording @@ -74,9 +76,11 @@ func _process(delta): # All player code not caused by input, and not causing movement if is_network_master(): var vel = get_linear_velocity() + if translation.y < switch_height: + vel.y = 0 # Don't gain charge from falling when below switch_height switch_charge += movement_charge * vel.length() * delta var switch_node = get_node("MasterOnly/SwitchCharge") - switch_node.set_text("%.f%%" % switch_charge) + switch_node.set_text("%d%%" % int(switch_charge)) # We truncate, rather than round, so that switch is displayed AT 100% if switch_charge >= 100: # Let switch_charge keep building, because we use it for walk_speed and things switch_node.set_text("100%% (%.f)\nQ - Switch hero" % switch_charge) diff --git a/scripts/tp_camera.gd b/scripts/tp_camera.gd index d0fae13..9f3d129 100644 --- a/scripts/tp_camera.gd +++ b/scripts/tp_camera.gd @@ -14,7 +14,7 @@ var cam_smooth_movement = true; var cam_fov = 60.0; var cam_view_sensitivity = 0.3; var cam_smooth_lerp = 10; -var cam_pitch_minmax = Vector2(90, -90); +var cam_pitch_minmax = Vector2(89, -89); var is_enabled = false; var collision_exception = [];