tell them they can chomp

This commit is contained in:
Haze Weathers 2025-07-17 21:49:43 -06:00
parent c57abb8358
commit 86ece55d14
2 changed files with 54 additions and 2 deletions

View file

@ -56,6 +56,8 @@ var first_land = true
var can_shield = true var can_shield = true
var chomp_text_shown = false
# NODE REFERENCES # # NODE REFERENCES #
onready var state_chart: StateChart = $StateChart onready var state_chart: StateChart = $StateChart
@ -118,6 +120,9 @@ func _physics_process(delta: float) -> void:
var can_shoot = Game.stars >= 5 var can_shoot = Game.stars >= 5
# var can_shoot = Game.arrows > 0 and get_tree().get_nodes_in_group("player_arrow").size() == 0 # var can_shoot = Game.arrows > 0 and get_tree().get_nodes_in_group("player_arrow").size() == 0
state_chart.set_guard_property("can_shoot", can_shoot) state_chart.set_guard_property("can_shoot", can_shoot)
if can_shoot and not chomp_text_shown:
$Label/TextAnimation.play("blink")
chomp_text_shown = true
# check for and propagate input events # check for and propagate input events
if Input.is_action_just_pressed("shoot"): # shooting if Input.is_action_just_pressed("shoot"): # shooting

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=53 format=2] [gd_scene load_steps=56 format=2]
[ext_resource path="res://objects/player/player.gd" type="Script" id=1] [ext_resource path="res://objects/player/player.gd" type="Script" id=1]
[ext_resource path="res://graphics/player/sg_zap.png" type="Texture" id=2] [ext_resource path="res://graphics/player/sg_zap.png" type="Texture" id=2]
@ -16,9 +16,41 @@
[ext_resource path="res://graphics/player/sg.png" type="Texture" id=14] [ext_resource path="res://graphics/player/sg.png" type="Texture" id=14]
[ext_resource path="res://scripts/randomize_particle_start.gd" type="Script" id=15] [ext_resource path="res://scripts/randomize_particle_start.gd" type="Script" id=15]
[ext_resource path="res://graphics/particles/shine.png" type="Texture" id=16] [ext_resource path="res://graphics/particles/shine.png" type="Texture" id=16]
[ext_resource path="res://ui/2ndpuberty_scholar_outline.fnt" type="BitmapFont" id=17]
[ext_resource path="res://graphics/particles/dust.png" type="Texture" id=18] [ext_resource path="res://graphics/particles/dust.png" type="Texture" id=18]
[ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=25] [ext_resource path="res://ui/2ndpuberty_outline.tres" type="Material" id=25]
[sub_resource type="Animation" id=36]
length = 0.001
tracks/0/type = "value"
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0 ),
"transitions": PoolRealArray( 1 ),
"update": 1,
"values": [ false ]
}
[sub_resource type="Animation" id=37]
resource_name = "blink"
length = 4.0
tracks/0/type = "value"
tracks/0/path = NodePath(".:visible")
tracks/0/interp = 0
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.6, 4 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 1,
"values": [ true, true, false ]
}
[sub_resource type="ShaderMaterial" id=1] [sub_resource type="ShaderMaterial" id=1]
shader = ExtResource( 3 ) shader = ExtResource( 3 )
shader_param/border_color = Color( 0, 0, 0, 1 ) shader_param/border_color = Color( 0, 0, 0, 1 )
@ -890,6 +922,21 @@ double_jump_force = 124.0
dash_ascension = 124.0 dash_ascension = 124.0
dash_speed = 124.0 dash_speed = 124.0
[node name="Label" type="Label" parent="."]
visible = false
margin_left = -28.0
margin_top = -49.0
margin_right = 28.0
margin_bottom = -26.0
custom_fonts/font = ExtResource( 17 )
text = "press x
to chomp"
align = 1
[node name="TextAnimation" type="AnimationPlayer" parent="Label"]
anims/RESET = SubResource( 36 )
anims/blink = SubResource( 37 )
[node name="Graphics" type="Node2D" parent="."] [node name="Graphics" type="Node2D" parent="."]
[node name="Sprite" type="Sprite" parent="Graphics"] [node name="Sprite" type="Sprite" parent="Graphics"]
@ -1597,8 +1644,8 @@ one_shot = true
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Shooting" to="." method="_on_Shooting_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_on_Pushing_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_on_Pushing_state_entered"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Grounded/Pushing" to="." method="_process_pushing"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"] [connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="_on_Airborne_state_entered"]
[connection signal="state_entered" from="StateChart/Root/Movement/Airborne" to="." method="reset_fall_speed"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne" to="." method="_process_gravity"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_horizontal_movement"]
[connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"] [connection signal="state_physics_processing" from="StateChart/Root/Movement/Airborne/Jump" to="." method="_process_jump"]