it just werks

This commit is contained in:
pennyrigate 2025-03-02 18:02:05 -05:00
parent 1311e18f1f
commit 7e26433676
50 changed files with 1181 additions and 11 deletions

View file

@ -10,6 +10,9 @@ extends CharacterBody2D
@export var state_chart: StateChart
@export var graphics: Node2D
@onready var start_position = position
@onready var voice = %Voice
var ices_touched:int = 0:
set(value):
ices_touched = value
@ -23,7 +26,6 @@ var ices_touched:int = 0:
func _ready() -> void:
state_chart.set_expression_property(&"player", self)
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed(&"ui_accept"):
state_chart.send_event(&"jump_pressed")
@ -59,6 +61,8 @@ func _process_gravity(delta: float) -> void:
#region State One-Shots
func _do_jump() -> void:
voice.stream = load("res://assets/audio/vox/capri_jump.ogg")
voice.play()
velocity.y = -jump_force
position.y -= 1.0

View file

@ -51,9 +51,9 @@ collision_layer = 16
collision_mask = 3
floor_snap_length = 3.0
script = ExtResource("1_jgave")
gravity = 400.0
run_speed = 76.0
jump_force = 150.0
gravity = 450.0
run_speed = 100.0
jump_force = 180.0
state_chart = NodePath("StateChart")
graphics = NodePath("Graphics")
@ -191,6 +191,10 @@ to = NodePath("../../../Grounded")
guard = SubResource("Resource_g8pxc")
delay_in_seconds = "0.0"
[node name="Voice" type="AudioStreamPlayer" parent="."]
unique_name_in_owner = true
bus = &"Capri"
[connection signal="state_entered" from="StateChart/Root/Grounded/Standing" to="." method="_stop_moving"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Standing" to="Graphics/Sprite/Idle" method="play"]
[connection signal="state_entered" from="StateChart/Root/Grounded/Sliding" to="Graphics/Sprite/Idle" method="play"]