Add functioning UI buttons

This commit is contained in:
Ategon 2024-10-07 04:25:58 -04:00
parent 178829785c
commit 942edf5556
32 changed files with 533 additions and 61 deletions

View file

@ -5,5 +5,6 @@
[resource]
default_font = ExtResource("1_y7uny")
default_font_size = 8
HBoxContainer/constants/separation = 37
RichTextLabel/colors/font_outline_color = Color(0, 0, 0, 1)
RichTextLabel/constants/outline_size = 4

View file

@ -22,4 +22,10 @@ wait_time = 3.0
one_shot = true
autostart = true
[node name="Timer2" type="Timer" parent="."]
wait_time = 3.0
one_shot = true
autostart = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]
[connection signal="timeout" from="Timer2" to="." method="_on_timer_timeout"]

View file

@ -17,6 +17,7 @@ input_pickable = false
shape = SubResource("RectangleShape2D_4cq27")
[node name="Sprite2D" type="Sprite2D" parent="MouseControl"]
visible = false
position = Vector2(2, 4)
texture = ExtResource("2_ucp64")

View file

@ -82,7 +82,7 @@ func _process(delta):
_on_release()
if Input.is_action_just_pressed("left_click"):
_on_click()
Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
#Input.set_mouse_mode(Input.MOUSE_MODE_HIDDEN)
mouse_control.position = mouse_control.get_global_mouse_position()
if held_item:

24
main.gd
View file

@ -4,12 +4,24 @@ extends Node2D
const CURSOR = preload("res://components/Cursor/Cursor.tscn")
const ZONE = preload("res://src/Zone.tscn")
const UI_BUTTONS = preload("res://src/UIButtons.tscn")
const PAUSE_WINDOW = preload("res://src/PauseWindow.tscn")
const BUILD_WINDOW = preload("res://src/BuildWindow.tscn")
var build_object
func _ready() -> void:
Triggerer.listen("spawn_window", _on_spawn_window)
Triggerer.listen("upgrade_menu", _on_build_menu)
Triggerer.listen("quit", _on_quit)
DisplayServer.window_set_title("Home")
get_viewport().transparent_bg = true
DisplayServer.window_set_flag(DisplayServer.WINDOW_FLAG_MOUSE_PASSTHROUGH, true)
var new_buttons = UI_BUTTONS.instantiate()
var new_cursor = CURSOR.instantiate()
new_buttons.add_child(new_cursor)
add_child(new_buttons)
func _process(delta: float) -> void:
@ -23,7 +35,6 @@ func _on_spawn_window(data) -> void:
var new_window = ZONE.instantiate()
new_window.key = data.key
new_window.size = Vector2(int(zone.size[0]) * 12 * 4, int(zone.size[1]) * 12 * 4)
new_window.position = Vector2(int(zone.spawn_position[0]), int(zone.spawn_position[1]))
var new_cursor = CURSOR.instantiate()
new_window.add_child(new_cursor)
@ -36,3 +47,14 @@ func _on_timer_timeout() -> void:
func _on_quit(_data) -> void:
get_tree().quit()
func _on_build_menu(data):
if data.value:
var new_window = BUILD_WINDOW.instantiate()
var new_cursor = CURSOR.instantiate()
new_window.add_child(new_cursor)
add_child(new_window)
build_object = new_window
else:
build_object.queue_free()

View file

@ -0,0 +1,6 @@
name: Creature Resources
description: More chance for a creature to drop a resource every day
key: creature_resource_spawn_rate
type: percent
amount: 10
cost: 10

View file

@ -0,0 +1,5 @@
name: Creature Bait
description: More creatures will wander onto your property every day
key: creature_amount
amount: 2
cost: 15

View file

@ -0,0 +1,5 @@
name: Advertising
description: More customers will visit your shop every day
key: customer_amount
amount: 4
cost: 12

View file

@ -0,0 +1,6 @@
name: More Resources
description: More chance for a resource to spawn in a zone every day
key: resource_spawn_rate
type: percent
amount: 10
cost: 10

View file

@ -1,7 +1,5 @@
name: Desert
spawn_position[]
300
300
size[]
6
6
description: Test

View file

@ -1,7 +1,5 @@
name: Farm
spawn_position[]
300
300
size[]
6
5
description: Test

