added ground pound
This commit is contained in:
11
scripts/player_ground_pound.gd
Normal file
11
scripts/player_ground_pound.gd
Normal file
@@ -0,0 +1,11 @@
|
||||
extends PlayerState
|
||||
class_name PlayerGroundPound
|
||||
|
||||
@export var ground_pound_velocity = -35
|
||||
|
||||
func Enter():
|
||||
character.velocity += Vector3(0,ground_pound_velocity,0)
|
||||
|
||||
func Physics_Update(delta):
|
||||
if character.is_on_floor():
|
||||
Transitioned.emit(self, "crouched")
|
||||
1
scripts/player_ground_pound.gd.uid
Normal file
1
scripts/player_ground_pound.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://boyl3qkg4j4vc
|
||||
@@ -13,6 +13,9 @@ func Physics_Update(delta):
|
||||
standard_movement(delta)
|
||||
apply_gravity(delta)
|
||||
|
||||
if character.is_on_floor():
|
||||
Transitioned.emit(self,"on foot")
|
||||
|
||||
enable_wall_rays()
|
||||
|
||||
if Input.is_action_just_pressed("jump") and character.jumps_remaining > 0:
|
||||
@@ -23,8 +26,10 @@ func Physics_Update(delta):
|
||||
air_dash_left -= 1
|
||||
character.velocity += character.movement_input().normalized() * air_dash_amount
|
||||
|
||||
if character.is_on_floor():
|
||||
Transitioned.emit(self,"on foot")
|
||||
if Input.is_action_just_pressed("crouch"):
|
||||
Transitioned.emit(self,"ground pound")
|
||||
|
||||
|
||||
|
||||
if can_wall_run():
|
||||
start_wall_running()
|
||||
|
||||
@@ -12,10 +12,7 @@ func Physics_Update(delta):
|
||||
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
|
||||
Transitioned.emit(self,"crouched")
|
||||
|
||||
if Input.is_action_just_pressed("jump"):
|
||||
character.jumps_remaining -= 1
|
||||
|
||||
Reference in New Issue
Block a user