Mostly done?

This commit is contained in:
Dan 2026-01-29 13:26:42 +00:00
parent 22d7326565
commit a08c13b1a3
118 changed files with 2558 additions and 2519 deletions

473
scenes/animal.tscn Normal file
View file

@ -0,0 +1,473 @@
[gd_scene format=3 uid="uid://bfkpy8wqqktca"]
[ext_resource type="Script" uid="uid://uhlsvqaaemre" path="res://scenes/scripts/animal.gd" id="1_hb82n"]
[ext_resource type="Texture2D" uid="uid://cig2j8vh061c2" path="res://assets/characters/animals/Snow Fox/SnowFox.png" id="1_ufccv"]
[ext_resource type="Texture2D" uid="uid://ckvge3k08px5c" path="res://assets/tiles/sun.png" id="2_35nom"]
[ext_resource type="Texture2D" uid="uid://1uh6meq2g7pw" path="res://assets/characters/animals/Spikey Porcupine/SpikeyPorcupine.png" id="2_236rq"]
[ext_resource type="Texture2D" uid="uid://ctg64vc7kxwcq" path="res://assets/characters/animals/Timber Wolf/TimberWolf.png" id="3_3c5tq"]
[ext_resource type="Texture2D" uid="uid://dccs841gqvsnr" path="res://assets/characters/animals/Meowing Cat/MeowingCat.png" id="4_ieass"]
[ext_resource type="Texture2D" uid="uid://drghlunsulio" path="res://assets/characters/animals/Honking Goose/HonkingGoose.png" id="5_ieass"]
[ext_resource type="Texture2D" uid="uid://rvdwc66bww3" path="res://assets/characters/animals/Croaking Toad/CroakingToad.png" id="6_d7epe"]
[ext_resource type="Texture2D" uid="uid://elhjscadwqu0" path="res://assets/characters/animals/Tiny Chick/TinyChick.png" id="7_brjsm"]
[ext_resource type="Texture2D" uid="uid://b7hgiys1h18ov" path="res://assets/characters/animals/SleepDog.png" id="8_ybi86"]
[sub_resource type="AtlasTexture" id="AtlasTexture_35nom"]
atlas = ExtResource("1_ufccv")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_3u0el"]
atlas = ExtResource("1_ufccv")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_brrv0"]
atlas = ExtResource("1_ufccv")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_2g4xt"]
atlas = ExtResource("1_ufccv")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_m5q2l"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_35nom")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3u0el")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_brrv0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_2g4xt")
}],
"loop": true,
"name": &"default",
"speed": 4.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_3v7ex"]
atlas = ExtResource("2_236rq")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_3c5tq"]
atlas = ExtResource("2_236rq")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ieass"]
atlas = ExtResource("2_236rq")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_d7epe"]
atlas = ExtResource("2_236rq")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_brjsm"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_3v7ex")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_3c5tq")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ieass")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_d7epe")
}],
"loop": true,
"name": &"default",
"speed": 4.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_brjsm"]
atlas = ExtResource("3_3c5tq")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ybi86"]
atlas = ExtResource("3_3c5tq")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_hb82n"]
atlas = ExtResource("3_3c5tq")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_fiknr"]
atlas = ExtResource("3_3c5tq")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_d06xb"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_brjsm")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ybi86")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_hb82n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_fiknr")
}],
"loop": true,
"name": &"default",
"speed": 2.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_gceah"]
atlas = ExtResource("4_ieass")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_s21jh"]
atlas = ExtResource("4_ieass")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_xjlt7"]
atlas = ExtResource("4_ieass")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_jp041"]
atlas = ExtResource("4_ieass")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_7do3a"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_gceah")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_s21jh")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xjlt7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_jp041")
}],
"loop": true,
"name": &"default",
"speed": 4.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_d06xb"]
atlas = ExtResource("5_ieass")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_7do3a"]
atlas = ExtResource("5_ieass")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_qag4x"]
atlas = ExtResource("5_ieass")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_10oeq"]
atlas = ExtResource("5_ieass")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_lt1bt"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_d06xb")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_7do3a")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qag4x")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_10oeq")
}],
"loop": true,
"name": &"default",
"speed": 4.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_lt1bt"]
atlas = ExtResource("6_d7epe")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_748p7"]
atlas = ExtResource("6_d7epe")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_h4cte"]
atlas = ExtResource("6_d7epe")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_rori6"]
atlas = ExtResource("6_d7epe")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_gbowl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lt1bt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_748p7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_h4cte")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_rori6")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_gbowl"]
atlas = ExtResource("7_brjsm")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_em8nj"]
atlas = ExtResource("7_brjsm")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_j1qxf"]
atlas = ExtResource("7_brjsm")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_lowru"]
atlas = ExtResource("7_brjsm")
region = Rect2(48, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_20wpp"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_gbowl")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_em8nj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_j1qxf")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lowru")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_20wpp"]
atlas = ExtResource("8_ybi86")
region = Rect2(0, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_eaemt"]
atlas = ExtResource("8_ybi86")
region = Rect2(64, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_xa74n"]
atlas = ExtResource("8_ybi86")
region = Rect2(128, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_v8kal"]
atlas = ExtResource("8_ybi86")
region = Rect2(192, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_r1mgj"]
atlas = ExtResource("8_ybi86")
region = Rect2(256, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_wxa41"]
atlas = ExtResource("8_ybi86")
region = Rect2(320, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_33tgj"]
atlas = ExtResource("8_ybi86")
region = Rect2(384, 0, 64, 64)
[sub_resource type="AtlasTexture" id="AtlasTexture_l8a8u"]
atlas = ExtResource("8_ybi86")
region = Rect2(448, 0, 64, 64)
[sub_resource type="SpriteFrames" id="SpriteFrames_d57ma"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_20wpp")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_eaemt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xa74n")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_v8kal")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_r1mgj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wxa41")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_33tgj")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_l8a8u")
}],
"loop": true,
"name": &"default",
"speed": 3.0
}]
[sub_resource type="Curve" id="Curve_lrhn5"]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_okhi1"]
curve = SubResource("Curve_lrhn5")
[sub_resource type="Gradient" id="Gradient_my7n2"]
colors = PackedColorArray(0.6267965, 0.35946804, 0.115510084, 0.3764706, 0.5640522, 0.46861154, 0.16076079, 0.627451)
[sub_resource type="GradientTexture1D" id="GradientTexture1D_rkhd4"]
gradient = SubResource("Gradient_my7n2")
[sub_resource type="Curve" id="Curve_dp8ca"]
_data = [Vector2(0, 0), 0.0, 0.0, 0, 0, Vector2(1, 1), 0.0, 0.0, 0, 0]
point_count = 2
[sub_resource type="CurveTexture" id="CurveTexture_deeqb"]
curve = SubResource("Curve_dp8ca")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_0lw5n"]
lifetime_randomness = 0.73
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 1.0
angle_min = 1.0728835e-05
angle_max = 115.70001
inherit_velocity_ratio = 0.154
direction = Vector3(0, 0, 0)
spread = 98.933
initial_velocity_max = 2.0
gravity = Vector3(0, 0, 0)
linear_accel_min = 0.99999774
linear_accel_max = 4.9999976
scale_min = 0.19999999
scale_max = 0.7
scale_curve = SubResource("CurveTexture_deeqb")
color_ramp = SubResource("GradientTexture1D_rkhd4")
alpha_curve = SubResource("CurveTexture_okhi1")
hue_variation_min = -0.11000002
hue_variation_max = 0.089999974
turbulence_enabled = true
turbulence_noise_strength = 0.56
turbulence_noise_scale = 4.861
[sub_resource type="Curve" id="Curve_rkhd4"]
_data = [Vector2(0, 0.007272601), 0.0, 0.0, 0, 0, Vector2(0.46874994, 0.758909), 0.0, 0.0, 0, 0, Vector2(0.73632807, 0.8865454), 0.0, 0.0, 0, 0]
point_count = 3
[sub_resource type="CurveTexture" id="CurveTexture_lrhn5"]
curve = SubResource("Curve_rkhd4")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_agfs1"]
particle_flag_disable_z = true
gravity = Vector3(0, 0, 0)
linear_accel_min = -2.2351742e-06
linear_accel_max = 6.4299974
radial_accel_min = -2.2351742e-06
radial_accel_max = 23.289997
tangential_accel_min = -24.100002
tangential_accel_max = 10.439998
color = Color(0.84313726, 0.56078434, 0, 0.7921569)
alpha_curve = SubResource("CurveTexture_lrhn5")
[node name="Character" type="Node2D" unique_id=1357587844]
script = ExtResource("1_hb82n")
show_shavings = null
[node name="Fox" type="AnimatedSprite2D" parent="." unique_id=565500848]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_m5q2l")
autoplay = "default"
frame_progress = 0.44348216
[node name="Porcupine" type="AnimatedSprite2D" parent="." unique_id=1272266059]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_brjsm")
autoplay = "default"
frame = 3
frame_progress = 0.8018118
[node name="Wolf" type="AnimatedSprite2D" parent="." unique_id=1759146555]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_d06xb")
autoplay = "default"
frame = 3
frame_progress = 0.19724818
[node name="Cat" type="AnimatedSprite2D" parent="." unique_id=1332976928]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_7do3a")
autoplay = "default"
frame_progress = 0.031060848
[node name="Goose" type="AnimatedSprite2D" parent="." unique_id=222745417]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_lt1bt")
autoplay = "default"
frame_progress = 0.4729133
[node name="Frog" type="AnimatedSprite2D" parent="." unique_id=679106242]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_gbowl")
autoplay = "default"
frame = 1
frame_progress = 0.27542892
[node name="Chick" type="AnimatedSprite2D" parent="." unique_id=1754919209]
unique_name_in_owner = true
visible = false
sprite_frames = SubResource("SpriteFrames_20wpp")
autoplay = "default"
frame = 1
frame_progress = 0.11994407
[node name="Dog" type="AnimatedSprite2D" parent="." unique_id=197188039]
unique_name_in_owner = true
visible = false
position = Vector2(0, -32)
sprite_frames = SubResource("SpriteFrames_d57ma")
autoplay = "default"
[node name="Dust" type="GPUParticles2D" parent="." unique_id=785652497]
visible = false
position = Vector2(0, 1)
amount = 100
texture = ExtResource("2_35nom")
lifetime = 10.0
preprocess = 2.0
explosiveness = 0.06
randomness = 0.39
process_material = SubResource("ParticleProcessMaterial_0lw5n")
[node name="Shavings" type="GPUParticles2D" parent="." unique_id=1628407210]
unique_name_in_owner = true
visible = false
preprocess = 2.0
process_material = SubResource("ParticleProcessMaterial_agfs1")