View file

@ -1,7 +1,5 @@
name: Forest
spawn_position[]
300
300
size[]
5
6
description: Test

View file

@ -1,7 +1,5 @@
name: Lake
spawn_position[]
300
300
size[]
7
4
description: Test

View file

@ -21,7 +21,6 @@ Logger="*res://components/Logger/Logger.tscn"
Data="*res://components/Data/Data.tscn"
Triggerer="*res://components/Triggerer/Triggerer.tscn"
Persister="*res://components/Persister/Persister.tscn"
Cursor="*res://components/Cursor/Cursor.tscn"
Achievements="*res://components/Achievements/Achievements.tscn"
Dialogue="*res://components/Dialogue/Dialogue.tscn"
@ -32,6 +31,7 @@ window/size/viewport_height=180
window/size/mode=3
window/size/resizable=false
window/size/borderless=true
window/size/always_on_top=true
window/size/transparent=true
window/size/no_focus=true
window/size/window_width_override=1248

29
small_wave.gd Normal file
View file

@ -0,0 +1,29 @@
@tool
extends RichTextEffect
class_name SmallWaveEffect
var bbcode = "smallwave"
func _process_custom_fx(char_fx: CharFXTransform) -> bool:
var time = fmod(char_fx.elapsed_time * 8 - char_fx.relative_index + 100, 10)
var local_time = fmod(time, 1)
if time < 1:
char_fx.offset = Vector2(0, -1 * (sin(local_time * PI)))
if time < 3 or time >= 8:
var color_time = local_time
if time >= 1 and time < 3:
color_time += 1
if time >= 2 and time < 3:
color_time += 1
if time >= 0 and time < 3:
color_time += 1
if time >= 9 or time < 3:
color_time += 1
char_fx.color.a = (sin(color_time / 5 * PI)) * 0.1 + 0.9
else:
char_fx.color.a = 0.9
return true

145
src/BuildWindow.tscn Normal file
View file

