This commit is contained in:
fatbonks
2025-10-16 05:26:03 +13:00
parent 3090991593
commit 953625fd7a
45 changed files with 1890 additions and 15 deletions

View File

@@ -0,0 +1,81 @@
class_name BattleState
extends Control
@export var enemy_list:Array[Enemy] = [null, null, null]
@export var animation_player:AnimationPlayer
@onready var enemy_label_1: Label = %EnemyLabel1
@onready var enemy_label_2: Label = %EnemyLabel2
@onready var enemy_label_3: Label = %EnemyLabel3
@onready var pos_1: Marker2D = %Pos1
@onready var pos_2: Marker2D = %Pos2
@onready var pos_3: Marker2D = %Pos3
var world:World
func start_battle(list:Array[PackedScene], enemy_name:Array[String]) -> void:
delete_all_enemies()
var i:int = 0
for enemy:PackedScene in list:
if enemy != null:
var new_enemy:Enemy = enemy.instantiate() as Enemy
if i == 0:
new_enemy.position = pos_1.global_position
enemy_label_1.text = enemy_name[0].to_upper()
elif i == 1:
new_enemy.position = pos_2.global_position
enemy_label_2.text = enemy_name[1].to_upper()
elif i == 2:
new_enemy.position = pos_3.global_position
enemy_label_3.text = enemy_name[2].to_upper()
add_child(new_enemy)
enemy_list[i] = new_enemy
i += 1
func start(current_world:World) -> void:
world = current_world
func start_animation() -> void:
animation_player.play("appear")
func command(current_command:String, input:String) -> void:
match current_command:
"FIGHT":
fight(input)
func fight(enemy_to_attack:String) -> void:
var new_input:String = enemy_to_attack.replace(" ", "")
new_input = new_input.to_upper()
if new_input == enemy_label_1.text.replace(" ", ""):
if enemy_list[0] != null:
enemy_list[0].health -= world.player.damage
if enemy_list[0].health <= 0:
enemy_list[0].queue_free()
enemy_list[0] = null
elif new_input == enemy_label_2.text.replace(" ", ""):
if enemy_list[1] != null:
enemy_list[1].health -= world.player.damage
if enemy_list[1].health <= 0:
enemy_list[1].queue_free()
enemy_list[1] = null
elif new_input == enemy_label_3.text.replace(" ", ""):
if enemy_list[2] != null:
enemy_list[2].health -= world.player.damage
if enemy_list[2].health <= 0:
enemy_list[2].queue_free()
enemy_list[2] = null
for enemy in enemy_list:
if enemy != null:
print(enemy)
return
animation_player.play("win")
await get_tree().create_timer(3).timeout
world.end_battle()
func delete_all_enemies() -> void:
for enemy in enemy_list:
if enemy != null:
enemy.queue_free()

View File

@@ -0,0 +1 @@
uid://pf5yw3mcch7m

View File

