From 0e93d0d4e62297f37fc219efdb7bcbdbeb5c49d2 Mon Sep 17 00:00:00 2001 From: Harmony Honey Date: Mon, 27 Feb 2023 18:49:03 -0500 Subject: [PATCH] Chat.tscn, Arrow cleanup! Shared.is_debug & SaveDict fix FlowerPetals hair and hat, Player/NPC Cleanup! (= --- project.godot | 10 +-- src/actor/Chat.tscn | 63 +++++++++++++++++ src/actor/Mirror.tscn | 16 +---- src/actor/NPC.tscn | 93 ++------------------------ src/actor/Player.gd | 62 ++++++----------- src/actor/Player.tscn | 8 +-- src/actor/door/Arrow.gd | 25 ++++++- src/actor/door/Arrow.tscn | 2 +- src/actor/door/DoorBig.tscn | 18 ++--- src/actor/door/DoorSpawn.tscn | 18 +---- src/actor/hair/front/FlowerPetals.tscn | 12 ++++ src/actor/hat/FlowerPetals.tscn | 12 ++++ src/autoload/Shared.gd | 30 +++++---- src/autoload/Shared.tscn | 1 + src/map/worlds/3/0_hub.tscn | 15 ++++- src/menu/AttractMode.gd | 4 -- src/menu/MenuBoot.gd | 2 + 17 files changed, 193 insertions(+), 198 deletions(-) create mode 100644 src/actor/Chat.tscn create mode 100644 src/actor/hair/front/FlowerPetals.tscn create mode 100644 src/actor/hat/FlowerPetals.tscn diff --git a/project.godot b/project.godot index 035e72b..1be8ce3 100644 --- a/project.godot +++ b/project.godot @@ -346,16 +346,16 @@ debug_makeover={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777235,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } -debug_home={ -"deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777229,"physical_scancode":0,"unicode":0,"echo":false,"script":null) - ] -} debug_screenshot={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777224,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } +debug_warp={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777236,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [layer_names] diff --git a/src/actor/Chat.tscn b/src/actor/Chat.tscn new file mode 100644 index 0000000..5b86a65 --- /dev/null +++ b/src/actor/Chat.tscn @@ -0,0 +1,63 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://media/image/white_square_100x.png" type="Texture" id=1] +[ext_resource path="res://src/autoload/Chat.gd" type="Script" id=2] +[ext_resource path="res://media/font/mini-wakuwaku.otf" type="DynamicFontData" id=3] +[ext_resource path="res://src/actor/shape/Rectangle.gd" type="Script" id=4] + +[sub_resource type="DynamicFont" id=3] +size = 40 +outline_color = Color( 0, 0, 0, 1 ) +use_filter = true +font_data = ExtResource( 3 ) + +[node name="Chat" type="Node2D"] +modulate = Color( 1, 1, 1, 0 ) +z_index = 71 +z_as_relative = false +script = ExtResource( 2 ) + +[node name="Bubble" type="Node2D" parent="."] + +[node name="Triangle" type="Polygon2D" parent="Bubble"] +position = Vector2( 0, 37.5 ) +scale = Vector2( 1e-05, 1e-05 ) +polygon = PoolVector2Array( -21.5, 0, 21.5, 0, 0, 40 ) + +[node name="Rect" type="Polygon2D" parent="Bubble"] +texture = ExtResource( 1 ) +texture_offset = Vector2( 0, 50 ) +texture_scale = Vector2( 0, 1 ) +polygon = PoolVector2Array( 260, 0.0999985, 259.062, 8.42228, 256.296, 16.3273, 251.84, 23.4185, 245.919, 29.3405, 238.827, 33.7962, 230.922, 36.5623, 222.6, 37.5, -222.6, 37.5, -230.922, 36.5623, -238.827, 33.7962, -245.919, 29.3405, -251.84, 23.4185, -256.296, 16.3273, -259.062, 8.42228, -260, 0.0999952, -260, -0.100002, -259.062, -8.42228, -256.296, -16.3273, -251.841, -23.4185, -245.919, -29.3405, -238.827, -33.7962, -230.922, -36.5623, -222.6, -37.5, 222.6, -37.5, 230.922, -36.5623, 238.827, -33.7962, 245.919, -29.3405, 251.84, -23.4185, 256.296, -16.3273, 259.062, -8.42228, 260, -0.0999919 ) +script = ExtResource( 4 ) +is_baked = false +size = Vector2( 260, 37.5 ) +radius = Plane( -2, -1, -1, -1 ) + +[node name="Center" type="CenterContainer" parent="Bubble"] +margin_right = 40.0 +margin_bottom = 40.0 +use_top_left = true + +[node name="Back" type="Label" parent="Bubble/Center"] +modulate = Color( 1, 1, 1, 0 ) +margin_left = -240.0 +margin_top = -21.0 +margin_right = 240.0 +margin_bottom = 20.0 +custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = SubResource( 3 ) +text = "I do adore the flowers" +align = 1 +valign = 2 + +[node name="Label" type="Label" parent="Bubble/Center"] +margin_left = -240.0 +margin_top = -21.0 +margin_right = 240.0 +margin_bottom = 20.0 +custom_colors/font_color = Color( 0, 0, 0, 1 ) +custom_fonts/font = SubResource( 3 ) +text = "I do adore the flowers" +align = 1 +valign = 2 diff --git a/src/actor/Mirror.tscn b/src/actor/Mirror.tscn index 35eba42..95e41d9 100644 --- a/src/actor/Mirror.tscn +++ b/src/actor/Mirror.tscn @@ -1,14 +1,10 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://src/actor/Mirror.gd" type="Script" id=1] [ext_resource path="res://src/actor/door/Arrow.tscn" type="PackedScene" id=2] [ext_resource path="res://src/shader/sky_screen.gdshader" type="Shader" id=3] [ext_resource path="res://src/actor/shape/Rectangle.gd" type="Script" id=4] -[sub_resource type="RectangleShape2D" id=1] -resource_local_to_scene = true -extents = Vector2( 75, 100 ) - [sub_resource type="ShaderMaterial" id=5] shader = ExtResource( 3 ) shader_param/col1 = Color( 0, 0.380392, 1, 1 ) @@ -31,12 +27,8 @@ offset = Vector2( 70, 0 ) hide_distance = 100.0 [node name="Arrow" parent="." instance=ExtResource( 2 )] - -[node name="CollisionShape2D" parent="Arrow/Area2D" index="0"] -shape = SubResource( 1 ) - -[node name="Image" parent="Arrow" index="1"] -position = Vector2( 0, -170 ) +col_size = Vector2( 75, 100 ) +image_pos = Vector2( 0, -170 ) [node name="Back" type="Polygon2D" parent="."] material = SubResource( 5 ) @@ -111,5 +103,3 @@ script = ExtResource( 4 ) size = Vector2( 1000, 1000 ) [connection signal="open" from="Arrow" to="." method="_on_Arrow_open"] - -[editable path="Arrow"] diff --git a/src/actor/NPC.tscn b/src/actor/NPC.tscn index 87375e4..b042588 100644 --- a/src/actor/NPC.tscn +++ b/src/actor/NPC.tscn @@ -1,98 +1,19 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://src/actor/Player.tscn" type="PackedScene" id=1] -[ext_resource path="res://media/font/mini-wakuwaku.otf" type="DynamicFontData" id=2] -[ext_resource path="res://src/autoload/Chat.gd" type="Script" id=3] +[ext_resource path="res://src/actor/Chat.tscn" type="PackedScene" id=2] [ext_resource path="res://src/actor/door/Arrow.tscn" type="PackedScene" id=4] -[ext_resource path="res://src/actor/shape/Rectangle.gd" type="Script" id=5] -[ext_resource path="res://media/image/white_square_100x.png" type="Texture" id=7] - -[sub_resource type="RectangleShape2D" id=4] -resource_local_to_scene = true -extents = Vector2( 150, 50 ) - -[sub_resource type="DynamicFont" id=3] -size = 40 -outline_color = Color( 0, 0, 0, 1 ) -use_filter = true -font_data = ExtResource( 2 ) [node name="NPC" instance=ExtResource( 1 )] -is_input = false -is_cam = false -is_npc = true idle_anim = "idle2" - -[node name="Areas" parent="." index="2"] -visible = false +is_npc = true [node name="Arrow" parent="Sprites" index="3" instance=ExtResource( 4 )] +col_size = Vector2( 150, 50 ) +col_pos = Vector2( 0, -35 ) +image_pos = Vector2( 0, -120 ) -[node name="Area2D" parent="Sprites/Arrow" index="0"] -visible = true - -[node name="CollisionShape2D" parent="Sprites/Arrow/Area2D" index="0"] -visible = false -shape = SubResource( 4 ) - -[node name="Image" parent="Sprites/Arrow" index="1"] +[node name="Chat" parent="Sprites" index="4" instance=ExtResource( 2 )] position = Vector2( 0, -120 ) -[node name="Chat" type="Node2D" parent="Sprites" index="4"] -modulate = Color( 1, 1, 1, 0 ) -position = Vector2( 0, -120 ) -z_index = 71 -z_as_relative = false -script = ExtResource( 3 ) -is_editor = true - -[node name="Bubble" type="Node2D" parent="Sprites/Chat" index="0"] - -[node name="Triangle" type="Polygon2D" parent="Sprites/Chat/Bubble" index="0"] -position = Vector2( 0, 37.5 ) -scale = Vector2( 1e-05, 1e-05 ) -polygon = PoolVector2Array( -21.5, 0, 21.5, 0, 0, 40 ) - -[node name="Rect" type="Polygon2D" parent="Sprites/Chat/Bubble" index="1"] -texture = ExtResource( 7 ) -texture_offset = Vector2( 0, 50 ) -texture_scale = Vector2( 0, 1 ) -polygon = PoolVector2Array( 260, 0.0999985, 259.062, 8.42228, 256.296, 16.3273, 251.84, 23.4185, 245.919, 29.3405, 238.827, 33.7962, 230.922, 36.5623, 222.6, 37.5, -222.6, 37.5, -230.922, 36.5623, -238.827, 33.7962, -245.919, 29.3405, -251.84, 23.4185, -256.296, 16.3273, -259.062, 8.42228, -260, 0.0999952, -260, -0.100002, -259.062, -8.42228, -256.296, -16.3273, -251.841, -23.4185, -245.919, -29.3405, -238.827, -33.7962, -230.922, -36.5623, -222.6, -37.5, 222.6, -37.5, 230.922, -36.5623, 238.827, -33.7962, 245.919, -29.3405, 251.84, -23.4185, 256.296, -16.3273, 259.062, -8.42228, 260, -0.0999919 ) -script = ExtResource( 5 ) -is_baked = false -size = Vector2( 260, 37.5 ) -radius = Plane( -2, -1, -1, -1 ) - -[node name="Center" type="CenterContainer" parent="Sprites/Chat/Bubble" index="2"] -margin_right = 40.0 -margin_bottom = 40.0 -use_top_left = true - -[node name="Back" type="Label" parent="Sprites/Chat/Bubble/Center" index="0"] -modulate = Color( 1, 1, 1, 0 ) -margin_left = -240.0 -margin_top = -21.0 -margin_right = 240.0 -margin_bottom = 20.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 3 ) -text = "I do adore the flowers" -align = 1 -valign = 2 -percent_visible = 1.27778 - -[node name="Label" type="Label" parent="Sprites/Chat/Bubble/Center" index="1"] -margin_left = -240.0 -margin_top = -21.0 -margin_right = 240.0 -margin_bottom = 20.0 -custom_colors/font_color = Color( 0, 0, 0, 1 ) -custom_fonts/font = SubResource( 3 ) -text = "I do adore the flowers" -align = 1 -valign = 2 -percent_visible = 1.22222 - [connection signal="turn" from="." to="Sprites/Arrow" method="turn"] - -[editable path="Sprites/Arrow"] diff --git a/src/actor/Player.gd b/src/actor/Player.gd index c144ae5..fc2d69e 100644 --- a/src/actor/Player.gd +++ b/src/actor/Player.gd @@ -21,7 +21,7 @@ onready var spr_hands := [spr_hand_l, spr_hand_r] export var dir := 0 setget set_dir signal turn signal turn_cam -export var is_input := true +export var is_input := false var joy := Vector2.ZERO var joy_last := Vector2.ZERO var joy_q := Vector2.ZERO @@ -35,9 +35,6 @@ var jump_buffer := 0.3 var btn_push := false var btnp_push := false -export var is_cam := true -export var is_npc := false - var is_move := true var is_walk := true var is_floor := false @@ -49,8 +46,8 @@ var idle_dir := "idle" export var idle_anim := "idle" var walk_speed := 350.0 -var floor_accel := 12 -var air_accel := 7 +var floor_accel := 12.0 +var air_accel := 7.0 var is_jump := false var has_jumped := true @@ -124,9 +121,11 @@ var blink_clock := 0.0 var blink_time := 10.0 var blink_range := Vector2(1, 20) +export var is_npc := false export (Array, String, MULTILINE) var lines := ["Lovely day!", "I do adore the flowers", "Haven't seen you before (:"] setget set_lines export (String, MULTILINE) var queue_write := "" setget set_queue_write onready var chat := get_node_or_null("Sprites/Chat") +onready var arrow := get_node_or_null("Sprites/Arrow") export var chat_offset := Vector2(0, -120) setget set_chat_offset func _enter_tree(): @@ -175,15 +174,15 @@ func scene(): velocity = Vector2.ZERO joy_last = Vector2.ZERO joy = Vector2.ZERO + is_floor = false is_jump = true is_dead = false sprites.position = Vector2.ZERO # snap to floor - var test = rot(Vector2.DOWN * 150) - if test_move(transform, test): - move_and_collide(test) - is_floor = true + var v = Vector2.DOWN * 150 + if test_move(transform, rot(v)): + move(v) anim.play(idle_dir) else: anim.play("jump") @@ -567,42 +566,27 @@ func set_dye(arg := dye): func set_hair_back(arg := hairstyle_back): hairstyle_back = posmod(arg, hair_backs.size()) - - if hair_back: - for i in hair_back.get_children(): - i.queue_free() - - if hairstyle_back > 0: - var h = load(hair_backs[hairstyle_back]).instance() - hair_back.add_child(h) - for i in h.get_children(): - connect("scale_x", i, "scale_x") + hairdo(hair_back, hair_backs, hairstyle_back) func set_hair_front(arg := hairstyle_front): hairstyle_front = posmod(arg, hair_fronts.size()) - - if hair_front: - for i in hair_front.get_children(): + hairdo(hair_front, hair_fronts, hairstyle_front) + +func hairdo(node, array, style): + if node: + for i in node.get_children(): i.queue_free() - if hairstyle_front > 0: - var h = load(hair_fronts[hairstyle_front]).instance() - hair_front.add_child(h) + if style > 0: + var h = load(array[style]).instance() + node.add_child(h) for i in h.get_children(): - connect("scale_x", i, "scale_x") + if i.has_method("scale_x"): + connect("scale_x", i, "scale_x") func set_hat(arg := hat): hat = posmod(arg, hats.size()) - - if hat_node: - for i in hat_node.get_children(): - i.queue_free() - - if hat > 0: - var h = load(hats[hat]).instance() - hat_node.add_child(h) -# for i in h.get_children(): -# connect("scale_x", i, "scale_x") + hairdo(hat_node, hats, hat) func set_queue_write(arg := queue_write): queue_write = arg @@ -614,10 +598,8 @@ func set_lines(arg := lines): func set_chat_offset(arg := chat_offset): chat_offset = arg - print(chat_offset) if chat: chat.position = chat_offset - var a = get_node_or_null("Sprites/Arrow/Image") - if a: a.position = chat_offset + if arrow: arrow.image_pos = chat_offset ### Movement diff --git a/src/actor/Player.tscn b/src/actor/Player.tscn index 2a967bf..f6ccfa3 100644 --- a/src/actor/Player.tscn +++ b/src/actor/Player.tscn @@ -618,7 +618,7 @@ z_index = 50 z_as_relative = false collision_layer = 2 script = ExtResource( 2 ) -palette = [ Color( 0.14902, 0.14902, 0.14902, 1 ), Color( 0.505882, 0.505882, 0.6, 1 ), Color( 0.721569, 0.803922, 0.85098, 1 ), Color( 0.87, 0.87, 0.87, 1 ), Color( 0.729412, 1, 0.25098, 1 ), Color( 0, 1, 0, 1 ), Color( 0, 1, 0.498039, 1 ), Color( 0, 1, 1, 1 ), Color( 0, 0.498039, 1, 1 ), Color( 0.160784, 0.160784, 1, 1 ), Color( 0.576471, 0.14902, 1, 1 ), Color( 1, 0, 1, 1 ), Color( 1, 0, 0.498039, 1 ), Color( 1, 0, 0, 1 ), Color( 1, 0.501961, 0, 1 ), Color( 1, 1, 0, 1 ), Color( 1, 0.717647, 0.717647, 1 ), Color( 1, 0.675, 0.35, 1 ), Color( 0.741176, 0.407843, 0.505882, 1 ), Color( 0.478431, 0.25098, 0.423529, 1 ) ] +palette = [ Color( 0, 0, 0, 1 ), Color( 0.505882, 0.505882, 0.6, 1 ), Color( 0.85098, 0.945098, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 0.729412, 1, 0.25098, 1 ), Color( 0, 1, 0, 1 ), Color( 0, 1, 0.498039, 1 ), Color( 0, 1, 1, 1 ), Color( 0, 0.498039, 1, 1 ), Color( 0.160784, 0.160784, 1, 1 ), Color( 0.576471, 0.14902, 1, 1 ), Color( 1, 0, 1, 1 ), Color( 1, 0, 0.498039, 1 ), Color( 1, 0, 0, 1 ), Color( 1, 0.501961, 0, 1 ), Color( 1, 1, 0, 1 ), Color( 1, 0.717647, 0.717647, 1 ), Color( 1, 0.675, 0.35, 1 ), Color( 0.741176, 0.407843, 0.505882, 1 ), Color( 0.478431, 0.25098, 0.423529, 1 ) ] dye = { "eye": 14, "fit": 4, @@ -626,10 +626,10 @@ dye = { "skin": 19 } hair_backs = [ "", "res://src/actor/hair/back/Short.tscn", "res://src/actor/hair/back/Medium.tscn", "res://src/actor/hair/back/Long.tscn", "res://src/actor/hair/back/Braid.tscn", "res://src/actor/hair/back/Braids.tscn", "res://src/actor/hair/back/Afro.tscn" ] -hair_fronts = [ "", "res://src/actor/hair/front/OneShort.tscn", "res://src/actor/hair/front/OneLong.tscn", "res://src/actor/hair/front/TwoShort.tscn", "res://src/actor/hair/front/TwoLong.tscn", "res://src/actor/hair/front/Bun.tscn", "res://src/actor/hair/front/Buns.tscn", "res://src/actor/hair/front/Mohawk.tscn", "res://src/actor/hair/front/FlatTop.tscn", "res://src/actor/hair/front/Bangs.tscn" ] +hair_fronts = [ "", "res://src/actor/hair/front/OneShort.tscn", "res://src/actor/hair/front/OneLong.tscn", "res://src/actor/hair/front/TwoShort.tscn", "res://src/actor/hair/front/TwoLong.tscn", "res://src/actor/hair/front/Bun.tscn", "res://src/actor/hair/front/Buns.tscn", "res://src/actor/hair/front/Mohawk.tscn", "res://src/actor/hair/front/FlatTop.tscn", "res://src/actor/hair/front/Bangs.tscn", "res://src/actor/hair/front/FlowerPetals.tscn" ] hairstyle_back = 5 hairstyle_front = 1 -hats = [ "", "res://src/actor/hat/Candle.tscn" ] +hats = [ "", "res://src/actor/hat/Candle.tscn", "res://src/actor/hat/FlowerPetals.tscn" ] [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 2 ) @@ -642,6 +642,7 @@ collision_mask = 2184 shape = SubResource( 2 ) [node name="Areas" type="Node2D" parent="."] +visible = false [node name="HitArea" type="Area2D" parent="Areas"] position = Vector2( 55, 0 ) @@ -740,7 +741,6 @@ position = Vector2( 0, -25 ) [node name="Hat" type="Node2D" parent="Sprites/Root/Body"] position = Vector2( 0, -25 ) -z_index = 2 [node name="Hands" type="Node2D" parent="Sprites"] modulate = Color( 0.478431, 0.25098, 0.423529, 1 ) diff --git a/src/actor/door/Arrow.gd b/src/actor/door/Arrow.gd index 5bcf8ae..d5ecc90 100644 --- a/src/actor/door/Arrow.gd +++ b/src/actor/door/Arrow.gd @@ -3,9 +3,14 @@ extends Node2D class_name Arrow export var dir := 0 +export var col_size := Vector2(40, 50) setget set_col_size +export var col_pos := Vector2(0, 0) setget set_col_pos +export var image_pos := Vector2(0, -95) setget set_image_pos onready var image := $Image onready var mat : ShaderMaterial = $Image/Rect.material +onready var area := $Area2D +onready var col_shape := $Area2D/CollisionShape2D var player = null var body = null @@ -26,9 +31,13 @@ signal activate signal open func _ready(): - if Engine.editor_hint: return - player = Shared.player + set_col_size() + set_col_pos() + set_image_pos() + if Engine.editor_hint: return + + player = Shared.player image.modulate.a = 0.0 mat.set_shader_param("fill_y", 0.0) @@ -59,6 +68,18 @@ func _physics_process(delta): if open_clock == open_time and open_last != open_time: emit_signal("open") +func set_col_size(arg := col_size): + col_size = arg + if col_shape: col_shape.shape.extents = col_size + +func set_col_pos(arg := col_pos): + col_pos = arg + if area: area.position = col_pos + +func set_image_pos(arg := image_pos): + image_pos = arg + if image: image.position = image_pos + func _on_Area2D_body_entered(_body): body = _body try_active() diff --git a/src/actor/door/Arrow.tscn b/src/actor/door/Arrow.tscn index d524d6b..1024963 100644 --- a/src/actor/door/Arrow.tscn +++ b/src/actor/door/Arrow.tscn @@ -21,11 +21,11 @@ z_as_relative = false script = ExtResource( 1 ) [node name="Area2D" type="Area2D" parent="."] -visible = false collision_layer = 1024 collision_mask = 2 [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +visible = false shape = SubResource( 1 ) [node name="Image" type="Node2D" parent="."] diff --git a/src/actor/door/DoorBig.tscn b/src/actor/door/DoorBig.tscn index 1a1843f..9700cf9 100644 --- a/src/actor/door/DoorBig.tscn +++ b/src/actor/door/DoorBig.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=9 format=2] +[gd_scene load_steps=8 format=2] [ext_resource path="res://src/actor/door/DoorBase.tscn" type="PackedScene" id=1] [ext_resource path="res://media/font/profile/DoorLabel.tres" type="DynamicFont" id=2] @@ -7,9 +7,6 @@ [ext_resource path="res://src/shader/door_big.gdshader" type="Shader" id=7] [ext_resource path="res://media/image/box/round_rect100.png" type="Texture" id=8] -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 100, 100 ) - [sub_resource type="ShaderMaterial" id=2] resource_local_to_scene = true shader = ExtResource( 7 ) @@ -31,14 +28,9 @@ script = ExtResource( 4 ) audio_range = Vector2( 0.7, 0.9 ) gem_count = 0 -[node name="Area2D" parent="Arrow" index="0"] -collision_layer = 0 - -[node name="CollisionShape2D" parent="Arrow/Area2D" index="0"] -shape = SubResource( 1 ) - -[node name="Image" parent="Arrow" index="1"] -position = Vector2( 0, -150 ) +[node name="Arrow" parent="." index="0"] +col_size = Vector2( 100, 100 ) +image_pos = Vector2( 0, -150 ) [node name="Sprites" type="Node2D" parent="." index="1"] @@ -89,5 +81,3 @@ custom_fonts/font = ExtResource( 2 ) text = "0" align = 1 valign = 1 - -[editable path="Arrow"] diff --git a/src/actor/door/DoorSpawn.tscn b/src/actor/door/DoorSpawn.tscn index d737a65..dba9746 100644 --- a/src/actor/door/DoorSpawn.tscn +++ b/src/actor/door/DoorSpawn.tscn @@ -1,23 +1,11 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=2] [ext_resource path="res://src/actor/door/DoorBase.tscn" type="PackedScene" id=1] -[sub_resource type="RectangleShape2D" id=1] -resource_local_to_scene = true -extents = Vector2( 40, 50 ) - [node name="Spawn" instance=ExtResource( 1 )] scene_path = "spawn" [node name="Arrow" parent="." index="0"] -z_index = 0 -is_locked = true - -[node name="CollisionShape2D" parent="Arrow/Area2D" index="0"] -shape = SubResource( 1 ) - -[node name="Image" parent="Arrow" index="1"] modulate = Color( 0, 1, 0, 1 ) -position = Vector2( 0, 0 ) - -[editable path="Arrow"] +z_index = 0 +image_pos = Vector2( 0, 0 ) diff --git a/src/actor/hair/front/FlowerPetals.tscn b/src/actor/hair/front/FlowerPetals.tscn new file mode 100644 index 0000000..98bdecc --- /dev/null +++ b/src/actor/hair/front/FlowerPetals.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/detail/FlowerPetals.tscn" type="PackedScene" id=1] + +[node name="Hat" type="Node2D"] + +[node name="FlowerPetals" parent="." instance=ExtResource( 1 )] +position = Vector2( 0, -25 ) +scale = Vector2( 0.75, 0.75 ) +z_index = 0 +z_as_relative = true +palette = 0 diff --git a/src/actor/hat/FlowerPetals.tscn b/src/actor/hat/FlowerPetals.tscn new file mode 100644 index 0000000..98bdecc --- /dev/null +++ b/src/actor/hat/FlowerPetals.tscn @@ -0,0 +1,12 @@ +[gd_scene load_steps=2 format=2] + +[ext_resource path="res://src/detail/FlowerPetals.tscn" type="PackedScene" id=1] + +[node name="Hat" type="Node2D"] + +[node name="FlowerPetals" parent="." instance=ExtResource( 1 )] +position = Vector2( 0, -25 ) +scale = Vector2( 0.75, 0.75 ) +z_index = 0 +z_as_relative = true +palette = 0 diff --git a/src/autoload/Shared.gd b/src/autoload/Shared.gd index b0166a6..1010dc5 100644 --- a/src/autoload/Shared.gd +++ b/src/autoload/Shared.gd @@ -1,5 +1,7 @@ extends Node +export var is_debug := false + var splash_path := "res://src/menu/Splash.tscn" var title_path := "res://src/menu/MenuTitle.tscn" var worlds_path := "res://src/map/worlds/" @@ -154,14 +156,15 @@ func _input(event): emit_signal("gamepad_input", is_gamepad) print("gamepad_input: ", is_gamepad) -# if event.is_action_pressed("debug_screenshot"): -# burst_screenshot(15) -# -# if event.is_action_pressed("debug_home"): -# wipe_scene("res://src/map/worlds/0/0_hub.tscn") -# -# if event.is_action_pressed("debug_makeover"): -# MenuMakeover.is_open = !MenuMakeover.is_open + if is_debug: + if event.is_action_pressed("debug_screenshot"): + burst_screenshot(15) + + if event.is_action_pressed("debug_warp"): + wipe_scene("res://src/map/worlds/0/0_hub.tscn") + + if event.is_action_pressed("debug_makeover"): + MenuMakeover.is_open = !MenuMakeover.is_open func _physics_process(delta): # recorded time @@ -365,7 +368,7 @@ func list_all_files(path, is_ext := true): func list_folders_and_files(path, is_ext := true): var dir = Directory.new() if dir.open(path) != OK: - print("list_folder(): '", path, "' not found") + print("list_folders_and_files(): '", path, "' not found") return dir.list_dir_begin(true) @@ -545,10 +548,11 @@ func load_keys(path := "user://keys.tres"): if r is SaveDict: for a in r.dict.keys(): - InputMap.action_erase_events(a) - - for e in r.dict[a]: - InputMap.action_add_event(a, e) + if InputMap.has_action(a): + InputMap.action_erase_events(a) + + for e in r.dict[a]: + InputMap.action_add_event(a, e) ### Steam ### diff --git a/src/autoload/Shared.tscn b/src/autoload/Shared.tscn index 078949e..1af0681 100644 --- a/src/autoload/Shared.tscn +++ b/src/autoload/Shared.tscn @@ -6,6 +6,7 @@ [node name="Shared" type="Node"] pause_mode = 2 script = ExtResource( 1 ) +is_debug = true [node name="Player" parent="." instance=ExtResource( 2 )] pause_mode = 1 diff --git a/src/map/worlds/3/0_hub.tscn b/src/map/worlds/3/0_hub.tscn index 075c908..a666025 100644 --- a/src/map/worlds/3/0_hub.tscn +++ b/src/map/worlds/3/0_hub.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=10 format=2] +[gd_scene load_steps=11 format=2] [ext_resource path="res://src/detail/Rocks.tscn" type="PackedScene" id=1] [ext_resource path="res://src/stage/SpikeMap.tscn" type="PackedScene" id=2] @@ -8,6 +8,7 @@ [ext_resource path="res://src/actor/door/DoorBig.tscn" type="PackedScene" id=6] [ext_resource path="res://src/detail/Saguaro.tscn" type="PackedScene" id=7] [ext_resource path="res://src/detail/RockCircle.tscn" type="PackedScene" id=8] +[ext_resource path="res://src/actor/NPC.tscn" type="PackedScene" id=9] [ext_resource path="res://src/stage/SolidTileMap.tscn" type="PackedScene" id=12] [node name="Map" type="Node2D"] @@ -73,6 +74,18 @@ rotation = 4.71239 dir = 3 scene_path = "res://src/map/worlds/3/7.tscn" +[node name="NPC" parent="Actors" instance=ExtResource( 9 )] +position = Vector2( 1350, 450 ) +dye = { +"eye": 8, +"fit": 19, +"hair": 0, +"skin": 4 +} +hairstyle_back = 0 +hairstyle_front = 10 +hats = [ "", "res://src/actor/hat/Candle.tscn", "res://src/actor/hat/BarrelCacti.tscn" ] + [node name="Details" type="Node2D" parent="."] [node name="Rocks" type="Node2D" parent="Details"] diff --git a/src/menu/AttractMode.gd b/src/menu/AttractMode.gd index a7b1b24..73d2668 100644 --- a/src/menu/AttractMode.gd +++ b/src/menu/AttractMode.gd @@ -12,16 +12,12 @@ var step = -1 func _ready(): p.anim.play("jump") - p.is_input = false if is_trailer: p.dir_x = -1 elif !is_active: p.dir_x = 1 -func _exit_tree(): - p.is_input = true - func _physics_process(delta): if !is_active: return diff --git a/src/menu/MenuBoot.gd b/src/menu/MenuBoot.gd index 2be8b7a..4bca997 100644 --- a/src/menu/MenuBoot.gd +++ b/src/menu/MenuBoot.gd @@ -8,6 +8,7 @@ func _ready(): Cam.target_node = null Cam.snap_to(main_menu.pos, 0) Shared.save_slot = -1 + Shared.player.is_input = false randomize() MenuMakeover.preset() @@ -18,6 +19,7 @@ func _ready(): func _exit_tree(): UI.keys.show = false Cam.target_node = Shared.player + Shared.player.is_input = true func accept(): sub_menu(main_menu)