Add upgrade polish

This commit is contained in:
Ategon 2024-10-07 14:53:09 -04:00
parent 1b2ee1a076
commit e1dc13186f
61 changed files with 765 additions and 84 deletions

BIN
Bossa Monstra.wav Normal file

Binary file not shown.

24
Bossa Monstra.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://br26r6ck51wa1"
path="res://.godot/imported/Bossa Monstra.wav-80ccc0aa331392d0ad6a586bd68ad167.sample"
[deps]
source_file="res://Bossa Monstra.wav"
dest_files=["res://.godot/imported/Bossa Monstra.wav-80ccc0aa331392d0ad6a586bd68ad167.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=2
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=3 uid="uid://bs6ojoud4mvb8"]
[gd_scene load_steps=6 format=3 uid="uid://bs6ojoud4mvb8"]
[ext_resource type="Script" path="res://main.gd" id="1_x66oe"]
[ext_resource type="PackedScene" uid="uid://ccdhbljb3e0oh" path="res://src/ui/MainUI.tscn" id="2_anen6"]
[ext_resource type="PackedScene" uid="uid://cr2nvts234wlw" path="res://src/manager/TimeManager.tscn" id="2_rrhko"]
[ext_resource type="Texture2D" uid="uid://c37jv23kd15ay" path="res://parts/zones/images/home.png" id="3_kjcur"]
[ext_resource type="AudioStream" uid="uid://br26r6ck51wa1" path="res://Bossa Monstra.wav" id="5_qgck0"]
[node name="Main" type="Node2D"]
script = ExtResource("1_x66oe")
@ -21,4 +22,9 @@ texture = ExtResource("3_kjcur")
one_shot = true
autostart = true
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_qgck0")
volume_db = -18.0
autoplay = true
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]

View file

