feat"redhood interaction and sword getting
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 7s
Create tag and build when new code gets to main / Export (push) Successful in 2m15s

This commit is contained in:
2025-08-02 22:38:04 +02:00
parent 02f04cc38a
commit eda35b4e9b
10 changed files with 912 additions and 47 deletions

View File

@ -8,7 +8,7 @@ script = ExtResource("1_7je20")
arrow_scene = ExtResource("2_ek028") arrow_scene = ExtResource("2_ek028")
[node name="SpawnTiming" type="Timer" parent="."] [node name="SpawnTiming" type="Timer" parent="."]
wait_time = 3.0 wait_time = 5.0
autostart = true autostart = true
[connection signal="timeout" from="SpawnTiming" to="." method="_on_spawn_timing_timeout"] [connection signal="timeout" from="SpawnTiming" to="." method="_on_spawn_timing_timeout"]

View File

@ -59,6 +59,8 @@ func start_choice():
next_label.visible = true next_label.visible = true
choices_container.visible = true choices_container.visible = true
bubble_label.text = choice
accept_label.text = accept_option accept_label.text = accept_option
reject_label.text = reject_option reject_label.text = reject_option

View File

@ -28,8 +28,6 @@ var is_left_speaking = false
func _ready() -> void: func _ready() -> void:
is_left_speaking = start_with_left is_left_speaking = start_with_left
left_speaker.texture = left_picture
right_speaker.texture = right_picture
e_ui_button.visible = false e_ui_button.visible = false
next_label.visible = false next_label.visible = false
@ -39,6 +37,9 @@ func _ready() -> void:
dialogue_steps.append(step.strip_edges()) dialogue_steps.append(step.strip_edges())
func display_profiles(): func display_profiles():
left_speaker.texture = left_picture
right_speaker.texture = right_picture
left_speaker.visible = is_left_speaking left_speaker.visible = is_left_speaking
right_speaker.visible = not is_left_speaking right_speaker.visible = not is_left_speaking
@ -71,7 +72,6 @@ func on_dialogue_started():
bubble_label.visible = true bubble_label.visible = true
bubbles_back.visible = true bubbles_back.visible = true
bubbles_interior.visible = true bubbles_interior.visible = true
display_profiles() display_profiles()
is_dialogue_ongoing = true is_dialogue_ongoing = true
time_between_letters.start() time_between_letters.start()

View File

@ -22,6 +22,7 @@ var active_camera: SuperCamera
@export var foreground = 0.2 @export var foreground = 0.2
@onready var choices_container: MarginContainer = %ChoicesContainer @onready var choices_container: MarginContainer = %ChoicesContainer
@onready var red_hood_cutscene: AnimationPlayer = $RedHoodCutscene
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
@ -61,3 +62,11 @@ func to_main_menu():
func quit_game(): func quit_game():
pass pass
func _on_trigger_second_npc_dialogue_body_entered(body: Node2D) -> void:
red_hood_cutscene.play("cutscene")
func _on_red_hood_sword_dialogue_dialogue_ended() -> void:
red_hood_cutscene.play("flee")

665
main.tscn

File diff suppressed because one or more lines are too long

7
player/blue_profile.tres Normal file
View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://b6ivps1v5bwc7"]
[ext_resource type="Texture2D" uid="uid://dbruj2bdtjfmd" path="res://player/assets/char_blue.png" id="1_jjpkp"]
[resource]
atlas = ExtResource("1_jjpkp")
region = Rect2(22, 24, 11, 12)

View File