@@ -0,0 +1,242 @@
[gd_scene load_steps=8 format=4 uid="uid://cruod4lfh2xkh"]
[ext_resource type="TileSet" uid="uid://bfkalv0skoxy2" path="res://tileset.tres" id="1_3rf3u"]
[ext_resource type="Script" uid="uid://pf5yw3mcch7m" path="res://levels/battle_state/battle_state.gd" id="1_tj1v8"]
[sub_resource type="Animation" id="Animation_2rq08"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label4:visible_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Label4:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Label:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Label:visible_ratio")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
[sub_resource type="Animation" id="Animation_tj1v8"]
resource_name = "flash"
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label4:visible_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationPlayer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"flash", -1, 1.0, false],
"method": &"play"
}]
}
[sub_resource type="Animation" id="Animation_nr2j5"]
resource_name = "flash"
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label4:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Label:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
[sub_resource type="Animation" id="Animation_x0k2y"]
resource_name = "win"
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label:visible_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 1),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationPlayer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(1),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"flash", -1, 1.0, false],
"method": &"play"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_nr2j5"]
_data = {
&"RESET": SubResource("Animation_2rq08"),
&"appear": SubResource("Animation_tj1v8"),
&"flash": SubResource("Animation_nr2j5"),
&"win": SubResource("Animation_x0k2y")
}
[node name="BattleState" type="Control" node_paths=PackedStringArray("enemy_list", "animation_player")]
clip_contents = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_tj1v8")
enemy_list = [null, null, null]
animation_player = NodePath("AnimationPlayer")
metadata/_edit_use_anchors_ = true
[node name="TileMapLayer" type="TileMapLayer" parent="."]
tile_map_data = PackedByteArray("AAAAAB4AAAANAAwAAAABAB4AAAANAAwAAAACAB4AAAANAAwAAAADAB4AAAANAAwAAAAEAB4AAAANAAwAAAAFAB4AAAANAAwAAAAGAB4AAAANAAwAAAAHAB4AAAANAAwAAAAIAB4AAAANAAwAAAAJAB4AAAANAAwAAAAKAB4AAAANAAwAAAALAB4AAAANAAwAAAAMAB4AAAANAAwAAAANAB4AAAANAAwAAAAOAB4AAAANAAwAAAAPAB4AAAANAAwAAAAQAB4AAAANAAwAAAARAB4AAAANAAwAAAASAB4AAAANAAwAAAATAB4AAAANAAwAAAAUAB4AAAANAAwAAAAVAB4AAAANAAwAAAAWAB4AAAANAAwAAAAXAB4AAAANAAwAAAAYAB4AAAANAAwAAAAZAB4AAAANAAwAAAAaAB4AAAANAAwAAAAbAB4AAAANAAwAAAAcAB4AAAANAAwAAAAdAB4AAAANAAwAAAAeAB4AAAANAAwAAAAfAB4AAAANAAwAAAAgAB4AAAANAAwAAAAhAB4AAAANAAwAAAAiAB4AAAANAAwAAAAjAB4AAAANAAwAAAAkAB4AAAANAAwAAAAlAB4AAAANAAwAAAAmAB4AAAANAAwAAAAnAB4AAAANAAwAAAAoAB4AAAANAAwAAAApAB4AAAANAAwAAAAqAB4AAAANAAwAAAArAB4AAAANAAwAAAAsAB4AAAANAAwAAAAtAB4AAAANAAwAAAAuAB4AAAANAAwAAAAvAB4AAAANAAwAAAAwAB4AAAANAAwAAAAxAB4AAAANAAwAAAAyAB4AAAANAAwAAAAzAB4AAAANAAwAAAA0AB4AAAANAAwAAAA1AB4AAAANAAwAAAA2AB4AAAANAAwAAAA3AB4AAAANAAwAAAA4AB4AAAANAAwAAAA5AB4AAAANAAwAAAA6AB4AAAANAAwAAAA7AB4AAAANAAwAAAA8AB4AAAANAAwAAAA9AB4AAAANAAwAAAA+AB4AAAANAAwAAAA/AB4AAAANAAwAAABAAB4AAAANAAwAAABBAB4AAAANAAwAAABCAB4AAAANAAwAAABDAB4AAAANAAwAAABEAB4AAAANAAwAAABFAB4AAAANAAwAAABGAB4AAAANAAwAAABHAB4AAAANAAwAAABIAB4AAAANAAwAAABJAB4AAAANAAwAAABKAB4AAAANAAwAAABLAB4AAAANAAwAAABMAB4AAAANAAwAAABNAB4AAAANAAwAAABOAB4AAAANAAwAAABPAB4AAAANAAwAAABQAB4AAAANAAwAAABRAB4AAAANAAwAAABSAB4AAAANAAwAAABTAB4AAAANAAwAAABUAB4AAAANAAwAAABVAB4AAAANAAwAAABWAB4AAAANAAwAAABXAB4AAAANAAwAAABYAB4AAAANAAwAAABZAB4AAAANAAwAAABaAB4AAAANAAwAAABbAB4AAAANAAwAAABcAB4AAAANAAwAAABdAB4AAAANAAwAAABeAB4AAAANAAwAAABfAB4AAAANAAwAAAA=")
tile_set = ExtResource("1_3rf3u")
[node name="Pos3" type="Marker2D" parent="."]
unique_name_in_owner = true
position = Vector2(765, 115)
[node name="Pos2" type="Marker2D" parent="."]
unique_name_in_owner = true
position = Vector2(455, 115)
[node name="Pos1" type="Marker2D" parent="."]
unique_name_in_owner = true
position = Vector2(145, 115)
[node name="EnemyLabel2" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 0
offset_left = 455.0
offset_top = 245.0
offset_right = 495.0
offset_bottom = 261.0
text = "1"
[node name="EnemyLabel1" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 0
offset_left = 135.0
offset_top = 245.0
offset_right = 175.0
offset_bottom = 261.0
text = "0"
[node name="EnemyLabel3" type="Label" parent="."]
unique_name_in_owner = true
layout_mode = 0
offset_left = 765.0
offset_top = 245.0
offset_right = 805.0
offset_bottom = 280.0
text = "2
"
[node name="Label4" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
offset_left = 309.0
offset_top = 254.0
offset_right = 651.0
offset_bottom = 286.0
grow_horizontal = 2
grow_vertical = 2
theme_override_font_sizes/font_size = 32
text = "====== FIGHT ======"
visible_characters = 0
visible_ratio = 0.0
[node name="Label" type="Label" parent="."]
layout_mode = 1
anchors_preset = -1
offset_left = 460.0
offset_top = 262.0
offset_right = 500.0
offset_bottom = 278.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/font_color = Color(0, 1, 0, 1)
theme_override_font_sizes/font_size = 32
text = "========== YOU WON =========="
visible_characters = 0
visible_ratio = 0.0
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_nr2j5")
}

6
levels/level.gd Executable file
View File

@@ -0,0 +1,6 @@
class_name Level
extends TileMapLayer
var interactble_objects:Dictionary[Vector2, InteractableObject]

1
levels/level.gd.uid Executable file
View File

@@ -0,0 +1 @@
uid://yuo36j2yrbp

File diff suppressed because one or more lines are too long

66
levels/world/world.gd Executable file
View File

@@ -0,0 +1,66 @@
class_name World
extends Node2D
@export var line_edit:LineEdit
@export var world_ui:WorldState
@export var battle_ui:BattleState
@export var player:Player
@export var texture:ColorRect
var is_battle:bool = false
func _ready() -> void:
line_edit.grab_focus()
line_edit.caret_column = 1
world_ui.start(self)
battle_ui.start(self)
func start_battle(enemy_list:Array[PackedScene], enemy_name:Array[String]) -> void:
is_battle = true
battle_ui.start_battle(enemy_list, enemy_name)
world_ui.animation_player.play("appear")
while(world_ui.size.y > 0):
world_ui.size.y -= 10
await get_tree().create_timer(0.01).timeout
world_ui.animation_player.play("RESET")
while(battle_ui.size.y < 540.0):
if battle_ui.size.y == 270.0:
battle_ui.start_animation()
battle_ui.size.y += 10
await get_tree().create_timer(0.01).timeout
await get_tree().create_timer(2).timeout
battle_ui.animation_player.play("RESET")
battle_ui.size.y = 540.0
func end_battle() -> void:
is_battle = false
while(battle_ui.size.y > 0):
battle_ui.size.y -= 10
await get_tree().create_timer(0.05).timeout
battle_ui.animation_player.play("RESET")
while(world_ui.size.y < 540):
world_ui.size.y += 10
await get_tree().create_timer(0.05).timeout
world_ui.size.y = 540
func _on_line_edit_text_submitted(new_text: String) -> void:
line_edit.clear()
var string_command = new_text.get_slice(" ", 0)
var input:String = new_text.replace(string_command + " ", "")
if !is_battle:
world_ui.do_command(string_command, input)
elif is_battle:
battle_ui.command(string_command, input)
func _on_line_edit_text_changed(new_text: String) -> void:
var caret_pos = line_edit.caret_column
line_edit.text = new_text.to_upper()
line_edit.caret_column = caret_pos
func test():
if texture.size.y >= 613.0:
print("done")
return
texture.size.y += 10
await get_tree().create_timer(0.05).timeout
test()

1
levels/world/world.gd.uid Executable file
View File

@@ -0,0 +1 @@
uid://bu23r23kew8mf

95
levels/world/world.tscn Executable file
View File

@@ -0,0 +1,95 @@
[gd_scene load_steps=7 format=3 uid="uid://dyoi4j0q2kcsu"]
[ext_resource type="Script" uid="uid://bu23r23kew8mf" path="res://levels/world/world.gd" id="1_ng6r8"]
[ext_resource type="PackedScene" uid="uid://blbbmr2ap77jo" path="res://levels/world_state/control.tscn" id="3_8gvdk"]
[ext_resource type="PackedScene" uid="uid://ccynhcgx88bgq" path="res://objects/player/player.tscn" id="3_b8p08"]
[ext_resource type="PackedScene" uid="uid://cruod4lfh2xkh" path="res://levels/battle_state/battle_state.tscn" id="3_h0il2"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_b8p08"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0, 0, 0, 1)
border_width_bottom = 2
border_color = Color(0, 0, 0, 0.6)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
corner_detail = 5
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_8gvdk"]
content_margin_left = 4.0
content_margin_top = 4.0
content_margin_right = 4.0
content_margin_bottom = 4.0
bg_color = Color(0.6, 0.6, 0.6, 0)
draw_center = false
border_width_top = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
expand_margin_left = 49.0
expand_margin_top = 2.0
expand_margin_right = 2.0
expand_margin_bottom = 2.0
[node name="World" type="Node2D" node_paths=PackedStringArray("line_edit", "world_ui", "battle_ui", "player")]
script = ExtResource("1_ng6r8")
line_edit = NodePath("CanvasLayer/Control/LineEdit")
world_ui = NodePath("CanvasLayer/WorldState")
battle_ui = NodePath("CanvasLayer/BattleState")
player = NodePath("Player")
[node name="CanvasLayer" type="CanvasLayer" parent="."]
layer = -1
[node name="BattleState" parent="CanvasLayer" instance=ExtResource("3_h0il2")]
anchors_preset = 15
offset_bottom = -540.0
[node name="WorldState" parent="CanvasLayer" instance=ExtResource("3_8gvdk")]
[node name="Control" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="LineEdit" type="LineEdit" parent="CanvasLayer/Control"]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 11.0
offset_top = -24.0
offset_bottom = 4.0
grow_horizontal = 2
grow_vertical = 0
theme_override_colors/font_placeholder_color = Color(0.8745098, 0.8745098, 0.8745098, 0.6627451)
theme_override_styles/normal = SubResource("StyleBoxFlat_b8p08")
theme_override_styles/focus = SubResource("StyleBoxFlat_8gvdk")
keep_editing_on_text_submit = true
context_menu_enabled = false
emoji_menu_enabled = false
caret_blink = true
[node name="Label" type="Label" parent="CanvasLayer/Control"]
layout_mode = 0
offset_left = 4.0
offset_top = 522.0
offset_right = 44.0
offset_bottom = 538.0
text = ">"
[node name="Player" parent="." instance=ExtResource("3_b8p08")]
position = Vector2(235, 175)
damage = 5
[connection signal="text_changed" from="CanvasLayer/Control/LineEdit" to="." method="_on_line_edit_text_changed"]
[connection signal="text_submitted" from="CanvasLayer/Control/LineEdit" to="." method="_on_line_edit_text_submitted"]

93
levels/world_state/control.gd Executable file
View File

@@ -0,0 +1,93 @@
class_name WorldState
extends Control
@export var animation_player:AnimationPlayer
@export var tilemap:Level
@export var item_list:ItemList
@export var stats_label:Label
@export var stats_ui:Control
@export var array:Array[Array] = [
["A1", "A2", "A3"],
["B1", "B2", "B3"],
["C1", "C2", "C3"],
[]
]
var world:World
var current_cords:Vector2 = Vector2(0, 0)
func do_command(command:String, input:String) -> void:
match command:
"WALK":
move(input)
"TALK":
pass
"INVENTORY":
pass
"BATTLE":
battle(input)
func start(current_world:World) -> void:
world = current_world
world.player.stats_changed.connect(update_stats)
update_stats()
func battle(input:String) -> void:
match input:
"UP":
interactable_obj_exists(world.player.global_position + Vector2(0, -10))
"DOWN":
interactable_obj_exists(world.player.global_position + Vector2(0, 10))
"LEFT":
interactable_obj_exists(world.player.global_position + Vector2(-10, 0))
"RIGHT":
interactable_obj_exists(world.player.global_position + Vector2(10, 0))
func move(input:String) -> void:
match input:
"UP":
if is_walkable(Vector2(0, -10)):
world.player.global_position.y -= 10
"DOWN":
if is_walkable(Vector2(0, 10)):
world.player.global_position.y += 10
"LEFT":
if is_walkable(Vector2(-10, 0)):
world.player.global_position.x -= 10
"RIGHT":
if is_walkable(Vector2(10, 0)):
world.player.global_position.x += 10
func is_walkable(direction:Vector2) -> bool:
var clicked_cell:Vector2i = tilemap.local_to_map(world.player.global_position + direction)
var cell:TileData = tilemap.get_cell_tile_data(clicked_cell)
if cell:
return cell.get_custom_data("walkable")
return false
func interactable_obj_exists(pos:Vector2) -> void:
if tilemap.interactble_objects.has(pos):
tilemap.interactble_objects[pos].use_object(world)
tilemap.interactble_objects[pos].queue_free()
tilemap.interactble_objects.erase(pos)
func _on_item_list_item_selected(index: int) -> void:
world.line_edit.text = item_list.get_item_text(index).to_upper()
world.line_edit.caret_column = 30
item_list.deselect(index)
item_list.release_focus()
world.line_edit.grab_focus()
func update_stats():
while(stats_ui.size.y > 0):
stats_ui.size.y -= 10
await get_tree().create_timer(0.1).timeout
var stats:String = "Health: " + str(world.player.health) \
+ "\nDamage: " + str(world.player.damage) \
+ "\nSpeed: " + str(world.player.speed)
stats_label.text = stats
while(stats_ui.size.y < 224.0):
stats_ui.size.y += 10
await get_tree().create_timer(0.1).timeout

View File

@@ -0,0 +1 @@
uid://is3twd5fw4ay

176
levels/world_state/control.tscn Executable file
View File

@@ -0,0 +1,176 @@
[gd_scene load_steps=8 format=4 uid="uid://blbbmr2ap77jo"]
[ext_resource type="Script" uid="uid://is3twd5fw4ay" path="res://levels/world_state/control.gd" id="1_0fbet"]
[ext_resource type="PackedScene" uid="uid://bsnyy55qb2pyr" path="res://levels/template/level_template.tscn" id="2_gcbra"]
[ext_resource type="TileSet" uid="uid://bfkalv0skoxy2" path="res://tileset.tres" id="2_qtu10"]
[sub_resource type="Animation" id="Animation_ee4bf"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label:visible_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Label:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
[sub_resource type="Animation" id="Animation_qtu10"]
resource_name = "new_animation"
length = 0.5
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label:visible_ratio")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
tracks/1/type = "method"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("AnimationPlayer")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0.5),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [&"flash", -1, 1.0, false],
"method": &"play"
}]
}
[sub_resource type="Animation" id="Animation_uch48"]
resource_name = "flash"
loop_mode = 1
step = 0.1
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Label:visible")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.4, 1),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [true, false, true]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kbped"]
_data = {
&"RESET": SubResource("Animation_ee4bf"),
&"appear": SubResource("Animation_qtu10"),
&"flash": SubResource("Animation_uch48")
}
[node name="WorldState" type="Control" node_paths=PackedStringArray("animation_player", "tilemap", "item_list", "stats_label", "stats_ui")]
clip_contents = true
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_0fbet")
animation_player = NodePath("AnimationPlayer")
tilemap = NodePath("LevelTemplate")
item_list = NodePath("Commands/ItemList")
stats_label = NodePath("Stats/StatsLabel")
stats_ui = NodePath("Stats")
[node name="LevelTemplate" parent="." instance=ExtResource("2_gcbra")]
[node name="UI" type="TileMapLayer" parent="."]
texture_filter = 1
tile_map_data = PackedByteArray("AAAAACgAAAANAAwAAAABACgAAAANAAwAAAACACgAAAANAAwAAAADACgAAAANAAwAAAAEACgAAAANAAwAAAAFACgAAAANAAwAAAAGACgAAAANAAwAAAAHACgAAAANAAwAAAAIACgAAAANAAwAAAAJACgAAAANAAwAAAAKACgAAAANAAwAAAALACgAAAANAAwAAAAMACgAAAANAAwAAAANACgAAAANAAwAAAAOACgAAAANAAwAAAAPACgAAAANAAwAAAAQACgAAAANAAwAAAARACgAAAANAAwAAAASACgAAAANAAwAAAATACgAAAANAAwAAAAUACgAAAANAAwAAAAVACgAAAANAAwAAAAWACgAAAANAAwAAAAXACgAAAANAAwAAAAYACgAAAANAAwAAAAZACgAAAANAAwAAAAaACgAAAANAAwAAAAbACgAAAANAAwAAAAcACgAAAANAAwAAAAdACgAAAANAAwAAAAeACgAAAANAAwAAAAfACgAAAANAAwAAAAgACgAAAANAAwAAAAhACgAAAANAAwAAAAiACgAAAANAAwAAAAjACgAAAANAAwAAAAkACgAAAANAAwAAAAlACgAAAANAAwAAAAmACgAAAANAAwAAAAnACgAAAANAAwAAAAoACgAAAANAAwAAAApACgAAAANAAwAAAAqACgAAAANAAwAAAArACgAAAANAAwAAAAsACgAAAANAAwAAAAtACgAAAANAAwAAAAuACgAAAANAAwAAAAvACgAAAANAAwAAAAwACgAAAANAAwAAAAxACgAAAANAAwAAAAyACgAAAANAAwAAAAzACgAAAANAAwAAAA0ACgAAAANAAwAAAA1ACgAAAANAAwAAAA2ACgAAAANAAwAAAA3ACgAAAANAAwAAAA4ACgAAAANAAwAAAA5ACgAAAANAAwAAAA6ACgAAAANAAwAAAA7ACgAAAANAAwAAAA8ACgAAAANAAwAAAA9ACgAAAANAAwAAAA+ACgAAAANAAwAAAA/ACgAAAANAAwAAABAACgAAAANAAwAAABBACgAAAANAAwAAABCACgAAAANAAwAAABDACgAAAANAAwAAABEACgAAAANAAwAAABFACgAAAAJAAsAAABFACcAAAAKAAsAAABFACYAAAAKAAsAAABFACUAAAAKAAsAAABFACQAAAAKAAsAAABFACMAAAAKAAsAAABFACIAAAAKAAsAAABFACEAAAAKAAsAAABFACAAAAAKAAsAAABFAB8AAAAKAAsAAABFAB4AAAAKAAsAAABFAB0AAAAKAAsAAABFABwAAAAKAAsAAABFABsAAAAKAAsAAABFABoAAAAKAAsAAABFABkAAAAKAAsAAABFABgAAAAKAAsAAABFABcAAAAKAAsAAABFABYAAAAKAAsAAABFABUAAAAKAAsAAABFABQAAAAKAAsAAABFABMAAAAKAAsAAABFABIAAAAKAAsAAABFABEAAAAKAAsAAABFABAAAAAKAAsAAABFAA8AAAAKAAsAAABFAA4AAAAKAAsAAABFAA0AAAAKAAsAAABFAAwAAAAKAAsAAABFAAsAAAAKAAsAAABFAAoAAAAKAAsAAABFAAkAAAAKAAsAAABFAAgAAAAKAAsAAABFAAcAAAAKAAsAAABFAAYAAAAKAAsAAABFAAUAAAAKAAsAAABFAAQAAAAKAAsAAABFAAMAAAAKAAsAAABFAAIAAAAKAAsAAABFAAEAAAAKAAsAAABFAAAAAAAKAAsAAABFACkAAAAKAAsAAABFACoAAAAKAAsAAABFACsAAAAKAAsAAABFACwAAAAKAAsAAABFAC0AAAAKAAsAAABFAC4AAAAKAAsAAABFAC8AAAAKAAsAAABFADAAAAAKAAsAAABFADEAAAAKAAsAAABFADIAAAAKAAsAAABFADMAAAAKAAsAAABFADQAAAAKAAsAAABFADUAAAAKAAsAAAANACkAAAADAAsAAAANACoAAAADAAsAAAANACsAAAADAAsAAAANACwAAAADAAsAAAANAC0AAAADAAsAAAANAC4AAAADAAsAAAANAC8AAAADAAsAAAANADAAAAADAAsAAAANADEAAAADAAsAAAANADIAAAADAAsAAAANADMAAAADAAsAAAANADQAAAADAAsAAAANADUAAAADAAsAAAA=")
tile_set = ExtResource("2_qtu10")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_kbped")
}
[node name="ColorRect3" type="ColorRect" parent="."]
layout_mode = 1
anchors_preset = 10
anchor_right = 1.0
grow_horizontal = 2
color = Color(0, 0, 0, 1)
[node name="Label" type="Label" parent="."]
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -243.0
offset_right = 243.0
offset_bottom = 48.0
grow_horizontal = 2
theme_override_colors/font_color = Color(1, 0, 0, 1)
theme_override_font_sizes/font_size = 48
text = "===== DANGER ====="
visible_characters = 0
visible_ratio = 0.0
[node name="Commands" type="Control" parent="."]
layout_mode = 1
anchors_preset = 0
offset_top = 408.0
offset_right = 134.0
offset_bottom = 540.0
metadata/_edit_group_ = true
[node name="ItemList" type="ItemList" parent="Commands"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_colors/guide_color = Color(0.69803923, 0.69803923, 0.69803923, 1)
item_count = 4
item_0/text = "WALK UP"
item_1/text = "WALK DOWN"
item_2/text = "WALK RIGHT"
item_3/text = "WALK LEFT"
[node name="Stats" type="Control" parent="."]
clip_contents = true
anchors_preset = 0
offset_left = 138.0
offset_top = 409.0
offset_right = 251.0
offset_bottom = 540.0
pivot_offset = Vector2(0, 30)
metadata/_edit_group_ = true
[node name="StatsLabel" type="Label" parent="Stats"]
layout_mode = 1
offset_right = 117.0
offset_bottom = 131.0
autowrap_mode = 1
[connection signal="item_selected" from="Commands/ItemList" to="." method="_on_item_list_item_selected"]