feat: final cutscene and full game loop
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 6s
Create tag and build when new code gets to main / Export (push) Successful in 2m26s

This commit is contained in:
2025-08-03 11:25:21 +02:00
parent 3e0f1c99d5
commit 2d44a2da05
17 changed files with 694 additions and 199 deletions

View File

@ -16,11 +16,11 @@ func damage(value: int = 0, direction: Vector2 = Vector2.UP):
if not active:
return
if hitback_velocity > 0:
get_parent().velocity = hitback_velocity * direction
got_hit.emit()
health -= value
if health <= 0:
die.emit()
return
get_parent().velocity = hitback_velocity * direction
got_hit.emit()

BIN
ennemy/Flammes.png (Stored with Git LFS) Normal file

Binary file not shown.

34
ennemy/Flammes.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dut0ru3y8rung"
path="res://.godot/imported/Flammes.png-6539d30ca9b68fe1b06de69547ee6ef1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ennemy/Flammes.png"
dest_files=["res://.godot/imported/Flammes.png-6539d30ca9b68fe1b06de69547ee6ef1.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
ennemy/MechantVol.png (Stored with Git LFS)

Binary file not shown.

View File

@ -8,7 +8,7 @@ func _ready() -> void:
hitbox.monitoring = false
func play_anim_run():
animated_sprite.play("run")
animated_sprite.play("idle")
func play_anim_idle():
animated_sprite.play("idle")

View File

@ -1,11 +1,52 @@
[gd_scene load_steps=8 format=3 uid="uid://c5ruphrd8ebuu"]
[gd_scene load_steps=13 format=3 uid="uid://c5ruphrd8ebuu"]
[ext_resource type="Script" uid="uid://dailpwkay2nu5" path="res://ennemy/armored_ennemy.gd" id="1_f4v0e"]
[ext_resource type="SpriteFrames" uid="uid://i6035vm5ited" path="res://player/armored_spritesheet.tres" id="1_k1sc2"]
[ext_resource type="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="2_f4v0e"]
[ext_resource type="Texture2D" uid="uid://cjruk5xlt3tyn" path="res://ennemy/MechantVol.png" id="2_iblih"]
[ext_resource type="PackedScene" uid="uid://7sqwi3lygb1u" path="res://damageable/hitbox.tscn" id="4_e5h8j"]
[ext_resource type="AudioStream" uid="uid://c0w61do2a1hbc" path="res://ennemy/black-magic-159868.mp3" id="5_iblih"]
[sub_resource type="AtlasTexture" id="AtlasTexture_iblih"]
atlas = ExtResource("2_iblih")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_vaovl"]
atlas = ExtResource("2_iblih")
region = Rect2(128, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_i1xbb"]
atlas = ExtResource("2_iblih")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_0a3sv"]
atlas = ExtResource("2_iblih")
region = Rect2(96, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_vaovl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_iblih")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_vaovl")
}],
"loop": true,
"name": &"hit",
"speed": 6.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_i1xbb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_0a3sv")
}],
"loop": true,
"name": &"idle",
"speed": 2.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f4v0e"]
[sub_resource type="CircleShape2D" id="CircleShape2D_e5h8j"]
@ -15,7 +56,7 @@ script = ExtResource("1_f4v0e")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(1, -16)
sprite_frames = ExtResource("1_k1sc2")
sprite_frames = SubResource("SpriteFrames_vaovl")
animation = &"idle"
autoplay = "idle"

10
main.gd
View File

@ -23,6 +23,7 @@ var active_camera: SuperCamera
@onready var choices_container: MarginContainer = %ChoicesContainer
@onready var red_hood_cutscene: AnimationPlayer = $RedHoodCutscene
@onready var final_cutscene: AnimationPlayer = $FinalCutscene
# Called when the node enters the scene tree for the first time.
@ -44,6 +45,7 @@ func _process(delta: float) -> void:
bubbles_back.global_position.x = active_camera.global_position.x
bubbles_interior.global_position.x = active_camera.global_position.x
choices_container.global_position.x = active_camera.global_position.x - 100
opening_fade_to_black.global_position.x = active_camera.global_position.x - 320.0
background_far.global_position.x = active_camera.global_position.x * parallax_far
background_middle.global_position.x = active_camera.global_position.x * parallax_middle
@ -70,3 +72,11 @@ func _on_trigger_second_npc_dialogue_body_entered(body: Node2D) -> void:
func _on_red_hood_sword_dialogue_dialogue_ended() -> void:
red_hood_cutscene.play("flee")
func _on_final_armor_dialogue_ended() -> void:
red_hood_cutscene.play("final")
func _on_final_cinematic_body_entered(body: Node2D) -> void:
final_cutscene.play("cutscene")