@ -1,7 +1,10 @@
[gd_scene load_steps=4 format=3 uid="uid://qecwga1b4yqn"]
[gd_scene load_steps=7 format=3 uid="uid://qecwga1b4yqn"]
[ext_resource type="Script" path="res://components/Cursor/cursor.gd" id="1_nmkwm"]
[ext_resource type="Texture2D" uid="uid://kd8031vdmxb8" path="res://components/Cursor/normal-1.png" id="2_ucp64"]
[ext_resource type="AudioStream" uid="uid://b1625im32ajr2" path="res://sfx/error can't put down creature.wav" id="3_68rl2"]
[ext_resource type="AudioStream" uid="uid://da4gfw2de7at" path="res://sfx/put down.wav" id="4_vcjyr"]
[ext_resource type="AudioStream" uid="uid://bqn8ygvwt58sg" path="res://sfx/pick up.wav" id="5_mmqlh"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_4cq27"]
size = Vector2(8, 8)
@ -21,5 +24,17 @@ visible = false
position = Vector2(2, 4)
texture = ExtResource("2_ucp64")
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_68rl2")
volume_db = -10.0
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
stream = ExtResource("4_vcjyr")
volume_db = -10.0
[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_mmqlh")
volume_db = -10.0
[connection signal="area_entered" from="MouseControl" to="." method="_on_mouse_control_area_entered"]
[connection signal="area_exited" from="MouseControl" to="." method="_on_mouse_control_area_exited"]

View file

@ -3,6 +3,9 @@ extends Base
@onready var mouse_control = $"MouseControl"
@onready var sprite_2d: Sprite2D = $MouseControl/Sprite2D
@onready var audio_stream_player: AudioStreamPlayer = $AudioStreamPlayer
@onready var audio_stream_player_2: AudioStreamPlayer = $AudioStreamPlayer2
@onready var audio_stream_player_3: AudioStreamPlayer = $AudioStreamPlayer3
const CURSOR_UI = preload("res://components/Cursor/hover-1.png")
const CURSOR_HOLD = preload("res://components/Cursor/grab-1.png")
@ -35,15 +38,18 @@ func _on_hovered(_data):
func _on_grab_creature(data):
print("GRAB")
grabbed_creature = CREATURE.instantiate()
grabbed_creature.key = data.creature
grabbed_creature.held = true
mouse_control.add_child(grabbed_creature)
grabbed_creature.position = Vector2(0, 0)
holding = true
original_window = data.old_window
original_position = data.old_position
if get_window().get_window_id() == 0:
audio_stream_player_3.play()
func let_go():
if holding and grabbed_creature:
@ -55,6 +61,11 @@ func let_go():
if get_window().get_window_id() == 0:
Persister.persist_data("grabbing", false)
if Persister.get_value("hovered"):
audio_stream_player_2.play()
else:
audio_stream_player.play()
if signal_object and signal_object.mouse_in_window:
var new_creature = CREATURE.instantiate()
@ -69,7 +80,6 @@ func let_go():
holding = false
func _on_release():
print("RElEASED %d" % [get_window().get_window_id()])
let_go()
Triggerer.trigger("released")

View file

@ -11,7 +11,11 @@ const CREATURE_WINDOW = preload("res://src/CreatureWindow.tscn")
var build_object
@onready var upgrade_pool = Data.data.upgrades.keys()
@onready var zone_pool = Data.data.zones.keys()
func _ready() -> void:
Persister.persist_data("creature_resource_spawn_rate", 20)
Triggerer.listen("spawn_window", _on_spawn_window)
Triggerer.listen("upgrade_menu", _on_build_menu)
Triggerer.listen("quit", _on_quit)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bl05hcd2ar2ll"
path="res://.godot/imported/desert-card.png-e335f9eddfa9f3531de5f481124a9c76.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://parts/upgrades/desert-card.png"
dest_files=["res://.godot/imported/desert-card.png-e335f9eddfa9f3531de5f481124a9c76.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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bngkfdcgy2otl"
path="res://.godot/imported/farm-card.png-ecd5b35304ba445d31b38267506de42a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://parts/upgrades/farm-card.png"
dest_files=["res://.godot/imported/farm-card.png-ecd5b35304ba445d31b38267506de42a.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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://yu8t3dse0fna"
path="res://.godot/imported/forest-card.png-3c330302bd800bf858d4887b2fde7b5a.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://parts/upgrades/forest-card.png"
dest_files=["res://.godot/imported/forest-card.png-3c330302bd800bf858d4887b2fde7b5a.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
parts/upgrades/generic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://3wxvvlillymm"
path="res://.godot/imported/generic.png-6d708915b524f5c1c5b0b9ff07bd2832.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://parts/upgrades/generic.png"
dest_files=["res://.godot/imported/generic.png-6d708915b524f5c1c5b0b9ff07bd2832.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.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dl3vu6127bcac"
path="res://.godot/imported/lake-card.png-1ac024f66ddfca36a54f522ade24ff20.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://parts/upgrades/lake-card.png"
dest_files=["res://.godot/imported/lake-card.png-1ac024f66ddfca36a54f522ade24ff20.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

@ -1,6 +1,6 @@
name: Creature Resources
description: More chance for a creature to drop a resource every day
key: creature_resource_spawn_rate
name: Coins Galore
description: 10% higher chance for a creature to drop coins every hour
property: creature_resource_spawn_rate
type: percent
amount: 10
cost: 10

View file

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

View file

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

View file

@ -1,6 +0,0 @@
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

@ -2,4 +2,4 @@ name: Desert
size[]
6
6
description: Test
description: A zone for creatures to live in

View file

@ -2,4 +2,4 @@ name: Farm
size[]
6
5
description: Test
description: A zone for creatures to live in

View file

@ -2,4 +2,4 @@ name: Forest
size[]
5
6
description: Test
description: A zone for creatures to live in

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 659 B

After

Width:  |  Height:  |  Size: 730 B

View file

@ -2,4 +2,4 @@ name: Lake
size[]
7
4
description: Test
description: A zone for creatures to live in

BIN
sfx/UI Click 1.wav Normal file

Binary file not shown.

24
sfx/UI Click 1.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bikfuvnt3i2ui"
path="res://.godot/imported/UI Click 1.wav-b49ab8bf741ef77b72a6e9abac747506.sample"
[deps]
source_file="res://sfx/UI Click 1.wav"
dest_files=["res://.godot/imported/UI Click 1.wav-b49ab8bf741ef77b72a6e9abac747506.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/UI Click 2.wav Normal file

Binary file not shown.

24
sfx/UI Click 2.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://c06j2q7c0j6br"
path="res://.godot/imported/UI Click 2.wav-8e082e1b42bb7db7f66d38d001e76a84.sample"
[deps]
source_file="res://sfx/UI Click 2.wav"
dest_files=["res://.godot/imported/UI Click 2.wav-8e082e1b42bb7db7f66d38d001e76a84.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/UI Click 3.wav Normal file

Binary file not shown.

24
sfx/UI Click 3.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://co8mnuoislrta"
path="res://.godot/imported/UI Click 3.wav-3dac3c87a3a0b6e1da524ef814b33844.sample"
[deps]
source_file="res://sfx/UI Click 3.wav"
dest_files=["res://.godot/imported/UI Click 3.wav-3dac3c87a3a0b6e1da524ef814b33844.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/buying upgrade.wav Normal file

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://fi4ero6v8pon"
path="res://.godot/imported/buying upgrade.wav-b9f7a86d04cbdf851620837e93c4279d.sample"
[deps]
source_file="res://sfx/buying upgrade.wav"
dest_files=["res://.godot/imported/buying upgrade.wav-b9f7a86d04cbdf851620837e93c4279d.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://b1625im32ajr2"
path="res://.godot/imported/error can't put down creature.wav-752b6692e56dcaa8f15222534089b4b0.sample"
[deps]
source_file="res://sfx/error can't put down creature.wav"
dest_files=["res://.godot/imported/error can't put down creature.wav-752b6692e56dcaa8f15222534089b4b0.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/pick up.wav Normal file

Binary file not shown.

24
sfx/pick up.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bqn8ygvwt58sg"
path="res://.godot/imported/pick up.wav-be58fc83294b6a965fd854e69a6f3152.sample"
[deps]
source_file="res://sfx/pick up.wav"
dest_files=["res://.godot/imported/pick up.wav-be58fc83294b6a965fd854e69a6f3152.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/purchasing new zone.wav Normal file

Binary file not shown.

View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://bhdbbteejyprf"
path="res://.godot/imported/purchasing new zone.wav-af19e12d7a4a4f087cb0e493c95a875b.sample"
[deps]
source_file="res://sfx/purchasing new zone.wav"
dest_files=["res://.godot/imported/purchasing new zone.wav-af19e12d7a4a4f087cb0e493c95a875b.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

BIN
sfx/put down.wav Normal file

Binary file not shown.

24
sfx/put down.wav.import Normal file
View file

@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://da4gfw2de7at"
path="res://.godot/imported/put down.wav-c12c6b231c6628af3c5b232cecfaa83d.sample"
[deps]
source_file="res://sfx/put down.wav"
dest_files=["res://.godot/imported/put down.wav-c12c6b231c6628af3c5b232cecfaa83d.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=0

View file

@ -1,10 +1,16 @@
[gd_scene load_steps=8 format=3 uid="uid://rfc6w6wnl1c2"]
[gd_scene load_steps=14 format=3 uid="uid://rfc6w6wnl1c2"]
[ext_resource type="PackedScene" uid="uid://5g4mecc4tb6f" path="res://NoCreMouseSignals.tscn" id="1_33eve"]
[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"]
[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="4_3uk60"]
[ext_resource type="AudioStream" uid="uid://fi4ero6v8pon" path="res://sfx/buying upgrade.wav" id="6_wvbe0"]
[ext_resource type="Texture2D" uid="uid://3wxvvlillymm" path="res://parts/upgrades/generic.png" id="6_yrfvb"]
[ext_resource type="AudioStream" uid="uid://bhdbbteejyprf" path="res://sfx/purchasing new zone.wav" id="7_wsmt1"]
[ext_resource type="AudioStream" uid="uid://b1625im32ajr2" path="res://sfx/error can't put down creature.wav" id="8_csgwn"]
[ext_resource type="AudioStream" uid="uid://bikfuvnt3i2ui" path="res://sfx/UI Click 1.wav" id="9_fxutd"]
[ext_resource type="Texture2D" uid="uid://5by2gsqdfjju" path="res://wall.png" id="10_up40o"]
[sub_resource type="RichTextEffect" id="RichTextEffect_lhkb8"]
script = ExtResource("3_0qyx5")
@ -16,9 +22,15 @@ size = Vector2(52, 73)
canvas_item_default_texture_filter = 0
position = Vector2i(0, 36)
size = Vector2i(900, 500)
unresizable = true
always_on_top = true
content_scale_factor = 4.0
[node name="Sprite2D" type="Sprite2D" parent="."]
modulate = Color(0.572988, 0.572988, 0.572988, 1)
position = Vector2(112, 62)
texture = ExtResource("10_up40o")
[node name="MouseSignals" parent="." instance=ExtResource("1_33eve")]
[node name="Control" type="Control" parent="."]
@ -32,7 +44,7 @@ theme = ExtResource("1_ta3q3")
script = ExtResource("1_y8qy0")
[node name="RichTextLabel" type="RichTextLabel" parent="Control"]
modulate = Color(0.559673, 1, 0.532353, 1)
modulate = Color(1, 1, 0.533333, 1)
clip_contents = false
layout_mode = 1
anchors_preset = 5
@ -47,7 +59,7 @@ bbcode_enabled = true
text = "[smallwave][center]Upgrades"
custom_effects = [SubResource("RichTextEffect_lhkb8")]
[node name="RichTextLabel2" type="RichTextLabel" parent="Control"]
[node name="DescriptionText" type="RichTextLabel" parent="Control"]
modulate = Color(0.633757, 0.633757, 0.633757, 1)
clip_contents = false
layout_mode = 1
@ -62,25 +74,17 @@ 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"]
[node name="Upgrade" type="TextureRect" parent="Control"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
offset_left = 27.5
offset_top = 42.5
offset_right = 59.5
offset_bottom = 82.5
pivot_offset = Vector2(16, 20)
texture = ExtResource("6_yrfvb")
[node name="Card1Title" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade"]
[node name="Card1Title" type="RichTextLabel" parent="Control/Upgrade"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
@ -90,7 +94,7 @@ offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="Card1Cost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade"]
[node name="Card1Cost" type="RichTextLabel" parent="Control/Upgrade"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
@ -101,17 +105,23 @@ offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"
[node name="MouseHandler" parent="Control/HBoxContainer/Upgrade" instance=ExtResource("4_3uk60")]
[node name="MouseHandler" parent="Control/Upgrade" instance=ExtResource("4_3uk60")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/HBoxContainer/Upgrade/MouseHandler"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/Upgrade/MouseHandler"]
position = Vector2(16.5, 20)
shape = SubResource("RectangleShape2D_ehvvg")
[node name="Upgrade2" type="ColorRect" parent="Control/HBoxContainer"]
[node name="Upgrade2" type="TextureRect" parent="Control"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
offset_left = 96.5
offset_top = 42.5
offset_right = 128.5
offset_bottom = 82.5
pivot_offset = Vector2(16, 20)
texture = ExtResource("6_yrfvb")
[node name="Card2Title" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade2"]
[node name="Card2Title" type="RichTextLabel" parent="Control/Upgrade2"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
@ -121,7 +131,7 @@ offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="Card2Cost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade2"]
[node name="Card2Cost" type="RichTextLabel" parent="Control/Upgrade2"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
@ -132,17 +142,23 @@ offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"
[node name="MouseHandler2" parent="Control/HBoxContainer/Upgrade2" instance=ExtResource("4_3uk60")]
[node name="MouseHandler2" parent="Control/Upgrade2" instance=ExtResource("4_3uk60")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/HBoxContainer/Upgrade2/MouseHandler2"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/Upgrade2/MouseHandler2"]
position = Vector2(16.5, 20)
shape = SubResource("RectangleShape2D_ehvvg")
[node name="Upgrade3" type="ColorRect" parent="Control/HBoxContainer"]
[node name="Upgrade3" type="TextureRect" parent="Control"]
custom_minimum_size = Vector2(32, 40)
layout_mode = 2
offset_left = 165.5
offset_top = 42.5
offset_right = 197.5
offset_bottom = 82.5
pivot_offset = Vector2(16, 20)
texture = ExtResource("6_yrfvb")
[node name="ZoneTitle" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade3"]
[node name="ZoneTitle" type="RichTextLabel" parent="Control/Upgrade3"]
clip_contents = false
layout_mode = 0
offset_left = -22.885
@ -152,7 +168,7 @@ offset_bottom = 27.685
bbcode_enabled = true
text = "[center]Test Title"
[node name="ZoneCost" type="RichTextLabel" parent="Control/HBoxContainer/Upgrade3"]
[node name="ZoneCost" type="RichTextLabel" parent="Control/Upgrade3"]
modulate = Color(1, 0.812823, 0.471338, 1)
clip_contents = false
layout_mode = 0
@ -163,12 +179,34 @@ offset_bottom = 86.24
bbcode_enabled = true
text = "[center]20G"
[node name="MouseHandler3" parent="Control/HBoxContainer/Upgrade3" instance=ExtResource("4_3uk60")]
[node name="MouseHandler3" parent="Control/Upgrade3" instance=ExtResource("4_3uk60")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/HBoxContainer/Upgrade3/MouseHandler3"]
[node name="CollisionShape2D" type="CollisionShape2D" parent="Control/Upgrade3/MouseHandler3"]
position = Vector2(16.5, 20)
shape = SubResource("RectangleShape2D_ehvvg")
[connection signal="clicked" from="Control/HBoxContainer/Upgrade/MouseHandler" to="Control" method="_on_mouse_handler_clicked"]
[connection signal="clicked" from="Control/HBoxContainer/Upgrade2/MouseHandler2" to="Control" method="_on_mouse_handler_2_clicked"]
[connection signal="clicked" from="Control/HBoxContainer/Upgrade3/MouseHandler3" to="Control" method="_on_mouse_handler_3_clicked"]
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
stream = ExtResource("6_wvbe0")
volume_db = -10.0
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="."]
stream = ExtResource("7_wsmt1")
volume_db = -15.0
[node name="AudioStreamPlayer3" type="AudioStreamPlayer" parent="."]
stream = ExtResource("8_csgwn")
volume_db = -10.0
[node name="AudioStreamPlayer4" type="AudioStreamPlayer" parent="."]
stream = ExtResource("9_fxutd")
volume_db = 5.0
[connection signal="clicked" from="Control/Upgrade/MouseHandler" to="Control" method="_on_mouse_handler_clicked"]
[connection signal="hovered" from="Control/Upgrade/MouseHandler" to="Control" method="_on_mouse_handler_hovered"]
[connection signal="unhovered" from="Control/Upgrade/MouseHandler" to="Control" method="_on_mouse_handler_unhovered"]
[connection signal="clicked" from="Control/Upgrade2/MouseHandler2" to="Control" method="_on_mouse_handler_2_clicked"]
[connection signal="hovered" from="Control/Upgrade2/MouseHandler2" to="Control" method="_on_mouse_handler_2_hovered"]
[connection signal="unhovered" from="Control/Upgrade2/MouseHandler2" to="Control" method="_on_mouse_handler_unhovered"]
[connection signal="clicked" from="Control/Upgrade3/MouseHandler3" to="Control" method="_on_mouse_handler_3_clicked"]
[connection signal="hovered" from="Control/Upgrade3/MouseHandler3" to="Control" method="_on_mouse_handler_3_hovered"]
[connection signal="unhovered" from="Control/Upgrade3/MouseHandler3" to="Control" method="_on_mouse_handler_unhovered"]

21
src/Coin.tscn Normal file
View file

@ -0,0 +1,21 @@
[gd_scene load_steps=5 format=3 uid="uid://dyd3gq1oc117t"]
[ext_resource type="PackedScene" uid="uid://dykc1mgg5uopw" path="res://components/Cursor/MouseHandler.tscn" id="1_53keb"]
[ext_resource type="Script" path="res://src/coin.gd" id="1_l62nl"]
[ext_resource type="Texture2D" uid="uid://cndrtahwhbkli" path="res://src/ui/coin.png" id="2_5qokh"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_6mwyk"]
size = Vector2(8, 8)
[node name="Coin" type="Node2D"]
script = ExtResource("1_l62nl")
[node name="MouseHandler" parent="." instance=ExtResource("1_53keb")]
[node name="CollisionShape2D" type="CollisionShape2D" parent="MouseHandler"]
shape = SubResource("RectangleShape2D_6mwyk")
[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("2_5qokh")
[connection signal="hovered" from="MouseHandler" to="." method="_on_mouse_handler_hovered"]

View file

@ -1,15 +1,21 @@
[gd_scene load_steps=3 format=3 uid="uid://dcaqcebxdrgu7"]
[gd_scene load_steps=4 format=3 uid="uid://dcaqcebxdrgu7"]
[ext_resource type="Script" path="res://src/creature_window.gd" id="1_eufhm"]
[ext_resource type="PackedScene" uid="uid://dcmh5yv0fjmsb" path="res://MouseSignals.tscn" id="2_3cu4o"]
[ext_resource type="Texture2D" uid="uid://deip0unwxcqno" path="res://wild.png" id="3_bxvic"]
[node name="CreatureWindow" type="Window"]
canvas_item_default_texture_filter = 0
position = Vector2i(0, 36)
size = Vector2i(300, 300)
unresizable = true
always_on_top = true
content_scale_factor = 4.0
[node name="Sprite2D" type="Sprite2D" parent="."]
position = Vector2(37.5, 37.5)
texture = ExtResource("3_bxvic")
[node name="Node2D" type="Node2D" parent="."]
script = ExtResource("1_eufhm")

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=8 format=3 uid="uid://dmsrxabynq46i"]
[gd_scene load_steps=10 format=3 uid="uid://dmsrxabynq46i"]
[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"]
@ -7,6 +7,8 @@
[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"]
[ext_resource type="AudioStream" uid="uid://c06j2q7c0j6br" path="res://sfx/UI Click 2.wav" id="8_roeob"]
[ext_resource type="AudioStream" uid="uid://co8mnuoislrta" path="res://sfx/UI Click 3.wav" id="9_fsyho"]
[node name="UiButtons" type="Window"]
transparent_bg = true
@ -29,13 +31,15 @@ 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")]
[node name="BuildButton" parent="Node2D" node_paths=PackedStringArray("on_stream", "off_stream") 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)
on_stream = NodePath("../AudioStreamPlayer")
off_stream = NodePath("../AudioStreamPlayer2")
[node name="QuitButton" parent="Node2D" instance=ExtResource("1_ydcg5")]
position = Vector2(28, 51)
@ -43,3 +47,9 @@ key = "quit"
value = "value"
image = ExtResource("4_6jhet")
color = Color(1, 0.734185, 0.691036, 1)
[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="Node2D"]
stream = ExtResource("8_roeob")
[node name="AudioStreamPlayer2" type="AudioStreamPlayer" parent="Node2D"]
stream = ExtResource("9_fsyho")

View file

@ -1,22 +1,27 @@
extends Control
var upgrade_pool = Data.data.upgrades.keys()
var zone_pool = Data.data.zones.keys()
@onready var cards = [
{
"title": $HBoxContainer/Upgrade/Card1Title,
"cost": $HBoxContainer/Upgrade/Card1Cost
"title": $Upgrade/Card1Title,
"cost": $Upgrade/Card1Cost,
"object": $Upgrade
},
{
"title": $HBoxContainer/Upgrade2/Card2Title,
"cost": $HBoxContainer/Upgrade2/Card2Cost
"title": $Upgrade2/Card2Title,
"cost": $Upgrade2/Card2Cost,
"object": $Upgrade2
},
{
"title": $HBoxContainer/Upgrade3/ZoneTitle,
"cost": $HBoxContainer/Upgrade3/ZoneCost
"title": $Upgrade3/ZoneTitle,
"cost": $Upgrade3/ZoneCost,
"object": $Upgrade3
}
]
@onready var description_text: RichTextLabel = $DescriptionText
@onready var audio_stream_player: AudioStreamPlayer = $"../AudioStreamPlayer"
@onready var audio_stream_player_2: AudioStreamPlayer = $"../AudioStreamPlayer2"
@onready var audio_stream_player_3: AudioStreamPlayer = $"../AudioStreamPlayer3"
@onready var audio_stream_player_4: AudioStreamPlayer = $"../AudioStreamPlayer4"
var chosen_cards = [
null,
@ -24,10 +29,35 @@ var chosen_cards = [
null
]
@onready var main = get_tree().root.get_child(7)
var tweens = [
null,
null,
null
]
var buy_tweens = [
null,
null,
null
]
var cost_tweens = [
null,
null,
null
]
var buying = [
false,
false,
false
]
func _ready() -> void:
upgrade_pool.shuffle()
zone_pool.shuffle()
Persister.change_value("gold", 100) # TEMP
main.upgrade_pool.shuffle()
main.zone_pool.shuffle()
var screen_size = DisplayServer.screen_get_size(0)
@ -46,17 +76,18 @@ func _update_card(index):
var cost
if index == 2:
if zone_pool.size() == 0:
zone_pool = Data.data.zones.keys()
zone_pool.shuffle()
choice = zone_pool.pop_back()
if main.zone_pool.size() == 0:
main.zone_pool = Data.data.zones.keys()
main.zone_pool.shuffle()
choice = main.zone_pool.pop_back()
card_data = Data.data.zones[choice]
cost = 20
cards[index].object.texture = Data.data.images["%s-card" % [choice]]
else:
if upgrade_pool.size() == 0:
upgrade_pool = Data.data.upgrades.keys()
upgrade_pool.shuffle()
choice = upgrade_pool.pop_back()
if main.upgrade_pool.size() == 0:
main.upgrade_pool = Data.data.upgrades.keys()
main.upgrade_pool.shuffle()
choice = main.upgrade_pool.pop_back()
card_data = Data.data.upgrades[choice]
cost = card_data.cost
@ -78,11 +109,84 @@ func _on_mouse_handler_3_clicked() -> void:
_buy_upgrade(2)
func _hover_upgrade(index):
audio_stream_player_4.play()
var card_data = chosen_cards[index]
description_text.text = "[center]%s" % [card_data.description]
if tweens[index]:
tweens[index].kill
tweens[index] = create_tween()
tweens[index].set_ease(Tween.EASE_OUT)
tweens[index].set_trans(Tween.TRANS_BACK)
tweens[index].set_parallel()
tweens[index].tween_property(cards[index].title, "modulate", Color.GOLD, 0.25)
tweens[index].tween_property(cards[index].object, "position:y", 35, 0.25)
func _buy_upgrade(index):
if buying[index]:
return
var card_data = chosen_cards[index]
if Persister.get_value("gold", PersisterEnums.Scope.UNKNOWN, 0) >= (card_data.cost if card_data.has("cost") else 20):
Persister.change_value("gold", -(card_data.cost if card_data.has("cost") else 20))
_update_card(index)
buying[index] = true
if buy_tweens[index]:
buy_tweens[index].kill()
buy_tweens[index] = create_tween()
buy_tweens[index].tween_property(cards[index].object, "scale:x", 0, 0.125)
buy_tweens[index].tween_callback(func():
_update_card(index)
)
buy_tweens[index].tween_property(cards[index].object, "scale:x", 1, 0.125)
buy_tweens[index].tween_callback(func():
buying[index] = false
)
if index == 2:
Triggerer.trigger("spawn_window", {"key": card_data.key})
audio_stream_player_2.play()
else:
Persister.change_value(card_data.property, card_data.amount)
audio_stream_player.play()
else:
audio_stream_player_3.play()
if cost_tweens[index]:
cost_tweens[index].kill()
cost_tweens[index] = create_tween()
cost_tweens[index].tween_property(cards[index].cost, "modulate", Color.RED, 0.125)
cost_tweens[index].tween_property(cards[index].cost, "modulate", Color.html("#ffcf78"), 0.125)
func _on_mouse_handler_hovered() -> void:
_hover_upgrade(0)
func _on_mouse_handler_2_hovered() -> void:
_hover_upgrade(1)
func _on_mouse_handler_3_hovered() -> void:
_hover_upgrade(2)
func _on_mouse_handler_unhovered() -> void:
description_text.text = ""
for index in range(0, 3):
if tweens[index]:
tweens[index].kill
tweens[index] = create_tween()
tweens[index].set_ease(Tween.EASE_OUT)
tweens[index].set_trans(Tween.TRANS_QUAD)
tweens[index].set_parallel()
tweens[index].tween_property(cards[index].title, "modulate", Color.WHITE, 0.25)
tweens[index].tween_property(cards[index].object, "position:y", 42.5, 0.25)

6
src/coin.gd Normal file
View file

@ -0,0 +1,6 @@
extends Node2D
func _on_mouse_handler_hovered() -> void:
Persister.change_value("gold", 1)
queue_free()

View file

@ -7,9 +7,20 @@ var key
@onready var sprite_2d: Sprite2D = $Sprite2D
const COIN = preload("res://src/Coin.tscn")
var held = false
func _ready() -> void:
sprite_2d.texture = image
Triggerer.listen("hour", _on_hour)
func _on_hour(_data):
if not held and randf() < (Persister.get_value("creature_resource_spawn_rate") / 100.0):
var new_coin = COIN.instantiate()
new_coin.global_position = global_position
get_window().add_child(new_coin)
func _on_mouse_handler_clicked() -> void:

View file

@ -4,6 +4,8 @@ extends Node2D
@export var image: Texture2D
@export var alt_image: Texture2D
@export var color: Color
@export var on_stream: AudioStreamPlayer
@export var off_stream: AudioStreamPlayer
var size_tween
@ -23,6 +25,11 @@ func _on_mouse_handler_clicked() -> void:
sprite_2d.texture = image
else:
sprite_2d.texture = alt_image
if old_value and on_stream:
on_stream.play()
elif not old_value and off_stream:
off_stream.play()
else:
Persister.persist_data(key, value)

BIN
wall.aseprite Normal file

Binary file not shown.

BIN
wall.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 576 B

34
wall.png.import Normal file
View file

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

BIN
wild.aseprite Normal file

Binary file not shown.

BIN
wild.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

34
wild.png.import Normal file
View file

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://deip0unwxcqno"
path="res://.godot/imported/wild.png-3d1a4abd36cfbc7788377fee4951f545.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://wild.png"
dest_files=["res://.godot/imported/wild.png-3d1a4abd36cfbc7788377fee4951f545.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