crouch still needs tweaking on the camera but functional, added air dash
This commit is contained in:
22
scripts/player_on_foot.gd
Normal file
22
scripts/player_on_foot.gd
Normal file
@@ -0,0 +1,22 @@
|
||||
extends PlayerState
|
||||
class_name PlayerOnFoot
|
||||
|
||||
|
||||
func Enter():
|
||||
character.jumps_remaining = character.MAX_JUMPS
|
||||
|
||||
func Physics_Update(delta):
|
||||
if character.is_on_floor():
|
||||
standard_movement(delta)
|
||||
else:
|
||||
Transitioned.emit(self,"in air")
|
||||
|
||||
if Input.is_action_just_pressed("crouch"):
|
||||
if character.is_on_floor():
|
||||
Transitioned.emit(self,"crouched")
|
||||
else:
|
||||
character.velocity.y -= 25
|
||||
|
||||
if Input.is_action_just_pressed("jump"):
|
||||
character.jumps_remaining -= 1
|
||||
character.velocity.y += character.JUMP_VELOCITY
|
||||
Reference in New Issue
Block a user