@ -11,6 +11,7 @@ var jump_velocity = 400.0
@export_range(0, 10, 0.1, "or_greater") @export_range(0, 10, 0.1, "or_greater")
var gravity_modifier = 1 var gravity_modifier = 1
@onready var sword: AnimatedSprite2D = $Sword
@onready var damageable: Damageable = $Damageable @onready var damageable: Damageable = $Damageable
@onready var shield: AnimatedSprite2D = $Shield @onready var shield: AnimatedSprite2D = $Shield
@onready var base: AnimatedSprite2D = $Base @onready var base: AnimatedSprite2D = $Base
@ -60,7 +61,6 @@ func _physics_process(delta: float) -> void:
velocity.x = move_toward(velocity.x, 0, speed) velocity.x = move_toward(velocity.x, 0, speed)
move_and_slide() move_and_slide()
return return
if not is_on_floor(): if not is_on_floor():
velocity += get_gravity() * delta * gravity_modifier velocity += get_gravity() * delta * gravity_modifier
@ -88,9 +88,16 @@ func _physics_process(delta: float) -> void:
velocity.x = clampf(velocity.x, -speed, speed) velocity.x = clampf(velocity.x, -speed, speed)
else: else:
velocity.x = move_toward(velocity.x, 0, speed) velocity.x = move_toward(velocity.x, 0, speed)
if Input.is_action_just_pressed("hit") and has_sword:
hit()
move_and_slide() move_and_slide()
func hit():
print("hit")
current_animation = "hit"
func _on_dialogue_manager_dialogue_ended() -> void: func _on_dialogue_manager_dialogue_ended() -> void:
set_in_play() set_in_play()
@ -104,7 +111,14 @@ func _on_npc_shield_dialogue_dialogue_ended() -> void:
set_in_play() set_in_play()
current_sprite.visible = false current_sprite.visible = false
current_sprite = shield current_sprite = shield
shield.play("idle") current_sprite.play("idle")
shield.visible = true current_sprite.visible = true
has_shield = true has_shield = true
func _on_red_hood_sword_dialogue_dialogue_ended() -> void:
set_in_play()
current_sprite.visible = false
current_sprite = sword
current_sprite.play("idle")
current_sprite.visible = true
has_sword = true

View File