@ -0,0 +1,145 @@
[gd_scene load_steps=5 format=3 uid="uid://b5gq1bw4bj56b"]
[ext_resource type="Theme" uid="uid://ck7603ob4gflc" path="res://Fonts/Theme.tres" id="1_ta3q3"]
[ext_resource type="Script" path="res://src/build_window.gd" id="1_y8qy0"]
[ext_resource type="Script" path="res://small_wave.gd" id="3_0qyx5"]
[sub_resource type="RichTextEffect" id="RichTextEffect_lhkb8"]
script = ExtResource("3_0qyx5")
[node name="BuildWindow" type="Window"]
canvas_item_default_texture_filter = 0
position = Vector2i(0, 36)
size = Vector2i(900, 500)
always_on_top = true
content_scale_factor = 4.0
[node name="Control" type="Control" parent="."]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_ta3q3")
script = ExtResource("1_y8qy0")
[node name="RichTextLabel" type="RichTextLabel" parent="Control"]
modulate = Color(0.559673, 1, 0.532353, 1)
clip_contents = false
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -20.0
offset_top = 9.56
offset_right = 20.0
offset_bottom = 49.56
grow_horizontal = 2
bbcode_enabled = true
text = "[smallwave][center]Upgrades"
custom_effects = [SubResource("RichTextEffect_lhkb8")]
[node name="RichTextLabel2" type="RichTextLabel" parent="Control"]
modulate = Color(0.633757, 0.633757, 0.633757, 1)
clip_contents = false
layout_mode = 1
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -84.93
offset_top = 105.945
offset_right = 83.15
offset_bottom = 145.945
grow_horizontal = 2
bbcode_enabled = true
text = "[center]Test Description"
[node name="HBoxContainer" type="HBoxContainer" parent="Control"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -20.0
offset_top = -20.0
offset_right = 20.0
offset_bottom = 20.0
grow_horizontal = 2
grow_vertical = 2
[node name="Upgrade" type="ColorRect" parent="Control/HBoxContainer"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
[node name="Card1Title" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
offset_top = -12.315
offset_right = 55.925
offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="Card1Cost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
offset_left = -22.43
offset_top = 46.24
offset_right = 56.38
offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"
[node name="Upgrade2" type="ColorRect" parent="Control/HBoxContainer"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
[node name="Card2Title" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade2"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
offset_top = -12.315
offset_right = 55.925
offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="Card2Cost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade2"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
offset_left = -22.43
offset_top = 46.24
offset_right = 56.38
offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"
[node name="Upgrade3" type="ColorRect" parent="Control/HBoxContainer"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
[node name="ZoneTitle" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade3"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
offset_top = -12.315
offset_right = 55.925
offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="ZoneCost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade3"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
offset_left = -22.43
offset_top = 46.24
offset_right = 56.38
offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"

43
src/PauseWindow.tscn Normal file
View file

@ -0,0 +1,43 @@
[gd_scene load_steps=3 format=3 uid="uid://fqm81ew717o1"]
[ext_resource type="Theme" uid="uid://ck7603ob4gflc" path="res://Fonts/Theme.tres" id="1_nkmbb"]
[ext_resource type="Script" path="res://src/pause.gd" id="2_h2gml"]
[node name="PauseWindow" type="Window"]
transparent_bg = true
canvas_item_default_texture_filter = 0
position = Vector2i(0, 36)
size = Vector2i(400, 50)
borderless = true
always_on_top = true
transparent = true
content_scale_factor = 5.0
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="Control" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_nkmbb")
script = ExtResource("2_h2gml")
[node name="RichTextLabel" type="RichTextLabel" parent="CanvasLayer/Control"]
clip_contents = false
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -60.0
offset_top = -2.845
offset_right = 60.0
offset_bottom = 37.155
grow_horizontal = 2
grow_vertical = 2
bbcode_enabled = true
text = "[center]Game Paused"

45
src/UIButtons.tscn Normal file
View file

@ -0,0 +1,45 @@
[gd_scene load_steps=8 format=3 uid="uid://bqd2ulwe0bsrb"]
[ext_resource type="Script" path="res://src/buttons.gd" id="1_rc6dx"]
[ext_resource type="PackedScene" uid="uid://br46gg7k10wt2" path="res://src/ui/ActionButton.tscn" id="1_ydcg5"]
[ext_resource type="Texture2D" uid="uid://ccvmfqybnygqp" path="res://src/ui/pause.png" id="2_n0s2l"]
[ext_resource type="Texture2D" uid="uid://d1h8n8h0to033" path="res://src/ui/upgrades.png" id="3_qishi"]
[ext_resource type="Texture2D" uid="uid://dwabjc45s6l27" path="res://src/ui/quit.png" id="4_6jhet"]
[ext_resource type="Texture2D" uid="uid://cblr2row5bl8c" path="res://src/ui/resume.png" id="4_n6ajx"]
[ext_resource type="Texture2D" uid="uid://dde40wino3goe" path="res://src/ui/upgrade-close.png" id="6_g4yuf"]
[node name="UiButtons" type="Window"]
transparent_bg = true
canvas_item_default_texture_filter = 0
size = Vector2i(100, 260)
borderless = true
always_on_top = true
transparent = true
content_scale_factor = 4.0
[node name="Node2D" type="Node2D" parent="."]
position = Vector2(-16.09, 0)
script = ExtResource("1_rc6dx")
[node name="PauseButton" parent="Node2D" instance=ExtResource("1_ydcg5")]
position = Vector2(28, 13)
key = "paused"
value = "toggle"
image = ExtResource("2_n0s2l")
alt_image = ExtResource("4_n6ajx")
color = Color(0.991606, 1, 0.496144, 1)
[node name="BuildButton" parent="Node2D" instance=ExtResource("1_ydcg5")]
position = Vector2(28, 32)
key = "upgrade_menu"
value = "toggle"
image = ExtResource("3_qishi")
alt_image = ExtResource("6_g4yuf")
color = Color(0.680476, 1, 0.652914, 1)
[node name="QuitButton" parent="Node2D" instance=ExtResource("1_ydcg5")]
position = Vector2(28, 51)
key = "quit"
value = "value"
image = ExtResource("4_6jhet")
color = Color(1, 0.734185, 0.691036, 1)

View file

@ -6,6 +6,7 @@
canvas_item_default_texture_filter = 0
position = Vector2i(0, 36)
unresizable = true
always_on_top = true
content_scale_mode = 1
content_scale_factor = 4.0
script = ExtResource("1_gihyf")

52
src/build_window.gd Normal file
View file

@ -0,0 +1,52 @@
extends Control
var upgrade_pool = Data.data.upgrades.keys()
var zone_pool = Data.data.zones.keys()
var current_zone
@onready var cards = [
{
"title": $HBoxContainer/Upgrade/Card1Title,
"cost": $HBoxContainer/Upgrade/Card1Cost
},
{
"title": $HBoxContainer/Upgrade2/Card2Title,
"cost": $HBoxContainer/Upgrade2/Card2Cost
},
{
"title": $HBoxContainer/Upgrade3/ZoneTitle,
"cost": $HBoxContainer/Upgrade3/ZoneCost
}
]
func _ready() -> void:
upgrade_pool.shuffle()
zone_pool.shuffle()
var screen_size = DisplayServer.screen_get_size(0)
get_window().position = DisplayServer.screen_get_position(0) + screen_size / 2 - Vector2i(450, 250)
_refresh_cards()
func _refresh_cards():
for i in range(0, 3):
_update_card(i)
func _update_card(index):
var choice
var card_data
var cost
if index == 2:
choice = zone_pool.pop_back()
card_data = Data.data.zones[choice]
cost = 20
else:
choice = upgrade_pool.pop_back()
card_data = Data.data.upgrades[choice]
cost = card_data.cost
cards[index].title.text = "[center]%s" % [card_data.name]
cards[index].cost.text = "[center]%d G" % [cost]

7
src/buttons.gd Normal file
View file

@ -0,0 +1,7 @@
extends Node2D
func _ready() -> void:
var screen_size = DisplayServer.screen_get_size(0)
get_window().position = Vector2i(screen_size.x - 100, 0) + DisplayServer.screen_get_position(0)

View file

@ -22,6 +22,9 @@ func _process(delta: float) -> void:
delay -= delta
return
if Persister.get_value("paused"):
return
time += delta
Persister.persist_data("time", int(time * 1000))

25
src/pause.gd Normal file
View file

@ -0,0 +1,25 @@
extends Control
@onready var rich_text_label: RichTextLabel = $RichTextLabel
var tween
func _ready() -> void:
rich_text_label.scale = Vector2.ZERO
Triggerer.listen("paused", _on_paused)
func _on_paused(data):
if tween:
tween.kill()
tween = create_tween()
if data.value:
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_BACK)
tween.tween_property(rich_text_label, "scale", Vector2.ONE, 0.25)
else:
tween.set_ease(Tween.EASE_OUT)
tween.set_trans(Tween.TRANS_QUAD)
tween.tween_property(rich_text_label, "scale", Vector2.ZERO, 0.125)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=13 format=3 uid="uid://ccdhbljb3e0oh"]
[gd_scene load_steps=10 format=3 uid="uid://ccdhbljb3e0oh"]
[ext_resource type="Theme" uid="uid://ck7603ob4gflc" path="res://Fonts/Theme.tres" id="1_k6a0m"]
[ext_resource type="Texture2D" uid="uid://ca5dpjaoimrej" path="res://src/ui/top-left.png" id="2_nvcj5"]
@ -6,12 +6,11 @@
[ext_resource type="Script" path="res://src/ui/day_text.gd" id="3_k76r2"]
[ext_resource type="Script" path="res://src/ui/time_text.gd" id="4_7xwp1"]
[ext_resource type="Script" path="res://src/ui/gold_text.gd" id="5_uk4d4"]
[ext_resource type="PackedScene" uid="uid://br46gg7k10wt2" path="res://src/ui/ActionButton.tscn" id="7_gchpm"]
[ext_resource type="Script" path="res://src/ui/pause_menu.gd" id="8_bnf8a"]
[ext_resource type="Texture2D" uid="uid://ccvmfqybnygqp" path="res://src/ui/pause.png" id="8_vlg72"]
[ext_resource type="Texture2D" uid="uid://dwabjc45s6l27" path="res://src/ui/quit.png" id="8_ytenc"]
[ext_resource type="Texture2D" uid="uid://d1h8n8h0to033" path="res://src/ui/upgrades.png" id="9_5s7ww"]
[ext_resource type="PackedScene" uid="uid://b782aedv3v7df" path="res://src/ui/TextActionButton.tscn" id="9_pynn5"]
[ext_resource type="Script" path="res://src/pause.gd" id="7_gi2gs"]
[ext_resource type="Script" path="res://small_wave.gd" id="8_88rs2"]
[sub_resource type="RichTextEffect" id="RichTextEffect_a7xgu"]
script = ExtResource("8_88rs2")
[node name="CanvasLayer" type="CanvasLayer"]
@ -98,47 +97,28 @@ offset_left = -40.0
offset_bottom = 40.0
grow_horizontal = 0
[node name="PauseButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")]
position = Vector2(28, 13)
key = "paused"
value = "true"
image = ExtResource("8_vlg72")
color = Color(0.991606, 1, 0.496144, 1)
[node name="BuildButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")]
position = Vector2(28, 32)
key = "upgrade_menu"
value = "true"
image = ExtResource("9_5s7ww")
color = Color(0.680476, 1, 0.652914, 1)
[node name="QuitButton" parent="Control/TopRight" instance=ExtResource("7_gchpm")]
position = Vector2(28, 51)
key = "quit"
value = "value"
image = ExtResource("8_ytenc")
color = Color(1, 0.734185, 0.691036, 1)
[node name="PauseMenu" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("8_bnf8a")
[node name="ActionButton" parent="PauseMenu" instance=ExtResource("9_pynn5")]
position = Vector2(160, 96)
key = "paused"
value = "false"
[node name="ColorRect" type="ColorRect" parent="PauseMenu"]
[node name="PauseText" type="Control" parent="Control"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 0.458824)
theme = ExtResource("1_k6a0m")
script = ExtResource("7_gi2gs")
[node name="RichTextLabel" type="RichTextLabel" parent="Control/PauseText"]
clip_contents = false
layout_mode = 1
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -124.0
offset_top = 9.0
offset_right = -4.0
offset_bottom = 49.0
grow_horizontal = 0
pivot_offset = Vector2(58, 4)
bbcode_enabled = true
text = "[center][smallwave]Game Paused"
custom_effects = [SubResource("RichTextEffect_a7xgu")]

View file

@ -2,6 +2,7 @@ extends Node2D
@export var key: String
@export var value: String
@export var image: Texture2D
@export var alt_image: Texture2D
@export var color: Color
var size_tween
@ -12,7 +13,18 @@ func _ready() -> void:
sprite_2d.texture = image
func _on_mouse_handler_clicked() -> void:
Persister.persist_data(key, value)
if value == "toggle":
var old_value = Persister.get_value(key)
Persister.persist_data(key, not old_value)
if alt_image:
if old_value:
sprite_2d.texture = image
else:
sprite_2d.texture = alt_image
else:
Persister.persist_data(key, value)
func _on_mouse_handler_hovered() -> void:

BIN
src/ui/resume.aseprite Normal file

Binary file not shown.

BIN
src/ui/resume.png Normal file

Binary file not shown.

After

(image error) Size: 146 B

34
src/ui/resume.png.import Normal file
View file

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

Binary file not shown.

BIN
src/ui/upgrade-close.png Normal file

Binary file not shown.

After

(image error) Size: 176 B

View file

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

View file

@ -10,6 +10,10 @@ var key
const CREATURE = preload("res://src/Creature.tscn")
func _ready() -> void:
var window_size = get_tree().root.get_window().size
get_window().position = Vector2i(randi_range(250, window_size.x - 250 - 200), randi_range(250, window_size.y - 250 - 200)) + DisplayServer.screen_get_position(0)
title = data.name
sprite_2d.texture = image
sprite_2d.position = Vector2(int(data.size[0]) * 12 / 2, int(data.size[1]) * 12 / 2)
@ -18,3 +22,17 @@ func _ready() -> void:
new_creature.position = Vector2(50, 50)
new_creature.key = "1x1-1"
add_child(new_creature)
#
#New Zones
#
#- Get More Customers
#- Creatures drop resources more often
#- Resources randomly spawn more often
#- More wild creatures spawn
#- Closing time is 10 minutes later
#- More chance for creatures to drop a large amount at once
#- Customers are willing to pay more
#- Less chance of thieves
#- Chance for rich customer