Browse Source

Allow Hero 0 to increase their speed with E

master
Luna 7 years ago
parent
commit
3cf1da90f8
2 changed files with 16 additions and 1 deletions
  1. +4
    -0
      project.godot
  2. +12
    -1
      scripts/heroes/0.gd

+ 4
- 0
project.godot View File

@ -55,6 +55,10 @@ hero_5_confirm_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":f
]
hero_5_remove_portal=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":2,"pressed":false,"doubleclick":false,"script":null)
]
primary_action=[ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":46,"unicode":0,"echo":false,"script":null)
]
hero_0_boost=[ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
]
[rendering]


+ 12
- 1
scripts/heroes/0.gd View File

@ -12,15 +12,26 @@ var wallride_forgiveness = .3
func _ready():
._ready()
walk_speed *= 0.8
air_accel *= 2
air_accel *= 1.5
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):
var original_speed = walk_speed
var original_accel = air_accel
var boost_strength = 2
var boost_drain = 25 # Recall increased charge must be factored in
var cost = boost_drain * state.step
if Input.is_action_pressed("primary_action") and switch_charge > cost:
walk_speed *= 2
air_accel *= 2
switch_charge -= cost
.control_player(state)
wallride(state)
walk_speed = original_speed
air_accel = original_accel
func wallride(state):


Loading…
Cancel
Save