added ground pound
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=42 format=3 uid="uid://drwae3loscbw7"]
|
||||
[gd_scene load_steps=43 format=3 uid="uid://drwae3loscbw7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bieeh1iro4ji1" path="res://scripts/player.gd" id="1_x7wms"]
|
||||
[ext_resource type="Script" uid="uid://linvnr16djav" path="res://scripts/PlayerStateMachine.gd" id="2_1npgd"]
|
||||
@@ -10,6 +10,7 @@
|
||||
[ext_resource type="Script" uid="uid://clyi3lxv4xt4g" path="res://scripts/player_jumping.gd" id="5_m0ick"]
|
||||
[ext_resource type="PackedScene" uid="uid://br882tlh3cfwu" path="res://hud.tscn" id="5_yenaw"]
|
||||
[ext_resource type="Script" uid="uid://bgj2bqb5dys41" path="res://scripts/player_wall_running.gd" id="6_1npgd"]
|
||||
[ext_resource type="Script" uid="uid://boyl3qkg4j4vc" path="res://scripts/player_ground_pound.gd" id="7_2asft"]
|
||||
[ext_resource type="AudioStream" uid="uid://bki17g7j4kqn4" path="res://assets/Audio/PickupSound Mixdown 3.wav" id="8_dwqsx"]
|
||||
[ext_resource type="Shader" uid="uid://djbvmc8hurccm" path="res://assets/Shaders/speedlines.gdshader" id="10_5hu7c"]
|
||||
[ext_resource type="AudioStream" uid="uid://dyd272r7n2ecd" path="res://assets/Audio/footsteps-shoes-jump-land-beach-sand-SBA-300118001.wav" id="10_tn0pn"]
|
||||
@@ -162,6 +163,7 @@ move_speed = 15.0
|
||||
move_transition_speed = 15.0
|
||||
|
||||
[node name="Ground Pound" type="Node" parent="States"]
|
||||
script = ExtResource("7_2asft")
|
||||
|
||||
[node name="Knocked" type="Node" parent="States"]
|
||||
|
||||
|
||||
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
|
||||
|
||||
if Input.is_action_just_pressed("jump"):
|
||||
character.jumps_remaining -= 1
|
||||
|
||||
Reference in New Issue
Block a user