View file

@ -1,33 +1,43 @@
[gd_scene load_steps=7 format=3 uid="uid://b0bmsqlrg77le"]
[gd_scene format=3 uid="uid://b0bmsqlrg77le"]
[ext_resource type="Texture2D" uid="uid://dx134esqj3kg3" path="res://assets/ui/buttonLong_brown.png" id="1_1bdt2"]
[ext_resource type="Texture2D" uid="uid://bmdc4875jf16r" path="res://assets/ui/buttonLong_brown_pressed.png" id="2_8m7bo"]
[ext_resource type="Texture2D" uid="uid://ddghl4cooepr1" path="res://assets/ui/buttonLong_blue.png" id="3_t81cg"]
[ext_resource type="Texture2D" uid="uid://f0tde4s55m2o" path="res://assets/ui/buttonLong_grey.png" id="4_is61r"]
[ext_resource type="Texture2D" uid="uid://c3gmw2rffktva" path="res://assets/ui/buttonLong_beige_pressed.png" id="3_8m7bo"]
[ext_resource type="Texture2D" uid="uid://bk377v70i8bsw" path="res://assets/ui/buttonLong_blue_pressed.png" id="4_8m7bo"]
[ext_resource type="Script" uid="uid://dj7uoaxxat5n4" path="res://scenes/scripts/button.gd" id="5_8m7bo"]
[ext_resource type="Theme" uid="uid://bnbtwoxxd6cg5" path="res://assets/theme/clicker.theme" id="5_iw4ej"]
[node name="TextureButton" type="TextureButton"]
[node name="TextureButton" type="TextureButton" unique_id=186080222]
custom_minimum_size = Vector2(100, 25)
offset_right = 100.0
offset_bottom = 25.0
offset_right = 103.0
offset_bottom = 32.0
tooltip_text = "I need a tooltip bro"
texture_normal = ExtResource("1_1bdt2")
texture_pressed = ExtResource("2_8m7bo")
texture_hover = ExtResource("3_t81cg")
texture_disabled = ExtResource("4_is61r")
texture_hover = ExtResource("3_8m7bo")
texture_disabled = ExtResource("4_8m7bo")
ignore_texture_size = true
stretch_mode = 0
script = ExtResource("5_8m7bo")
[node name="CenterContainer" type="CenterContainer" parent="."]
[node name="CenterContainer" type="CenterContainer" parent="." unique_id=313903696]
clip_contents = true
custom_minimum_size = Vector2(100, 25)
layout_mode = 0
offset_right = 100.0
offset_bottom = 25.0
[node name="Label" type="Label" parent="CenterContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer" unique_id=1263225362]
layout_mode = 2
theme_override_constants/separation = 0
[node name="NameLabel" type="Label" parent="CenterContainer/VBoxContainer" unique_id=1225878363]
layout_mode = 2
theme = ExtResource("5_iw4ej")
text = "-"
horizontal_alignment = 1
[node name="PriceLabel" type="Label" parent="CenterContainer/VBoxContainer" unique_id=1012864835]
layout_mode = 2
theme = ExtResource("5_iw4ej")
text = "-"

91
scenes/config_panel.tscn Normal file
View file

