فهرست منبع

:sparkles: added a basic intro

Felix Bytow 10 ماه پیش
والد
کامیت
32470535f9

+ 21 - 0
assets/scenes/intro.gd

@@ -0,0 +1,21 @@
+extends Node2D
+class_name Intro
+
+signal finished
+
+@onready var sprite: AnimatedSprite2D = $AnimatedSprite2D
+
+func _process(_delta: float) -> void:
+	if Input.is_action_just_pressed("ui_cancel"):
+		done()
+
+func _on_animation_finished():
+	done()
+
+func start() -> void:
+	sprite.play("default")
+
+func done() -> void:
+	Config.show_tutorial = false
+	Config.save()
+	finished.emit()

+ 70 - 0
assets/scenes/intro.tscn

@@ -0,0 +1,70 @@
+[gd_scene load_steps=15 format=3 uid="uid://dh572lst5hqr4"]
+
+[ext_resource type="Script" path="res://assets/scenes/intro.gd" id="1_f6nbx"]
+[ext_resource type="Texture2D" uid="uid://d1886uim354cb" path="res://assets/textures/intro/story_1.jpg" id="1_lvypd"]
+[ext_resource type="Texture2D" uid="uid://dkili3ejblmto" path="res://assets/textures/intro/story_2.jpg" id="2_omvjn"]
+[ext_resource type="Texture2D" uid="uid://b26jupgg2q5th" path="res://assets/textures/intro/story_3.jpg" id="3_ndro8"]
+[ext_resource type="Texture2D" uid="uid://cis4f03un6mf4" path="res://assets/textures/intro/story_4.jpg" id="4_p8mqt"]
+[ext_resource type="Texture2D" uid="uid://dnq06j5dvwux6" path="res://assets/textures/intro/story_5.jpg" id="5_socyx"]
+[ext_resource type="Texture2D" uid="uid://dt2euiru28ylj" path="res://assets/textures/intro/story_6.jpg" id="6_qp0i4"]
+[ext_resource type="Texture2D" uid="uid://cwfcl6f6xmgfg" path="res://assets/textures/intro/story_7.jpg" id="7_g463u"]
+[ext_resource type="Texture2D" uid="uid://b2qmkvu7eovwy" path="res://assets/textures/intro/story_8.jpg" id="8_jllap"]
+[ext_resource type="Texture2D" uid="uid://bjgvyhfvqx6ju" path="res://assets/textures/intro/story_9.jpg" id="9_a3y3o"]
+[ext_resource type="Texture2D" uid="uid://c08y6d5jmb0m1" path="res://assets/textures/intro/story_10.jpg" id="10_ctola"]
+[ext_resource type="Texture2D" uid="uid://ckd2q863dj2ge" path="res://assets/textures/intro/story_11.jpg" id="11_8cus1"]
+[ext_resource type="Texture2D" uid="uid://bvpmd6d7oqf12" path="res://assets/textures/intro/story_12.jpg" id="12_e6jqo"]
+
+[sub_resource type="SpriteFrames" id="SpriteFrames_xnc3f"]
+animations = [{
+"frames": [{
+"duration": 1.0,
+"texture": ExtResource("1_lvypd")
+}, {
+"duration": 1.0,
+"texture": ExtResource("2_omvjn")
+}, {
+"duration": 1.0,
+"texture": ExtResource("3_ndro8")
+}, {
+"duration": 1.5,
+"texture": ExtResource("4_p8mqt")
+}, {
+"duration": 1.0,
+"texture": ExtResource("5_socyx")
+}, {
+"duration": 2.5,
+"texture": ExtResource("6_qp0i4")
+}, {
+"duration": 2.0,
+"texture": ExtResource("7_g463u")
+}, {
+"duration": 1.0,
+"texture": ExtResource("8_jllap")
+}, {
+"duration": 2.5,
+"texture": ExtResource("9_a3y3o")
+}, {
+"duration": 1.0,
+"texture": ExtResource("10_ctola")
+}, {
+"duration": 1.0,
+"texture": ExtResource("11_8cus1")
+}, {
+"duration": 1.5,
+"texture": ExtResource("12_e6jqo")
+}],
+"loop": false,
+"name": &"default",
+"speed": 0.7
+}]
+
+[node name="Intro" type="Node2D"]
+z_index = 3000
+script = ExtResource("1_f6nbx")
+
+[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
+position = Vector2(640, 360)
+scale = Vector2(0.5, 0.5)
+sprite_frames = SubResource("SpriteFrames_xnc3f")
+
+[connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animation_finished"]

BIN
assets/textures/intro/story_1.jpg


+ 34 - 0
assets/textures/intro/story_1.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://d1886uim354cb"
+path="res://.godot/imported/story_1.jpg-44a117dfe165c8cc898bbf6755083b94.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_1.jpg"
+dest_files=["res://.godot/imported/story_1.jpg-44a117dfe165c8cc898bbf6755083b94.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
assets/textures/intro/story_10.jpg


+ 34 - 0
assets/textures/intro/story_10.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://c08y6d5jmb0m1"
+path="res://.godot/imported/story_10.jpg-e21f76e9f3e7876d761b679d2111adb2.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_10.jpg"
+dest_files=["res://.godot/imported/story_10.jpg-e21f76e9f3e7876d761b679d2111adb2.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
assets/textures/intro/story_11.jpg


+ 34 - 0
assets/textures/intro/story_11.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://ckd2q863dj2ge"
+path="res://.godot/imported/story_11.jpg-2e8d831e0e6582f09f976f843c7eb759.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_11.jpg"
+dest_files=["res://.godot/imported/story_11.jpg-2e8d831e0e6582f09f976f843c7eb759.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
assets/textures/intro/story_12.jpg


+ 34 - 0
assets/textures/intro/story_12.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bvpmd6d7oqf12"
+path="res://.godot/imported/story_12.jpg-4ba07f95c373f2db7603bbda923f5d6e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_12.jpg"
+dest_files=["res://.godot/imported/story_12.jpg-4ba07f95c373f2db7603bbda923f5d6e.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
assets/textures/intro/story_2.jpg


+ 34 - 0
assets/textures/intro/story_2.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dkili3ejblmto"
+path="res://.godot/imported/story_2.jpg-7873bdb75828cb977bca371602b5180d.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_2.jpg"
+dest_files=["res://.godot/imported/story_2.jpg-7873bdb75828cb977bca371602b5180d.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
assets/textures/intro/story_3.jpg


+ 34 - 0
assets/textures/intro/story_3.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b26jupgg2q5th"
+path="res://.godot/imported/story_3.jpg-b90577aaff8a701f021847ffef16ccb6.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_3.jpg"
+dest_files=["res://.godot/imported/story_3.jpg-b90577aaff8a701f021847ffef16ccb6.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
assets/textures/intro/story_4.jpg


+ 34 - 0
assets/textures/intro/story_4.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cis4f03un6mf4"
+path="res://.godot/imported/story_4.jpg-e080529c5648ab3eb775d73881292d22.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_4.jpg"
+dest_files=["res://.godot/imported/story_4.jpg-e080529c5648ab3eb775d73881292d22.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
assets/textures/intro/story_5.jpg


+ 34 - 0
assets/textures/intro/story_5.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dnq06j5dvwux6"
+path="res://.godot/imported/story_5.jpg-6c00c2943f81dd6372b08b05b490af38.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_5.jpg"
+dest_files=["res://.godot/imported/story_5.jpg-6c00c2943f81dd6372b08b05b490af38.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
assets/textures/intro/story_6.jpg


+ 34 - 0
assets/textures/intro/story_6.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://dt2euiru28ylj"
+path="res://.godot/imported/story_6.jpg-47466a2811ee48383348ca5c6577e96e.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_6.jpg"
+dest_files=["res://.godot/imported/story_6.jpg-47466a2811ee48383348ca5c6577e96e.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
assets/textures/intro/story_7.jpg


+ 34 - 0
assets/textures/intro/story_7.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://cwfcl6f6xmgfg"
+path="res://.godot/imported/story_7.jpg-d7c7124a5ddd4dbf33b842d4375553ff.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_7.jpg"
+dest_files=["res://.godot/imported/story_7.jpg-d7c7124a5ddd4dbf33b842d4375553ff.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
assets/textures/intro/story_8.jpg


+ 34 - 0
assets/textures/intro/story_8.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://b2qmkvu7eovwy"
+path="res://.godot/imported/story_8.jpg-334bb7da4278465b302d0c01504b46b6.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_8.jpg"
+dest_files=["res://.godot/imported/story_8.jpg-334bb7da4278465b302d0c01504b46b6.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
assets/textures/intro/story_9.jpg


+ 34 - 0
assets/textures/intro/story_9.jpg.import

@@ -0,0 +1,34 @@
+[remap]
+
+importer="texture"
+type="CompressedTexture2D"
+uid="uid://bjgvyhfvqx6ju"
+path="res://.godot/imported/story_9.jpg-a066c34f45301a0f0464ecf3bbf61ccb.ctex"
+metadata={
+"vram_texture": false
+}
+
+[deps]
+
+source_file="res://assets/textures/intro/story_9.jpg"
+dest_files=["res://.godot/imported/story_9.jpg-a066c34f45301a0f0464ecf3bbf61ccb.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

+ 16 - 0
screens/game.gd

@@ -17,6 +17,7 @@ class_name Game
 @onready var bot_scene: PackedScene = load("res://assets/scenes/bot.tscn")
 @onready var game_over_scene: PackedScene = load("res://assets/scenes/game_over.tscn")
 @onready var victory_scene: PackedScene = load("res://assets/scenes/victory.tscn")
+@onready var intro_scene: PackedScene = load("res://assets/scenes/intro.tscn")
 
 @onready var left_enemy_label: Label = $UI/Root/LeftEnemyLabel
 @onready var right_enemy_label: Label = $UI/Root/RightEnemyLabel
@@ -84,8 +85,23 @@ func _ready() -> void:
 	overlay.visible = true
 	start_setup()
 	player_spawn.add_survivor()
+	
+	var intro: Intro = null
+	if Config.show_tutorial:
+		intro = intro_scene.instantiate()
+		add_child(intro)
+		ui_root.visible = false
+		
 	transition.slide_out()
 	await transition.game_fully_visible
+	
+	if intro != null:
+		intro.start()
+		await intro.finished
+		await transition.transition("WAVE 1", func ():
+			ui_root.visible = true
+			intro.queue_free()
+		)
 
 func _process(_delta: float) -> void:
 	if Input.is_action_pressed("ui_cancel"):