@ -1,9 +1,11 @@
[gd_scene load_steps=40 format=3 uid="uid://yvp44oauis4n"] [gd_scene load_steps=63 format=3 uid="uid://yvp44oauis4n"]
[ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"] [ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"]
[ext_resource type="Texture2D" uid="uid://dxsbbcagqkiid" path="res://player/assets/RunArmeEpee.png" id="2_hg6s5"]
[ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"] [ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="2_qjkh3"]
[ext_resource type="Texture2D" uid="uid://dv7jhtoptk12r" path="res://player/assets/Danse.png" id="3_hg6s5"] [ext_resource type="Texture2D" uid="uid://dv7jhtoptk12r" path="res://player/assets/Danse.png" id="3_hg6s5"]
[ext_resource type="Texture2D" uid="uid://dwn548x0n4bpd" path="res://player/assets/Outch.png" id="3_rgyib"] [ext_resource type="Texture2D" uid="uid://dwn548x0n4bpd" path="res://player/assets/Outch.png" id="3_rgyib"]
[ext_resource type="Texture2D" uid="uid://d2rfo6ilwusak" path="res://player/assets/Stab .png" id="4_8t03j"]
[ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"] [ext_resource type="Texture2D" uid="uid://dr5ypp4q8n2xm" path="res://player/assets/DebutIdle.png" id="4_rgyib"]
[ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"] [ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="5_boad6"]
[ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"] [ext_resource type="PackedScene" uid="uid://djwoetcyvvofc" path="res://damageable/damageable.tscn" id="5_g6k8r"]
@ -73,6 +75,222 @@ region = Rect2(0, 0, 32, 32)
atlas = ExtResource("3_rgyib") atlas = ExtResource("3_rgyib")
region = Rect2(32, 0, 32, 32) region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jfgyi"]
atlas = ExtResource("4_8t03j")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_237xx"]
atlas = ExtResource("4_8t03j")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_wpyo2"]
atlas = ExtResource("4_8t03j")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_7crtr"]
atlas = ExtResource("4_8t03j")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_vgvch"]
atlas = ExtResource("4_8t03j")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_a1u5o"]
atlas = ExtResource("4_8t03j")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_2ieo8"]
atlas = ExtResource("2_hg6s5")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_ebec5"]
atlas = ExtResource("2_hg6s5")
region = Rect2(288, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_yllr7"]
atlas = ExtResource("2_hg6s5")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_kb6p2"]
atlas = ExtResource("2_hg6s5")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fjxoa"]
atlas = ExtResource("2_hg6s5")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_gswnw"]
atlas = ExtResource("2_hg6s5")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_xcnuv"]
atlas = ExtResource("2_hg6s5")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_j55il"]
atlas = ExtResource("2_hg6s5")
region = Rect2(160, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_hjies"]
atlas = ExtResource("2_hg6s5")
region = Rect2(192, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_mmwog"]
atlas = ExtResource("2_hg6s5")
region = Rect2(224, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_8pxes"]
atlas = ExtResource("2_hg6s5")
region = Rect2(256, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_fmu53"]
atlas = ExtResource("2_hg6s5")
region = Rect2(288, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_w7j2h"]
atlas = ExtResource("2_hg6s5")
region = Rect2(320, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_n0b8q"]
atlas = ExtResource("2_hg6s5")
region = Rect2(352, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_jfgyi"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_tqiix")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_e7oew")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c35mf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_65viv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_x7c3f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_bjvpn")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s7qer")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ge24q")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pnw6m")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_1so5t")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_55jnj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dx5ib")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a2xo5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_art4l")
}],
"loop": true,
"name": &"dance",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_hg6s5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8t03j")
}],
"loop": true,
"name": &"got_hit",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_jfgyi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_237xx")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wpyo2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7crtr")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vgvch")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a1u5o")
}],
"loop": true,
"name": &"hit",
"speed": 12.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_2ieo8")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ebec5")
}],
"loop": true,
"name": &"idle",
"speed": 2.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_yllr7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_kb6p2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fjxoa")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_gswnw")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xcnuv")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j55il")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hjies")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_mmwog")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8pxes")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fmu53")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_w7j2h")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_n0b8q")
}],
"loop": true,
"name": &"run",
"speed": 14.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"] [sub_resource type="AtlasTexture" id="AtlasTexture_wodsf"]
atlas = ExtResource("4_rgyib") atlas = ExtResource("4_rgyib")
region = Rect2(0, 0, 32, 32) region = Rect2(0, 0, 32, 32)
@ -251,6 +469,14 @@ acceleration = 0.177
[node name="AudioListener2D" type="AudioListener2D" parent="."] [node name="AudioListener2D" type="AudioListener2D" parent="."]
current = true current = true
[node name="Sword" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_jfgyi")
animation = &"hit"
autoplay = "idle"
frame_progress = 0.277569
[node name="Shield" type="AnimatedSprite2D" parent="."] [node name="Shield" type="AnimatedSprite2D" parent="."]
visible = false visible = false
position = Vector2(0, -16) position = Vector2(0, -16)
@ -261,7 +487,7 @@ autoplay = "idle"
[node name="Base" type="AnimatedSprite2D" parent="."] [node name="Base" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -16) position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_mmwog") sprite_frames = SubResource("SpriteFrames_mmwog")
animation = &"dance" animation = &"got_hit"
autoplay = "idle" autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."] [node name="CollisionShape2D" type="CollisionShape2D" parent="."]

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://d4lwniwokx7px"]
[ext_resource type="Texture2D" uid="uid://dsxvqsh3umw01" path="res://player/assets/RunCycle.png" id="1_1apyp"]
[resource]
atlas = ExtResource("1_1apyp")
region = Rect2(14, 9, 6, 6)

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://oocxl803i4aa"]
[ext_resource type="Texture2D" uid="uid://d3t1fn35skpip" path="res://player/assets/idle sheet-Sheet.png" id="1_0t2s6"]
[resource]
atlas = ExtResource("1_0t2s6")
region = Rect2(663, 28, 14, 13)