515
main.tscn

File diff suppressed because one or more lines are too long

BIN
player/assets/IdleArmes.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bhrqdo0cadpf4"
path="res://.godot/imported/IdleArmes.png-4b0b1618004fdb09b94c469795d19762.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player/assets/IdleArmes.png"
dest_files=["res://.godot/imported/IdleArmes.png-4b0b1618004fdb09b94c469795d19762.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

BIN
player/assets/Tete.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://drjrcocrm4bpw"
path="res://.godot/imported/Tete.png-d9734c8572ccd9529363aece42849208.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://player/assets/Tete.png"
dest_files=["res://.godot/imported/Tete.png-d9734c8572ccd9529363aece42849208.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1

View File

@ -14,6 +14,7 @@ var gravity_modifier = 1
@onready var hitting: Timer = $Hitting
@onready var hitbox: Area2D = $Hitbox
@onready var armor: AnimatedSprite2D = $Armor
@onready var sword: AnimatedSprite2D = $Sword
@onready var damageable: Damageable = $Damageable
@onready var shield: AnimatedSprite2D = $Shield
@ -33,15 +34,19 @@ func play_anim():
func play_anim_run():
current_animation = "run"
current_sprite.play("run")
func play_anim_idle():
current_animation = "idle"
current_sprite.play("idle")
func play_anim_jump():
current_animation = "jump"
current_animation = "walk"
current_sprite.play("walk")
func play_anim_dance():
current_animation = "dance"
current_sprite.play("dance")
func set_in_cutscene():
is_in_cutscene = true
@ -60,11 +65,11 @@ func _ready() -> void:
current_sprite = base
func _physics_process(delta: float) -> void:
play_anim()
if is_in_cutscene:
velocity.x = move_toward(velocity.x, 0, speed)
move_and_slide()
return
play_anim()
if is_hitting:
current_animation = "hit"
@ -77,7 +82,11 @@ func _physics_process(delta: float) -> void:
var direction := Input.get_axis("move_left", "move_right")
damageable.set_active(has_shield and direction != 0)
if(has_shield and not has_sword and direction == 0):
damageable.set_active(false)
else:
damageable.set_active(true)
if direction > 0 and is_on_floor():
look_right()
if direction < 0 and is_on_floor():
@ -107,13 +116,12 @@ func _physics_process(delta: float) -> void:
func hit():
is_hitting = true
hitting.start()
hitbox.monitorable = true
hitbox.monitoring = true
func _on_hitting_timeout() -> void:
is_hitting = false
hitbox.monitorable = false
hitbox.monitoring = false
damageable.set_active(true)
func _on_dialogue_manager_dialogue_ended() -> void:
set_in_play()
@ -139,3 +147,17 @@ func _on_red_hood_sword_dialogue_dialogue_ended() -> void:
current_sprite.play("idle")
current_sprite.visible = true
has_sword = true
func _on_put_on_armor() -> void:
current_sprite.visible = false
current_sprite = armor
current_sprite.play("power_up")
current_sprite.visible = true
has_armor = true
func _on_final_armor_dialogue_ended() -> void:
set_in_play()
current_sprite.play("idle")
func _on_trigger_final_dialogue_body_entered(body: Node2D) -> void:
set_in_cutscene()

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=65 format=3 uid="uid://yvp44oauis4n"]
[gd_scene load_steps=79 format=3 uid="uid://yvp44oauis4n"]
[ext_resource type="Script" uid="uid://c1fqj3lba7wik" path="res://player/player.gd" id="1_yw30f"]
[ext_resource type="Texture2D" uid="uid://cjruk5xlt3tyn" path="res://ennemy/MechantVol.png" id="2_ebec5"]
[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="Texture2D" uid="uid://dv7jhtoptk12r" path="res://player/assets/Danse.png" id="3_hg6s5"]
@ -10,8 +11,82 @@
[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="Shape2D" uid="uid://6rhdwj5jxbxn" path="res://player/player_collision.tres" id="5_qjkh3"]
[ext_resource type="Texture2D" uid="uid://dw6tn0grt2ajc" path="res://player/assets/WalkCycle.png" id="10_yllr7"]
[ext_resource type="PackedScene" uid="uid://7sqwi3lygb1u" path="res://damageable/hitbox.tscn" id="11_2ieo8"]
[sub_resource type="AtlasTexture" id="AtlasTexture_3dxkp"]
atlas = ExtResource("2_ebec5")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_6wior"]
atlas = ExtResource("2_ebec5")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_p5tca"]
atlas = ExtResource("2_ebec5")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_jbx34"]
atlas = ExtResource("2_ebec5")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_s3g0c"]
atlas = ExtResource("2_ebec5")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_35wys"]
atlas = ExtResource("2_ebec5")
region = Rect2(96, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_pjwc4"]
atlas = ExtResource("2_ebec5")
region = Rect2(128, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_or4qq"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3dxkp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6wior")
}],
"loop": true,
"name": &"idle",
"speed": 2.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_p5tca")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jbx34")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s3g0c")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_35wys")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pjwc4")
}],
"loop": false,
"name": &"power_up",
"speed": 4.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3dxkp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_6wior")
}],
"loop": true,
"name": &"run",
"speed": 2.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_tqiix"]
atlas = ExtResource("3_hg6s5")
region = Rect2(0, 0, 32, 32)
@ -348,6 +423,22 @@ region = Rect2(320, 0, 32, 32)
atlas = ExtResource("5_boad6")
region = Rect2(352, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_or4qq"]
atlas = ExtResource("10_yllr7")
region = Rect2(0, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_hggc2"]
atlas = ExtResource("10_yllr7")
region = Rect2(32, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_b2j0d"]
atlas = ExtResource("10_yllr7")
region = Rect2(64, 0, 32, 32)
[sub_resource type="AtlasTexture" id="AtlasTexture_7l6ig"]
atlas = ExtResource("10_yllr7")
region = Rect2(96, 0, 32, 32)
[sub_resource type="SpriteFrames" id="SpriteFrames_mmwog"]
animations = [{
"frames": [{
@ -459,6 +550,23 @@ animations = [{
"loop": true,
"name": &"run",
"speed": 14.0
}, {
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_or4qq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hggc2")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_b2j0d")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7l6ig")
}],
"loop": true,
"name": &"walk",
"speed": 4.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_ebec5"]
@ -472,6 +580,13 @@ acceleration = 0.177
[node name="AudioListener2D" type="AudioListener2D" parent="."]
current = true
[node name="Armor" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_or4qq")
animation = &"run"
autoplay = "power_up"
[node name="Sword" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(0, -16)
@ -491,11 +606,10 @@ autoplay = "idle"
[node name="Base" type="AnimatedSprite2D" parent="."]
position = Vector2(0, -16)
sprite_frames = SubResource("SpriteFrames_mmwog")
animation = &"got_hit"
animation = &"walk"
autoplay = "idle"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
visible = false
position = Vector2(0, -13)
shape = ExtResource("5_qjkh3")
@ -507,6 +621,7 @@ wait_time = 0.5
one_shot = true
[node name="Hitbox" parent="." instance=ExtResource("11_2ieo8")]
position = Vector2(2, -1)
monitoring = false
monitorable = false
damage = 10

View File

@ -1,7 +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"]
[ext_resource type="Texture2D" uid="uid://drjrcocrm4bpw" path="res://player/assets/Tete.png" id="1_1apyp"]
[resource]
atlas = ExtResource("1_1apyp")
region = Rect2(14, 9, 6, 6)
region = Rect2(3, 4, 10, 10)

BIN
world_assets/Shine.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dm1hlmja718pi"
path="res://.godot/imported/Shine.png-9945bc49169a86dd8f20ca53bc00ddaf.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://world_assets/Shine.png"
dest_files=["res://.godot/imported/Shine.png-9945bc49169a86dd8f20ca53bc00ddaf.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1