@ -0,0 +1,91 @@
[gd_scene format=3 uid="uid://bqy5j8xm7o8ra"]
[ext_resource type="Script" path="res://scenes/scripts/config_panel.gd" id="1_config"]
[node name="ConfigPanel" type="Panel"]
unique_name_in_owner = true
light_mask = 2
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -200.0
offset_top = -150.0
offset_right = 200.0
offset_bottom = 150.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_config")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
layout_mode = 2
theme_override_constants/separation = 15
[node name="TitleLabel" type="Label" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
text = "Sound Settings"
horizontal_alignment = 1
vertical_alignment = 1
[node name="HSeparator" type="HSeparator" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="MusicContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/MusicContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Background Music"
vertical_alignment = 1
[node name="MusicToggle" type="CheckButton" parent="MarginContainer/VBoxContainer/MusicContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="ChopContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/ChopContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Wood Chop Sound"
vertical_alignment = 1
[node name="ChopToggle" type="CheckButton" parent="MarginContainer/VBoxContainer/ChopContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="MoneyContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/MoneyContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "Money Sound"
vertical_alignment = 1
[node name="MoneyToggle" type="CheckButton" parent="MarginContainer/VBoxContainer/MoneyContainer"]
unique_name_in_owner = true
layout_mode = 2
[node name="HSeparator2" type="HSeparator" parent="MarginContainer/VBoxContainer"]
layout_mode = 2
[node name="CloseButton" type="Button" parent="MarginContainer/VBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "Close"

View file

@ -1,3 +0,0 @@
[gd_scene format=3 uid="uid://duhwm7m5hc506"]
[node name="Game" type="Node3D"]

View file

@ -18,11 +18,16 @@
[ext_resource type="Script" uid="uid://cpimo8q5dcjxf" path="res://scenes/scripts/fire_light.gd" id="16_5kdtj"]
[ext_resource type="PackedScene" uid="uid://cbrkq6jd5a4ho" path="res://scenes/character.tscn" id="17_1hpkv"]
[ext_resource type="PackedScene" uid="uid://cnyxwsj6i27ja" path="res://scenes/stock_pile.tscn" id="17_deeqb"]
[ext_resource type="PackedScene" uid="uid://bfkpy8wqqktca" path="res://scenes/animal.tscn" id="17_k8jaa"]
[ext_resource type="PackedScene" uid="uid://bubjxrs8qmr4y" path="res://scenes/wood_pile.tscn" id="17_oibj5"]
[ext_resource type="Script" uid="uid://cm84m3olmcc8o" path="res://scenes/scripts/ui_control.gd" id="17_q7h7c"]
[ext_resource type="PackedScene" uid="uid://b0bmsqlrg77le" path="res://scenes/button.tscn" id="19_v4v8k"]
[ext_resource type="PackedScene" path="res://scenes/config_panel.tscn" id="20_config"]
[ext_resource type="Texture2D" uid="uid://dylc6y7ajsln3" path="res://assets/ui/panel_brown.png" id="22_hcndq"]
[ext_resource type="FontFile" uid="uid://bfq6d6y56gr4s" path="res://assets/font/m5x7.ttf" id="22_k8i0y"]
[ext_resource type="Theme" uid="uid://bnbtwoxxd6cg5" path="res://assets/theme/clicker.theme" id="22_q7h7c"]
[ext_resource type="Texture2D" uid="uid://dx134esqj3kg3" path="res://assets/ui/buttonLong_brown.png" id="23_lv1cq"]
[ext_resource type="FontFile" uid="uid://d2vuqc82hbh5b" path="res://assets/font/NotoColorEmoji-Regular.ttf" id="24_chdjo"]
[ext_resource type="Texture2D" uid="uid://bmdc4875jf16r" path="res://assets/ui/buttonLong_brown_pressed.png" id="24_k8i0y"]
[ext_resource type="Texture2D" uid="uid://ddghl4cooepr1" path="res://assets/ui/buttonLong_blue.png" id="25_hcndq"]
[ext_resource type="Texture2D" uid="uid://f0tde4s55m2o" path="res://assets/ui/buttonLong_grey.png" id="26_chdjo"]
@ -1946,9 +1951,26 @@ gradient = SubResource("Gradient_5kdtj")
fill = 1
fill_from = Vector2(0.5, 0.5)
[sub_resource type="FontVariation" id="FontVariation_hcndq"]
base_font = ExtResource("22_k8i0y")
variation_embolden = 0.2
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_q7h7c"]
bg_color = Color(0, 0, 0, 0.7921569)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mjadu"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_k8jaa"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hp34j"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_lxcs1"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hxr5a"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_mjadu"]
bg_color = Color(0.5921569, 0.44313726, 0.2901961, 1)
[node name="GameScene" type="Node2D" unique_id=1879752572]
[node name="Scene" type="Node2D" parent="." unique_id=1170541436]
@ -1960,42 +1982,57 @@ metadata/_edit_lock_ = true
[node name="Sprite2D" type="Sprite2D" parent="Scene/Background" unique_id=1234031660]
position = Vector2(43, -45)
texture = ExtResource("1_xrrf0")
metadata/_edit_lock_ = true
[node name="Sprite2D2" type="Sprite2D" parent="Scene/Background" unique_id=531673597]
position = Vector2(43, -45)
texture = ExtResource("2_kh4a2")
metadata/_edit_lock_ = true
[node name="Sprite2D3" type="Sprite2D" parent="Scene/Background" unique_id=1328011980]
position = Vector2(43, -45)
texture = ExtResource("3_8j387")
metadata/_edit_lock_ = true
[node name="Sprite2D4" type="Sprite2D" parent="Scene/Background" unique_id=236948197]
position = Vector2(43, -45)
texture = ExtResource("4_5dhap")
metadata/_edit_lock_ = true
[node name="Sprite2D5" type="Sprite2D" parent="Scene/Background" unique_id=1992550436]
position = Vector2(44, -45)
texture = ExtResource("5_s427y")
metadata/_edit_lock_ = true
[node name="BGTrees2" type="TileMapLayer" parent="Scene" unique_id=1214041213]
position = Vector2(-49, 59)
tile_map_data = Packed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wADAAMAAAD8//n/BwADAAQAAAD8//r/BwADAAUAAAD8//v/BwADAAYAAAD8//z/BwADAAcAAAD8//3/BwADAAgAAAD8//7/BwADAAkAAAD9//b/BwAEAAEAAAD9//f/BwAEAAIAAAD9//j/BwAEAAMAAAD9//n/BwAEAAQAAAD9//r/BwAEAAUAAAD9//v/BwAEAAYAAAD9//z/BwAEAAcAAAD9//3/BwAEAAgAAAD9//7/BwAEAAkAAAD+//b/BwAFAAEAAAD+//f/BwAFAAIAAAD+//j/BwAFAAMAAAD+//n/BwAFAAQAAAD+//r/BwAFAAUAAAD+//v/BwAFAAYAAAD+//z/BwAFAAcAAAD+//3/BwAFAAgAAAD+//7/BwAFAAkAAAD///X/BwAGAAAAAAD///b/BwAGAAEAAAD///f/BwAGAAIAAAD///j/BwAGAAMAAAD///n/BwAGAAQAAAD///r/BwAGAAUAAAD///v/BwAGAAYAAAD///z/BwAGAAcAAAD///3/BwAGAAgAAAAAAPj/BwAHAAMAAAAAAPn/BwAHAAQAAAAAAPr/BwAHAAUAAAAMAP7/AQAMABQAAAAMAP//AQAMABUAAAANAP7/AQANABQAAAANAP//AQANABUAAAAOAP7/AQAOABQAAAAOAP//AQAOABUAAAAPAP//AQAPABUAAAAKAP//AQAKABUAAAALAP//AQALABUAAAAAAP7/AQAAABwAAAAAAP//AQAAAB0AAAABAP7/AQABABwAAAABAP//AQABAB0AAAACAP7/AQACABwAAAACAP//AQACAB0AAAADAP//AQADAB0AAAAVAP//AQAGAB0AAAAWAP//AQAHAB0AAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="BGTrees1" type="TileMapLayer" parent="Scene" unique_id=232331490]
position = Vector2(-49, 59)
tile_map_data = PackedByteArray("AAD9//7/BAAKAAMAAAD9////BAAKAAQAAAD+////BAALAAQAAAAHAP7/AgAGAAsAAAAHAP//AgAGAAwAAAAIAP3/AgAHAAoAAAAIAP7/AgAHAAsAAAAIAP//AgAHAAwAAAAJAP7/AgAIAAsA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AD8/wAABAAJAAUAAAD9/wAABAAKAAUAAAD+/wAABAALAAUAAAD5////BAAGAAMAAAD5/wAABAAGAAMAAAD6/wEABAAGAAMAAAD6/wIABAAGAAMAAAD6/wMABAAGAAMAAAD5/wMABAAGAAMAAAD5/wQABAAGAAMAAAD6/wQABAAGAAMAAAD7/wQABAAGAAMAAAD8/wQABAAGAAMAAAD9/wQABAAGAAMAAAD9/wMABAAGAAMAAAD8/wMABAAGAAMAAAD7/wMABAAGAAMAAAD4/wIABAAGAAMAAAD4/wEABAAGAAMAAAD5/wEABAAGAAMAAAD6/wAABAAGAAMAAAD6////BAAGAAMAAAD5/wIABAAGAAMAAAD7/wEABAAGAAMAAAD8/wEABAAGAAMAAAD9/wEABAAGAAMAAAD+/wEABAAGAAMAAAD+/wIABAAGAAMAAAD9/wIABAAGAAMAAAD8/wIABAAGAAMAAAD7/wIABAAGAAMAAAD+/wMABAAGAAMAAAD+/wQABAAGAAMAAAD4/wMABAAGAAMAAAD4/wQABAAGAAMAAAD4////BAAGAAMAAAD4//7/AAAEAA8AAAD4//3/AAAEAA4AAADx////AAACAA8AAADy////AAACAA8AAADz//7/AAADAA8AAADz////AAACAA8AAAD0//7/AAAEAA8AAAD0////AAACAA8AAAD1//7/AAABAA8AAAD1////AAACAA8AAAD2////AAACAA8AAAD1//v/AAABAAwAAAD1//z/AAABAA0AAAD1//3/AAABAA4AAAD2//v/AAACAAwAAAD2//z/AAACAA0AAAD2//3/AAACAA4AAAD2//7/AAACAA8AAAD3//v/AAADAAwAAAD3//z/AAADAA0AAAD3//3/AAADAA4AAAD3//7/AAADAA8AAAD4//v/AAAEAAwAAAD4//z/AAAEAA0AAADx//v/AAADAAwAAADx//z/AAADAA0AAADx//3/AAADAA4AAADx//7/AAADAA8AAADy//v/AAAEAAwAAADy//z/AAAEAA0AAADy//3/AAAEAA4AAADy//7/AAAEAA8AAADz//v/AAADAAwAAADz//z/AAADAA0AAADz//3/AAADAA4AAAD0//v/AAAEAAwAAAD0//z/AAAEAA0AAAD0//3/AAAEAA4AAADv//v/AAABAAwAAADv//z/AAABAA0AAADv//3/AAABAA4AAADv//7/AAABAA8AAADw//v/AAACAAwAAADw//z/AAACAA0AAADw//3/AAACAA4AAADw//7/AAACAA8AAAD3////AAACAA8AAADw////AAACAA8AAADv////AAACAA8AAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="BGTrees0" type="TileMapLayer" parent="Scene" unique_id=192241590]
position = Vector2(-49, 59)
tile_map_data = PackedByteArray("AAARAPn/BgAAAAEAAAARAPr/BgAAAAIAAAARAPv/BgAAAAMAAAARAPz/BgAAAAQAAAASAPj/BgABAAAAAAASAPn/BgABAAEAAAASAPr/BgABAAIAAAASAPv/BgABAAMAAAASAPz/BgABAAQAAAASAP3/BgABAAUAAAATAPj/BgACAAAAAAATAPn/BgACAAEAAAATAPr/BgACAAIAAAATAPv/BgACAAMAAAATAPz/BgACAAQAAAATAP3/BgACAAUAAAATAP7/BgACAAYAAAAUAPj/BgADAAAAAAAUAPn/BgADAAEAAAAUAPr/BgADAAIAAAAUAPv/BgADAAMAAAAUAPz/BgADAAQAAAAVAPn/BgAEAAEAAAAVAPr/BgAEAAIAAAAVAPv/BgAEAAMAAAAVAPz/BgAEAAQAAADx//n/BgAAAAEAAADx//r/BgAAAAIAAADx//v/BgAAAAMAAADx//z/BgAAAAQAAADy//j/BgABAAAAAADy//n/BgABAAEAAADy//r/BgABAAIAAADy//v/BgABAAMAAADy//z/BgABAAQAAADy//3/BgABAAUAAADz//j/BgACAAAAAADz//n/BgACAAEAAADz//r/BgACAAIAAADz//v/BgACAAMAAADz//z/BgACAAQAAADz//3/BgACAAUAAADz//7/BgACAAYAAAD0//j/BgADAAAAAAD0//n/BgADAAEAAAD0//r/BgADAAIAAAD0//v/BgADAAMAAAD0//z/BgADAAQAAAD1//n/BgAEAAEAAAD1//r/BgAEAAIAAAD1//v/BgAEAAMAAAD1//z/BgAEAAQAAAD1//7/AQAAABwAAAD1////AQAAAB0AAAD2//7/AQABABwAAAD2////AQABAB0AAAD3//7/AQACABwAAAD3////AQACAB0AAAD4////AQADAB0AAADv//7/AQAAABwAAADv////AQAAAB0AAADw//7/AQABABwAAADw////AQABAB0AAADx//7/AQACABwAAADx////AQACAB0AAADy////AQADAB0AAAD5//v/CAAWAAAAAAD5//z/CAAWAAEAAAD5//3/CAAWAAIAAAD5//7/CAAWAAMAAAD6//v/CAAXAAAAAAD6//z/CAAXAAEAAAD6//3/CAAXAAIAAAD6//7/CAAXAAMAAAD5////CAAUAAMAAAD6////CAAVAAMAAAD3//n/CAAaAAIAAAD3//r/CAAaAAMAAAD4//n/CAAbAAIAAAD4//r/CAAbAAMAAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="BackgroundDecor" type="TileMapLayer" parent="Scene" unique_id=1466162064]
position = Vector2(-49, 59)
tile_map_data = PackedByteArray("AAD9//7/AQAAAAQAAAD9////AQAAAAUAAAD+//3/AQABAAMAAAD+//7/AQABAAQAAAD+////AQABAAUAAAD///3/AQACAAMAAAD///7/AQACAAQAAAD/////AQACAAUAAAAAAP3/AQADAAMAAAAAAP7/AQADAAQAAAAAAP//AQADAAUAAAABAP3/AQAEAAMAAAABAP7/AQAEAAQAAAABAP//AQAEAAUAAAACAP7/AQAFAAQAAAACAP//AQAFAAUAAAAEAP7/AQAGAAQAAAAEAP//AQAGAAUAAAAFAP3/AQAHAAMAAAAFAP7/AQAHAAQAAAAFAP//AQAHAAUAAAAGAP3/AQAIAAMAAAAGAP7/AQAIAAQAAAAGAP//AQAIAAUAAAAHAP3/AQAJAAMAAAAHAP7/AQAJAAQAAAAHAP//AQAJAAUAAAAIAP3/AQAKAAMAAAAIAP7/AQAKAAQAAAAIAP//AQAKAAUAAAAJAP7/AQALAAQAAAAJAP//AQALAAUAAADx////AQAKABUAAADy////AQALABUAAADz//7/AQAMABQAAADz////AQAMABUAAAD0//7/AQANABQAAAD0////AQANABUAAAD1//7/AQAOABQAAAD1////AQAOABUAAAD2////AQAPABUAAAARAP//AQAKABUAAAASAP//AQALABUAAAATAP7/AQAMABQAAAATAP//AQAMABUAAAAUAP7/AQANABQAAAAUAP//AQANABUAAAAVAP7/AQAOABQAAAAVAP//AQAOABUAAAAWAP//AQAPABUAAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="Cat" parent="Scene" unique_id=1357587844 groups=["animal_friends"] instance=ExtResource("17_k8jaa")]
position = Vector2(127, 35)
animal_type = "Cat"
flip_horizontal = true
show_shavings = true
[node name="LeafParticles" type="GPUParticles2D" parent="Scene" unique_id=420003071]
material = SubResource("CanvasItemMaterial_w330p")
@ -2034,11 +2071,41 @@ script = ExtResource("16_5kdtj")
position = Vector2(-49, 59)
tile_map_data = PackedByteArray("AAD9/wAAAAABAAwAAAD+/wAAAAACAAwAAAD//wAAAAADAAwAAAAAAAAAAAABAAwAAAABAAAAAAACAAwAAAACAAAAAAADAAwAAAADAAAAAAABAAwAAAAEAAAAAAACAAwAAAAFAAAAAAADAAwAAAAGAAAAAAABAAwAAAAHAAAAAAACAAwAAAAIAAAAAAADAAwAAAAJAAAAAAABAAwAAAAKAAAAAAACAAwAAAAKAAEAAAACAA0AAAAKAAIAAAACAA4AAAAKAAMAAAADAA4AAAAKAAQAAAADAA8AAAAHAAEAAAACAA0AAAAHAAIAAAACAA4AAAAHAAMAAAACAA4AAAAIAAEAAAADAA0AAAAIAAIAAAADAA4AAAAIAAMAAAADAA4AAAAJAAEAAAABAA0AAAAJAAIAAAABAA4AAAAJAAMAAAACAA4AAAAEAAEAAAACAA0AAAAEAAIAAAACAA4AAAAEAAMAAAADAA4AAAAFAAEAAAADAA0AAAAFAAIAAAADAA4AAAAFAAMAAAACAA4AAAAGAAEAAAABAA0AAAAGAAIAAAABAA4AAAAGAAMAAAADAA4AAAABAAEAAAACAA0AAAABAAIAAAACAA4AAAABAAMAAAACAA4AAAACAAEAAAADAA0AAAACAAIAAAADAA4AAAACAAMAAAADAA4AAAADAAEAAAABAA0AAAADAAIAAAABAA4AAAADAAMAAAACAA4AAAD+/wEAAAACAA0AAAD+/wIAAAACAA4AAAD+/wMAAAACAA8AAAD//wEAAAADAA0AAAD//wIAAAADAA4AAAD//wMAAAADAA8AAAAAAAEAAAABAA0AAAAAAAIAAAABAA4AAAAAAAMAAAABAA8AAAD9/wEAAAABAA0AAAD9/wIAAAABAA4AAAD9/wMAAAABAA8AAAAHAAQAAAACAA8AAAAIAAQAAAADAA8AAAAJAAQAAAACAA8AAAAEAAQAAAADAA8AAAAFAAQAAAACAA8AAAAGAAQAAAADAA8AAAABAAQAAAACAA8AAAACAAQAAAADAA8AAAADAAQAAAACAA8AAAD+/wQAAAACABAAAAD//wQAAAADABAAAAAAAAQAAAABABAAAAD9/wQAAAABABAAAADw/wAAAAAAAAwAAADw/wEAAAACAA4AAADw/wIAAAACAA8AAADw/wMAAAACAA4AAADw/wQAAAACAA8AAADx/wAAAAABAAwAAADx/wEAAAADAA4AAADx/wIAAAADAA8AAADx/wMAAAADAA4AAADx/wQAAAADAA8AAADy/wAAAAACAAwAAADy/wEAAAACAA0AAADy/wIAAAACAA4AAADy/wMAAAACAA8AAADy/wQAAAACABAAAADz/wAAAAADAAwAAADz/wEAAAADAA0AAADz/wIAAAADAA4AAADz/wMAAAADAA8AAADz/wQAAAADABAAAAD0/wAAAAABAAwAAAD0/wEAAAABAA0AAAD0/wIAAAABAA4AAAD0/wMAAAABAA8AAAD0/wQAAAABABAAAAD1/wAAAAACAAwAAAD1/wEAAAACAA0AAAD1/wIAAAACAA4AAAD1/wMAAAACAA8AAAD1/wQAAAACABAAAAD2/wAAAAADAAwAAAD2/wEAAAADAA0AAAD2/wIAAAADAA4AAAD2/wMAAAADAA8AAAD2/wQAAAADABAAAAD3/wAAAAABAAwAAAD3/wEAAAABAA0AAAD3/wIAAAABAA4AAAD3/wMAAAABAA8AAAD3/wQAAAABABAAAAD4/wAAAAACAAwAAAD4/wEAAAACAA0AAAD4/wIAAAACAA4AAAD4/wMAAAACAA8AAAD4/wQAAAACABAAAAD5/wAAAAADAAwAAAD5/wEAAAADAA0AAAD5/wIAAAADAA4AAAD5/wMAAAADAA8AAAD5/wQAAAADABAAAAD6/wAAAAABAAwAAAD6/wEAAAABAA0AAAD6/wIAAAABAA4AAAD6/wMAAAABAA8AAAD6/wQAAAABABAAAAD7/wAAAAACAAwAAAD7/wEAAAACAA0AAAD7/wIAAAACAA4AAAD7/wMAAAACAA8AAAD7/wQAAAACABAAAAD8/wAAAAADAAwAAAD8/wEAAAADAA0AAAD8/wIAAAADAA4AAAD8/wMAAAADAA8AAAD8/wQAAAADABAAAAALAAAAAAADAAwAAAALAAEAAAADAA0AAAALAAIAAAADAA4AAAALAAMAAAADAA8AAAALAAQAAAADABAAAAAMAAAAAAABAAwAAAAMAAEAAAABAA0AAAAMAAIAAAABAA4AAAAMAAMAAAABAA8AAAAMAAQAAAABABAAAAANAAAAAAACAAwAAAANAAEAAAACAA0AAAANAAIAAAACAA4AAAANAAMAAAACAA8AAAANAAQAAAACABAAAAAOAAAAAAADAAwAAAAOAAEAAAADAA0AAAAOAAIAAAADAA4AAAAOAAMAAAADAA8AAAAOAAQAAAADABAAAAAPAAAAAAABAAwAAAAPAAEAAAABAA0AAAAPAAIAAAABAA4AAAAPAAMAAAABAA8AAAAPAAQAAAABABAAAAAQAAAAAAACAAwAAAAQAAEAAAACAA0AAAAQAAIAAAACAA4AAAAQAAMAAAACAA8AAAAQAAQAAAACABAAAAARAAAAAAABAAwAAAARAAEAAAABAA0AAAARAAIAAAABAA4AAAARAAMAAAABAA8AAAARAAQAAAABABAAAAASAAAAAAACAAwAAAASAAEAAAACAA0AAAASAAIAAAACAA4AAAASAAMAAAACAA8AAAASAAQAAAACABAAAAATAAAAAAADAAwAAAATAAEAAAADAA0AAAATAAIAAAADAA4AAAATAAMAAAADAA8AAAATAAQAAAADABAAAAAUAAAAAAABAAwAAAAUAAEAAAABAA0AAAAUAAIAAAABAA4AAAAUA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AAAOAAUAAAADAA4AAAAOAAYAAAADAA8AAAAPAAUAAAACAA4AAAAPAAYAAAACAA8AAAAQAAUAAAADAA4AAAAQAAYAAAADAA8AAAARAAUAAAACAA4AAAARAAYAAAACAA8AAAASAAUAAAADAA4AAAASAAYAAAADAA8AAAATAAUAAAACAA4AAAATAAYAAAACAA8AAAAUAAUAAAADAA4AAAAUAAYAAAADAA8AAAAVAAUAAAACAA4AAAAVAAYAAAACAA8AAAAWAAUAAAADAA4AAAAWAAYAAAADAA8AAADw/wUAAAACAA4AAADw/wYAAAACAA8AAAAKAP7/AQAOAAAAAAAKAP//AQAOAAEAAAALAP7/AQAPAAAAAAALAP//AQAPAAEAAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="InteractionLayer" type="Node2D" parent="Scene" unique_id=955061762]
[node name="Goose" parent="Scene/InteractionLayer" unique_id=495867136 groups=["animal_friends"] instance=ExtResource("17_k8jaa")]
position = Vector2(-187, 19)
animal_type = "Goose"
flip_horizontal = true
show_shavings = true
[node name="Fox" parent="Scene/InteractionLayer" unique_id=1333255729 groups=["animal_friends"] instance=ExtResource("17_k8jaa")]
position = Vector2(-52, 51)
animal_type = "Fox"
show_shavings = true
[node name="Frog" parent="Scene/InteractionLayer" unique_id=1883056059 groups=["animal_friends"] instance=ExtResource("17_k8jaa")]
position = Vector2(-127, 51)
animal_type = "Frog"
show_shavings = true
[node name="Wolf" parent="Scene/InteractionLayer" unique_id=526034363 groups=["animal_friends"] instance=ExtResource("17_k8jaa")]
position = Vector2(-149, -29)
animal_type = "Wolf"
flip_horizontal = true
show_shavings = true
[node name="Dog" parent="Scene/InteractionLayer" unique_id=165373951 instance=ExtResource("17_k8jaa")]
position = Vector2(28, 59)
animal_type = "Dog"
show_shavings = false
metadata/_edit_lock_ = true
[node name="Character" parent="Scene/InteractionLayer" unique_id=916171989 instance=ExtResource("17_1hpkv")]
position = Vector2(-62, 29)
position = Vector2(-70, 29)
metadata/_edit_lock_ = true
[node name="StockPile" parent="Scene/InteractionLayer" unique_id=1961584119 instance=ExtResource("17_deeqb")]
position = Vector2(-215, 51)
@ -2051,17 +2118,21 @@ position = Vector2(164, 48)
position = Vector2(-49, 59)
tile_map_data = PackedByteArray("AAACAP7/AQACAAYAAAACAP//AQACAAcAAAADAP7/AQADAAYAAAADAP//AQADAAcAAAAHAP//AQAYAAcAAAAIAP//AQAZAAcAAADz////AQAIAAkAAAD0////AQAJAAkAAAD3////AQAKAAkAAAD4////AQALAAkAAADw////AQAWAAcAAADx////AQAXAAcAAAD8////AQAGAA0AAAD9////AQAHAA0AAAD5////AQAGAA8AAAD6////AQAHAA8AAAAOAP//AQAIAA8AAAAPAP7/AQAJAA4AAAAPAP//AQAJAA8AAAAQAP7/AQAKAA4AAAAQAP//AQAKAA8AAAARAP//AQALAA8AAAATAP//AQAGAA0AAAAUAP//AQAHAA0AAAAJAP//AQAGAA0AAAAKAP//AQAHAA0AAAALAP//AQAKAAkAAAAMAP//AQALAAkAAAA=")
tile_set = SubResource("TileSet_btr28")
metadata/_edit_lock_ = true
[node name="Camera2D" type="Camera2D" parent="." unique_id=1719721614]
zoom = Vector2(2, 2)
metadata/_edit_lock_ = true
[node name="UI" type="Control" parent="." unique_id=1827364964]
light_mask = 2
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
theme = ExtResource("22_q7h7c")
script = ExtResource("17_q7h7c")
metadata/_edit_lock_ = true
[node name="Panel" type="Panel" parent="UI" unique_id=35561461]
visible = false
@ -2080,31 +2151,77 @@ offset_right = 45.0
offset_bottom = -5.0
theme_override_font_sizes/font_size = 12
[node name="CurrencyLabel" type="Label" parent="UI" unique_id=508512755]
unique_name_in_owner = true
layout_mode = 0
offset_left = -41.0
offset_top = -137.0
offset_right = 43.0
offset_bottom = -120.375
theme = ExtResource("22_q7h7c")
theme_override_fonts/font = SubResource("FontVariation_hcndq")
theme_override_font_sizes/font_size = 21
text = "Currency"
horizontal_alignment = 1
[node name="CurrenciesBG" type="Sprite2D" parent="UI" unique_id=400039529]
position = Vector2(-246.24998, -132)
scale = Vector2(0.7450001, 0.44000018)
texture = ExtResource("22_hcndq")
[node name="Currencies" type="VBoxContainer" parent="UI" unique_id=1952407607]
layout_mode = 0
offset_left = -284.0
offset_top = -159.0
offset_right = -239.0
offset_bottom = -103.0
offset_left = -278.0
offset_top = -151.0
offset_right = -182.0
offset_bottom = -114.0
theme_override_constants/separation = 5
alignment = 1
[node name="CurrencyLabel" type="Label" parent="UI/Currencies" unique_id=508512755]
unique_name_in_owner = true
[node name="HBoxContainer" type="HBoxContainer" parent="UI/Currencies" unique_id=1028765341]
layout_mode = 2
theme = ExtResource("22_q7h7c")
text = "Currency"
[node name="WoodLabel" type="Label" parent="UI/Currencies" unique_id=173301448]
[node name="RichTextLabel2" type="RichTextLabel" parent="UI/Currencies/HBoxContainer" unique_id=622882040]
clip_contents = false
custom_minimum_size = Vector2(10, 14)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_fonts/normal_font = ExtResource("24_chdjo")
theme_override_font_sizes/normal_font_size = 9
text = "🪵"
scroll_active = false
autowrap_mode = 0
autowrap_trim_flags = 0
[node name="WoodLabel" type="Label" parent="UI/Currencies/HBoxContainer" unique_id=173301448]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("22_q7h7c")
theme_override_font_sizes/font_size = 18
text = "0"
[node name="StockLabel" type="Label" parent="UI/Currencies" unique_id=1137115173]
[node name="HBoxContainer2" type="HBoxContainer" parent="UI/Currencies" unique_id=231882591]
layout_mode = 2
[node name="RichTextLabel" type="RichTextLabel" parent="UI/Currencies/HBoxContainer2" unique_id=248143892]
clip_contents = false
custom_minimum_size = Vector2(10, 14)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_fonts/normal_font = ExtResource("24_chdjo")
theme_override_font_sizes/normal_font_size = 10
text = "📦"
scroll_active = false
autowrap_mode = 0
autowrap_trim_flags = 0
[node name="StockLabel" type="Label" parent="UI/Currencies/HBoxContainer2" unique_id=1137115173]
unique_name_in_owner = true
layout_mode = 2
theme = ExtResource("22_q7h7c")
theme_override_font_sizes/font_size = 18
text = "0"
[node name="UnlockContainer" type="GridContainer" parent="UI" unique_id=1701514762]
@ -2112,9 +2229,9 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -282.0
offset_top = 79.0
offset_right = 242.0
offset_left = -257.0
offset_top = 87.0
offset_right = 217.0
offset_bottom = 115.0
grow_horizontal = 2
grow_vertical = 2
@ -2128,10 +2245,11 @@ size_flags_vertical = 0
[node name="Timer" type="Label" parent="UI" unique_id=405529286]
unique_name_in_owner = true
layout_mode = 0
offset_left = -20.0
offset_left = -29.0
offset_top = -157.0
offset_right = 20.0
offset_bottom = -144.0
offset_right = 29.0
offset_bottom = -138.79167
theme_override_font_sizes/font_size = 23
text = "00:00:00"
[node name="GameCompleted" type="Panel" parent="UI" unique_id=1824061781]
@ -2156,6 +2274,7 @@ text = "YOU WIN!"
horizontal_alignment = 1
[node name="CompletionTimeLabel" type="Label" parent="UI/GameCompleted" unique_id=1845505160]
unique_name_in_owner = true
layout_mode = 0
offset_left = 221.0
offset_top = 211.0
@ -2183,6 +2302,7 @@ Completion Time"
horizontal_alignment = 1
[node name="TextEdit" type="TextEdit" parent="UI/GameCompleted" unique_id=637671853]
unique_name_in_owner = true
layout_mode = 0
offset_left = 35.0
offset_top = 277.0
@ -2192,6 +2312,7 @@ theme = ExtResource("22_q7h7c")
placeholder_text = "Your Name (Optional)"
[node name="SubmitScoreButton" type="TextureButton" parent="UI/GameCompleted" unique_id=111534642]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 25)
layout_mode = 0
offset_left = 171.0
@ -2221,6 +2342,17 @@ theme = ExtResource("22_q7h7c")
text = "Submit Score"
horizontal_alignment = 1
[node name="SubmissionStatusLabel" type="Label" parent="UI/GameCompleted" unique_id=976543210]
unique_name_in_owner = true
layout_mode = 0
offset_left = 281.0
offset_top = 277.0
offset_right = 450.0
offset_bottom = 304.0
theme_override_font_sizes/font_size = 12
horizontal_alignment = 1
vertical_alignment = 1
[node name="ContinueButton" type="TextureButton" parent="UI/GameCompleted" unique_id=1202982034]
unique_name_in_owner = true
custom_minimum_size = Vector2(100, 25)
@ -2252,4 +2384,33 @@ theme = ExtResource("22_q7h7c")
text = "Continue Whittling"
horizontal_alignment = 1
[node name="ConfigButton" type="Button" parent="UI" unique_id=2147483647]
unique_name_in_owner = true
layout_mode = 0
offset_left = 255.0
offset_top = 134.0
offset_right = 275.0
offset_bottom = 153.0
theme = ExtResource("22_q7h7c")
theme_override_colors/font_color = Color(0.3764706, 0.31764707, 0.16078432, 1)
theme_override_colors/font_pressed_color = Color(0.7882353, 0.36078432, 0.19215687, 1)
theme_override_colors/font_hover_color = Color(0.49803922, 0.4627451, 0.2901961, 1)
theme_override_fonts/font = ExtResource("24_chdjo")
theme_override_font_sizes/font_size = 13
theme_override_styles/normal = SubResource("StyleBoxEmpty_mjadu")
theme_override_styles/pressed = SubResource("StyleBoxEmpty_k8jaa")
theme_override_styles/hover = SubResource("StyleBoxEmpty_hp34j")
theme_override_styles/disabled = SubResource("StyleBoxEmpty_lxcs1")
theme_override_styles/focus = SubResource("StyleBoxEmpty_hxr5a")
text = "🎵"
[node name="ConfigPanel" parent="UI" unique_id=281194599 instance=ExtResource("20_config")]
visible = false
layout_mode = 1
offset_left = -129.0
offset_top = -132.0
offset_right = 90.0
offset_bottom = 81.0
theme_override_styles/panel = SubResource("StyleBoxFlat_mjadu")
[connection signal="pressed" from="UI/GameCompleted/ContinueButton" to="UI" method="_on_continue_button_pressed"]

79
scenes/scripts/animal.gd Normal file
View file

@ -0,0 +1,79 @@
@tool
extends Node2D
@export var animal_type : String:
set(value):
animal_type = value
if is_node_ready():
_update_sprite()
@export var flip_horizontal : bool = false:
set(value):
flip_horizontal = value
if is_node_ready():
_update_sprite()
@export var show_shavings : bool = false:
set(value):
show_shavings = value
if is_node_ready():
_update_shavings()
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_update_sprite()
_update_shavings()
func _update_sprite() -> void:
# Hide all animal sprites first
%Fox.visible = false
%Porcupine.visible = false
%Wolf.visible = false
%Cat.visible = false
%Goose.visible = false
%Frog.visible = false
%Chick.visible = false
%Dog.visible = false
# Show the appropriate animal based on animal_type
var active_sprite: AnimatedSprite2D
match animal_type:
"Fox":
%Fox.visible = true
active_sprite = %Fox
"Porcupine":
%Porcupine.visible = true
active_sprite = %Porcupine
"Wolf":
%Wolf.visible = true
active_sprite = %Wolf
"Cat":
%Cat.visible = true
active_sprite = %Cat
"Goose":
%Goose.visible = true
active_sprite = %Goose
"Frog":
%Frog.visible = true
active_sprite = %Frog
"Chick":
%Chick.visible = true
active_sprite = %Chick
"Dog":
%Dog.visible = true
active_sprite = %Dog
# Apply horizontal flip if enabled
if active_sprite:
active_sprite.flip_h = flip_horizontal
func _update_shavings() -> void:
%Shavings.visible = show_shavings
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass

View file

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

View file

@ -1,58 +1,136 @@
extends TextureButton
@onready var label: Label = $CenterContainer/Label # Adjust path to your Label node
@onready var name_label: Label = $CenterContainer/VBoxContainer/NameLabel
@onready var price_label: Label = $CenterContainer/VBoxContainer/PriceLabel
var unlock_id = "" # Store the unlock ID
var unlock_id = -1 # Store the unlock ID
var unlock_description_text = "" # Store the description for custom tooltip
func _ready():
label.visible = false # Hide label initially
name_label.visible = false # Hide label initially
price_label.visible = false
adjust_label_font_size()
# Connect the pressed signal
pressed.connect(_on_button_pressed)
# Connect to currency changes to update button state
Inventory.currency_changed.connect(_on_currency_changed)
# Connect to unlock events to update button state when items are unlocked
Unlocks.item_unlocked.connect(_on_item_unlocked)
func setup(unlock_data):
# Log.pr("Setting up button for unlock:", unlock_data.unlock_name)
unlock_id = unlock_data.unlock_id # Store the ID
if label:
label.visible = false
label.text = unlock_data.unlock_name + " " + str(unlock_data.get_next_rank())
label.text = label.text + " - " + Global.currency_symbol + str(unlock_data.get_next_cost())
label.text = label.text + "\n" + unlock_data.get_next_modifiers_string()
#self.disabled = unlock_data.is_unlocked
if name_label and price_label:
name_label.visible = false
price_label.visible = false
update_button_state(unlock_data)
adjust_label_font_size()
else:
Log.pr("Warning: Label node not found in button.")
Log.pr("Warning: Label nodes not found in button.")
func update_button_state(unlock_data):
# Store unlock description for custom tooltip
if unlock_data.unlock_description:
unlock_description_text = unlock_data.unlock_description
tooltip_text = unlock_data.unlock_description
# Check if at max rank
if not unlock_data.can_rank_up():
self.disabled = true
name_label.text = unlock_data.unlock_name + " (MAX)"
price_label.text = ""
return
# Build name text - only show rank if it's a scaling unlock
if unlock_data.is_scaling:
name_label.text = unlock_data.unlock_name + " " + str(unlock_data.get_next_rank())
else:
name_label.text = unlock_data.unlock_name
# Build price text
price_label.text = Global.currency_symbol + Global.format_number(unlock_data.get_next_cost())
# Check if player has enough currency
var cost = unlock_data.get_next_cost()
var current_currency = Inventory.get_currency()
self.disabled = current_currency < cost
func _on_currency_changed(new_amount: float):
# Update button state when currency changes
if unlock_id >= 0:
var unlock_data = Unlocks.get_unlock_by_id(unlock_id)
if unlock_data:
update_button_state(unlock_data)
func _on_item_unlocked():
# Update button state when any item is unlocked (in case this button reached max rank)
if unlock_id >= 0:
var unlock_data = Unlocks.get_unlock_by_id(unlock_id)
if unlock_data:
update_button_state(unlock_data)
adjust_label_font_size()
func _on_button_pressed():
# Log.pr("Button pressed, unlocking item:", unlock_id)
Unlocks.unlock_item(unlock_id)
func adjust_label_font_size():
if not label:
if not name_label or not price_label:
return
var available_width = size.x - 10
var available_height = size.y - 10
# Start with a reasonable font size
var font_size = 32
# Calculate font sizes for both labels
# Name label gets 60% of the height, price label gets 40%
var name_height = available_height * 0.6
var price_height = available_height * 0.4
# Start with reasonable font sizes
var name_font_size = 32
var price_font_size = 24
var min_font_size = 8
# Get or create a font
var font = label.get_theme_font("font")
# Binary search for the optimal font size
while font_size > min_font_size:
label.add_theme_font_size_override("font_size", font_size)
# Force update and get the actual text size
await get_tree().process_frame
var text_size = font.get_string_size(label.text, HORIZONTAL_ALIGNMENT_LEFT, -1, font_size)
# Check if it fits
if text_size.x <= available_width and text_size.y <= available_height:
# Get fonts
var name_font = name_label.get_theme_font("font")
var price_font = price_label.get_theme_font("font")
# Calculate name label font size without applying it
while name_font_size > min_font_size:
var text_size = name_font.get_string_size(name_label.text, HORIZONTAL_ALIGNMENT_LEFT, -1, name_font_size)
if text_size.x <= available_width and text_size.y <= name_height:
break
# Reduce font size and try again
font_size -= 1
label.add_theme_font_size_override("font_size", font_size)
label.visible = true # Show label after resizing is complete
name_font_size -= 1
# Calculate price label font size without applying it
while price_font_size > min_font_size:
var text_size = price_font.get_string_size(price_label.text, HORIZONTAL_ALIGNMENT_LEFT, -1, price_font_size)
if text_size.x <= available_width and text_size.y <= price_height:
break
price_font_size -= 1
# Apply both font sizes at once
name_label.add_theme_font_size_override("font_size", name_font_size)
price_label.add_theme_font_size_override("font_size", price_font_size)
name_label.visible = true
price_label.visible = true
# Call this function whenever you change the label text
func set_label_text(new_text: String):
if label:
label.visible = false # Hide while resizing
label.text = new_text
if name_label:
name_label.visible = false # Hide while resizing
price_label.visible = false
name_label.text = new_text
price_label.text = ""
adjust_label_font_size()
# Override to create custom tooltip with larger font
func _make_custom_tooltip(for_text: String) -> Object:
var tooltip_label = Label.new()
tooltip_label.text = for_text
tooltip_label.add_theme_font_size_override("font_size", 26)
# Create a panel container for background
var panel = PanelContainer.new()
panel.add_child(tooltip_label)
return panel

View file

@ -0,0 +1,41 @@
extends Panel
@onready var music_toggle: CheckButton = %MusicToggle
@onready var chop_toggle: CheckButton = %ChopToggle
@onready var money_toggle: CheckButton = %MoneyToggle
@onready var close_button: Button = %CloseButton
func _ready():
# Initialize toggle states from Global settings
music_toggle.button_pressed = Global.play_background_music
chop_toggle.button_pressed = Global.play_chop_sound
money_toggle.button_pressed = Global.play_money_sound
# Connect signals
music_toggle.toggled.connect(_on_music_toggled)
chop_toggle.toggled.connect(_on_chop_toggled)
money_toggle.toggled.connect(_on_money_toggled)
close_button.pressed.connect(_on_close_pressed)
# Start hidden
visible = false
func _on_music_toggled(enabled: bool):
Global.play_background_music = enabled
var audio_manager = get_node("/root/Audio")
if enabled:
audio_manager.play_background_music()
else:
audio_manager.stop_background_music()
func _on_chop_toggled(enabled: bool):
Global.play_chop_sound = enabled
func _on_money_toggled(enabled: bool):
Global.play_money_sound = enabled
func _on_close_pressed():
visible = false
func toggle_visibility():
visible = !visible

View file

@ -0,0 +1 @@
uid://2jm25u1ehlac

View file

@ -8,10 +8,19 @@ extends Control
@onready var timer_label : Label = %Timer
@onready var game_complete_screen : Panel = %GameCompleted
@onready var completion_time_label : Label = %CompletionTimeLabel
@onready var continue_button : TextureButton = %ContinueButton
@onready var config_button : Button = %ConfigButton
@onready var config_panel : Panel = %ConfigPanel
@onready var player_name_input : TextEdit = %TextEdit
@onready var submit_score_button : TextureButton = %SubmitScoreButton
@onready var submission_status_label : Label = %SubmissionStatusLabel
var game_timer : Timer
var elapsed_time := 0.0
var current_nonce : String = ""
var bridge = null
var score_submitted := false
func _ready():
populate_modifiers_display()
@ -34,6 +43,7 @@ func _ready():
Inventory.currency_changed.connect(_on_currency_changed)
Inventory.currency_added.connect(spawn_currency_increase)
Inventory.currency_added.connect(_on_currency_added)
Inventory.wood_changed.connect(_on_currency_changed)
Inventory.wood_added.connect(spawn_wood_increase)
Inventory.stock_added.connect(spawn_stock_increase)
@ -41,17 +51,27 @@ func _ready():
Unlocks.item_unlocked.connect(populate_unlock_buttons)
GameManager.currency_goal_met.connect(_on_currency_goal_met)
if config_button:
config_button.pressed.connect(_on_config_button_pressed)
if submit_score_button:
submit_score_button.pressed.connect(_on_submit_score_button_pressed)
# Initialize JavaScript bridge for web builds
if OS.has_feature("web"):
bridge = JavaScriptBridge.get_interface("godotBridge")
# get_tree().paused = true
func update_currency_label():
currency_label.text = Global.currency_symbol + " " + str(int(Inventory.get_currency()))
currency_label.text = Global.currency_symbol + Global.format_number(Inventory.get_currency())
func update_wood_label():
wood_label.text = "W: " + str(int(Inventory.get_wood()))
wood_label.text = Global.format_number(Inventory.get_wood())
func update_stock_label():
stock_label.text = "S: " + str(int(Inventory.get_stock()))
stock_label.text = Global.format_number(Inventory.get_stock())
func spawn_currency_increase(value, _total):
spawn_inventory_change_value(value, _total, "+", Global.currency_symbol, Global.money_color)
@ -64,7 +84,7 @@ func spawn_stock_increase(value, _total):
func spawn_inventory_change_value(value, _total, display_sign: String = "+", symbol: String = "", label_color: Color = Color.WHITE):
var float_label = Label.new()
float_label.text = display_sign + symbol + str(int(abs(value)))
float_label.text = display_sign + symbol + Global.format_number(abs(value))
float_label.add_theme_font_size_override("font_size", 16)
float_label.modulate = label_color
@ -99,10 +119,10 @@ func populate_unlock_buttons():
func populate_modifiers_display():
var modifiers_text = ""
modifiers_text = modifiers_text + "Sale Price: " + Global.currency_symbol + str(Unlocks.get_sale_price_per_item()) + "\n"
modifiers_text = modifiers_text + "Items Produced Per Tick: " + str(Unlocks.get_items_produced_per_tick()) + "\n"
modifiers_text = modifiers_text + "Wood per Click: " + str(Unlocks.get_wood_per_click()) + "\n\n"
modifiers_text = modifiers_text + "Demand: " + str(int(Unlocks.get_sale_demand())) + "\n\n"
modifiers_text = modifiers_text + "Sale Price: " + Global.currency_symbol + Global.format_number(Unlocks.get_sale_price_per_item()) + "\n"
modifiers_text = modifiers_text + "Items Produced Per Tick: " + Global.format_number(Unlocks.get_items_produced_per_tick()) + "\n"
modifiers_text = modifiers_text + "Wood per Click: " + Global.format_number(Unlocks.get_wood_per_click()) + "\n\n"
modifiers_text = modifiers_text + "Demand: " + Global.format_number(Unlocks.get_sale_demand()) + "\n\n"
modifiers_text = modifiers_text + "Current Modifiers:\n"
for key in Unlocks.current_modifiers.keys():
@ -129,7 +149,20 @@ func _on_timer_tick():
func _on_currency_goal_met():
Log.pr("Currency goal met!")
get_tree().paused = true
completion_time_label.text = format_time(elapsed_time)
game_complete_screen.visible = true
score_submitted = false
# Request nonce from API when game is completed
if bridge != null:
# Disable submit button until nonce is received
submit_score_button.disabled = true
submission_status_label.visible = false
_request_nonce()
else:
# No web bridge available, hide the submit button entirely
submit_score_button.visible = false
submission_status_label.visible = false
func format_time(seconds: float) -> String:
var total_seconds := int(seconds)
@ -145,3 +178,228 @@ func _on_continue_button_pressed() -> void:
Global.game_continue_pressed = true
game_complete_screen.visible = false
get_tree().paused = false
func _on_config_button_pressed() -> void:
if config_panel:
config_panel.toggle_visibility()
func _on_currency_added(_value, _total):
var audio_manager = get_node("/root/Audio")
if audio_manager:
audio_manager.play_money_sound()
# HIGH SCORE SUBMISSION FUNCTIONS
func _request_nonce():
if bridge == null:
return
# Call JavaScript bridge to request nonce
var result = bridge.requestNonce()
# Set up polling to check if nonce was received
# (since JS callbacks are async)
var nonce_check_timer = Timer.new()
nonce_check_timer.wait_time = 0.5
nonce_check_timer.one_shot = false
nonce_check_timer.process_mode = Node.PROCESS_MODE_ALWAYS # Run even when paused
add_child(nonce_check_timer)
var attempts = 0
var max_attempts = 20 # 10 seconds total
nonce_check_timer.timeout.connect(func():
attempts += 1
var nonce = _get_nonce_from_js()
if nonce != null and nonce != "" and nonce != "null":
current_nonce = nonce
# Enable submit button when nonce is ready
submit_score_button.disabled = false
nonce_check_timer.stop()
nonce_check_timer.queue_free()
elif attempts >= max_attempts:
# Failed to get nonce - show error and keep button disabled
submission_status_label.text = "Failed to connect to server"
submission_status_label.modulate = Color(1.0, 0.3, 0.3) # Red
submission_status_label.visible = true
nonce_check_timer.stop()
nonce_check_timer.queue_free()
)
nonce_check_timer.start()
func _get_nonce_from_js() -> String:
if bridge == null:
return ""
# Try to get the nonce that JavaScript stored
var result = JavaScriptBridge.eval("""
(function() {
if (window.godotNonce) {
return window.godotNonce;
}
return '';
})();
""", true)
return str(result) if result != null else ""
func _on_submit_score_button_pressed():
if score_submitted:
submission_status_label.text = "Score already submitted!"
submission_status_label.modulate = Color(1.0, 0.8, 0.3) # Yellow
submission_status_label.visible = true
return
if bridge == null or current_nonce == "":
# This shouldn't happen as button should be disabled
return
# Disable button during submission and show status
submit_score_button.disabled = true
submission_status_label.text = "Submitting..."
submission_status_label.modulate = Color(1.0, 1.0, 1.0) # White
submission_status_label.visible = true
# Get player name from input and sanitize
var player_name = _sanitize_player_name(player_name_input.text)
if player_name == "":
player_name = "Anonymous"
# Get completion time in seconds
var completion_time_seconds = int(elapsed_time)
# Create and encode payload on GDScript side
var encoded_payload = _create_encoded_payload(current_nonce, player_name, completion_time_seconds)
# Call JavaScript to submit score with pre-encoded payload and nonce
bridge.submitScore(encoded_payload, current_nonce)
# Poll for submission result
var submit_check_timer = Timer.new()
submit_check_timer.wait_time = 0.5
submit_check_timer.one_shot = false
submit_check_timer.process_mode = Node.PROCESS_MODE_ALWAYS # Run even when paused
add_child(submit_check_timer)
var attempts = 0
var max_attempts = 30 # 15 seconds total
submit_check_timer.timeout.connect(func():
attempts += 1
var result = _get_submission_result_from_js()
if result.has("completed") and result["completed"]:
submission_status_label.visible = true
if result["success"]:
submission_status_label.text = result.get("message", "Score submitted!")
submission_status_label.modulate = Color(0.5, 1.0, 0.5) # Green
score_submitted = true
# Show rank if available
if result.has("rank") and result["rank"] > 0:
submission_status_label.text += " (Rank #%d)" % result["rank"]
else:
submission_status_label.text = result.get("message", "Failed to submit")
submission_status_label.modulate = Color(1.0, 0.3, 0.3) # Red
submit_score_button.disabled = false
submit_check_timer.stop()
submit_check_timer.queue_free()
elif attempts >= max_attempts:
submission_status_label.text = "Submission timeout"
submission_status_label.modulate = Color(1.0, 0.3, 0.3) # Red
submission_status_label.visible = true
submit_score_button.disabled = false
submit_check_timer.stop()
submit_check_timer.queue_free()
)
submit_check_timer.start()
func _get_submission_result_from_js() -> Dictionary:
if bridge == null:
return {}
var result = JavaScriptBridge.eval("""
(function() {
if (window.godotSubmissionResult) {
var result = window.godotSubmissionResult;
window.godotSubmissionResult = null; // Clear after reading
return JSON.stringify(result);
}
return '{}';
})();
""", true)
if result != null and result != "":
var json = JSON.new()
var error = json.parse(str(result))
if error == OK:
return json.data
return {}
func _create_encoded_payload(nonce: String, player_name: String, completion_time: int) -> String:
# Create the payload as JSON
var payload = {
"nonce": nonce,
"gameId": "whittling-clicker", # Unique identifier for this game
"playerName": player_name,
"completionTime": completion_time,
"timestamp": Time.get_unix_time_from_system() * 1000 # Convert to milliseconds
}
var json_string = JSON.stringify(payload)
# XOR encode with key derived from nonce
var key = "WHITTLING_KEY_" + nonce.substr(0, 8)
var encoded_bytes = _xor_encode(json_string, key)
# Base64 encode (using raw bytes)
var base64_encoded = Marshalls.raw_to_base64(encoded_bytes)
return base64_encoded
func _sanitize_player_name(name: String) -> String:
# Strip leading/trailing whitespace
name = name.strip_edges()
# Remove control characters and most special characters, keep letters, numbers, spaces, and safe punctuation
var safe_name = ""
for i in range(name.length()):
var c = name[i]
var code = name.unicode_at(i)
# Allow: letters, numbers, spaces, hyphens, underscores, periods
# Block: control chars, path separators, quotes, angle brackets, etc
if (code >= 48 and code <= 57) or \
(code >= 65 and code <= 90) or \
(code >= 97 and code <= 122) or \
c == " " or c == "-" or c == "_" or c == ".":
safe_name += c
# Limit length to 50 characters
safe_name = safe_name.substr(0, 50)
# Remove multiple consecutive spaces
while safe_name.find(" ") != -1:
safe_name = safe_name.replace(" ", " ")
# Strip again after processing
safe_name = safe_name.strip_edges()
return safe_name
func _xor_encode(text: String, key: String) -> PackedByteArray:
var text_bytes = text.to_utf8_buffer()
var key_bytes = key.to_utf8_buffer()
var key_length = key_bytes.size()
var result = PackedByteArray()
for i in range(text_bytes.size()):
var xor_byte = text_bytes[i] ^ key_bytes[i % key_length]
result.append(xor_byte)
return result

View file

@ -1,124 +0,0 @@
[gd_scene format=3 uid="uid://br6hgvb4buyji"]
[ext_resource type="Script" uid="uid://citjokiv6skqi" path="res://scripts/sim_direct.gd" id="1_sim"]
[node name="Simulator" type="Control" unique_id=1833845714]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_sim")
[node name="MarginContainer" type="MarginContainer" parent="." unique_id=689981813]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 20
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
theme_override_constants/margin_bottom = 20
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer" unique_id=1425713346]
layout_mode = 2
theme_override_constants/separation = 15
[node name="Title" type="Label" parent="MarginContainer/VBoxContainer" unique_id=1101365395]
layout_mode = 2
theme_override_font_sizes/font_size = 32
text = "Unlock Simulator"
horizontal_alignment = 1
[node name="StatusPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer" unique_id=21717961]
layout_mode = 2
[node name="VBox" type="VBoxContainer" parent="MarginContainer/VBoxContainer/StatusPanel" unique_id=846585479]
layout_mode = 2
theme_override_constants/separation = 8
[node name="StatusLabel" type="Label" parent="MarginContainer/VBoxContainer/StatusPanel/VBox" unique_id=234737032]
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Status: Initializing..."
[node name="ProgressLabel" type="Label" parent="MarginContainer/VBoxContainer/StatusPanel/VBox" unique_id=2064314389]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Progress: 0.0% (0/0)"
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/VBoxContainer/StatusPanel/VBox" unique_id=1093115744]
custom_minimum_size = Vector2(0, 30)
layout_mode = 2
max_value = 1.0
step = 0.001
show_percentage = false
[node name="RateLabel" type="Label" parent="MarginContainer/VBoxContainer/StatusPanel/VBox" unique_id=2006247697]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Speed: 0.0 combos/sec"
[node name="ETALabel" type="Label" parent="MarginContainer/VBoxContainer/StatusPanel/VBox" unique_id=300266005]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "ETA: Calculating..."
[node name="CachePanel" type="PanelContainer" parent="MarginContainer/VBoxContainer" unique_id=242908015]
layout_mode = 2
[node name="VBox" type="VBoxContainer" parent="MarginContainer/VBoxContainer/CachePanel" unique_id=1164261399]
layout_mode = 2
theme_override_constants/separation = 8
[node name="CacheTitle" type="Label" parent="MarginContainer/VBoxContainer/CachePanel/VBox" unique_id=615421163]
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Cache Statistics"
[node name="CacheHitsLabel" type="Label" parent="MarginContainer/VBoxContainer/CachePanel/VBox" unique_id=1993375767]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Cache Hits: 0"
[node name="CacheMissesLabel" type="Label" parent="MarginContainer/VBoxContainer/CachePanel/VBox" unique_id=159876992]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Cache Misses: 0"
[node name="CacheRateLabel" type="Label" parent="MarginContainer/VBoxContainer/CachePanel/VBox" unique_id=51938306]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Hit Rate: 0.0%"
[node name="CacheSizeLabel" type="Label" parent="MarginContainer/VBoxContainer/CachePanel/VBox" unique_id=2001183562]
layout_mode = 2
theme_override_font_sizes/font_size = 16
text = "Cache Entries: 0"
[node name="ResultsPanel" type="PanelContainer" parent="MarginContainer/VBoxContainer" unique_id=1825974467]
layout_mode = 2
size_flags_vertical = 3
[node name="VBox" type="VBoxContainer" parent="MarginContainer/VBoxContainer/ResultsPanel" unique_id=339315001]
layout_mode = 2
[node name="ResultsTitle" type="Label" parent="MarginContainer/VBoxContainer/ResultsPanel/VBox" unique_id=975903988]
layout_mode = 2
theme_override_font_sizes/font_size = 20
text = "Results"
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer/VBoxContainer/ResultsPanel/VBox" unique_id=1950199865]
layout_mode = 2
size_flags_vertical = 3
[node name="ResultsLabel" type="RichTextLabel" parent="MarginContainer/VBoxContainer/ResultsPanel/VBox/ScrollContainer" unique_id=107644773]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_enabled = true
text = "Waiting for results..."
fit_content = true