From ad773f68eb845c16663f258abb76c92f757d5b25 Mon Sep 17 00:00:00 2001 From: veclavtalica Date: Wed, 12 Feb 2025 05:28:48 +0300 Subject: [PATCH] grow sprouts ! --- assets/sprout.png | Bin 345 -> 0 bytes assets/sprout1.png | Bin 0 -> 993 bytes .../{sprout.png.import => sprout1.png.import} | 6 ++-- assets/sprout2.png | Bin 0 -> 1052 bytes assets/sprout2.png.import | 34 ++++++++++++++++++ assets/sprout3.png | Bin 0 -> 1127 bytes assets/sprout3.png.import | 34 ++++++++++++++++++ src/ingame/sprout.gd | 27 ++++++++++---- src/ingame/sprout.tscn | 7 ++-- 9 files changed, 96 insertions(+), 12 deletions(-) delete mode 100644 assets/sprout.png create mode 100644 assets/sprout1.png rename assets/{sprout.png.import => sprout1.png.import} (73%) create mode 100644 assets/sprout2.png create mode 100644 assets/sprout2.png.import create mode 100644 assets/sprout3.png create mode 100644 assets/sprout3.png.import diff --git a/assets/sprout.png b/assets/sprout.png deleted file mode 100644 index 3637fad6b9e8b90cc40e3636869e36a74b13cb3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmV-f0jBPx$6G=otR9J=Wmdz1@Kn#T=V;5)}_MtQ0Xv7LE1a8h~AGU#Ypa*9$%Vt9ovR?Gv zV1M4XNj3oR*RN}3T6Nw(qvzAjwhsVQ)`gL#Kt%zN*|w|5_hkW)`es-RVb0w&5`8m# z#uPPSkHCV$^8r8*Nh-bufFP{$xrP974Jf3if9&E)-`wAOgrZbNL_T?HOsTEu_Y9N_ zAa`mCs;$R@OwvMt=m3H-C$2vb5N<_C8HDS}b<6n^;V?@gkTJ@2OL+t|=Exu@cTMFH z&;npF{}1I-Ak=&c3Yh8uuq4e$DO)FWjEZif0uZ_s6sU(aH+VUuIX^OE9q@ZjIw2Ng{gvoE~~?85AkqY_8FtQ?w{$4^u5&rN{< zs)7hC+EqY71egEiDtud7P9G@pTA!^FV^MgF=oZu&1&qSm>@Wr}0W1xsfN5YAWTO-h z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bA5AGve{1Ks|~-Fw+Tpvu;7 literal 0 HcmV?d00001 diff --git a/assets/sprout2.png.import b/assets/sprout2.png.import new file mode 100644 index 0000000..b20ba83 --- /dev/null +++ b/assets/sprout2.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cry83nqqrybsl" +path="res://.godot/imported/sprout2.png-78a96837ad5731e502156d9c69e4b8bd.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprout2.png" +dest_files=["res://.godot/imported/sprout2.png-78a96837ad5731e502156d9c69e4b8bd.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 diff --git a/assets/sprout3.png b/assets/sprout3.png new file mode 100644 index 0000000000000000000000000000000000000000..69e0cbd3a1d38559c9d58cd2ead40dca4879afa3 GIT binary patch literal 1127 zcmZXSe@q)?7{|Xrli~PbH8Vr4raDk`s4(l+KPu3T4l0yzu&NCsTQd){9~V=k&N?vL zCElQB)wqQ}8dKPXblNF1jp#>cnJEG8z;z4v~e z=gqy}`#w)^Q)6wx%7<10D6rSnG_$vnJ=M86Y;9IEvvcgfm+0%;OyGHD8!Am)w_ z2moOq4vYb_89@dzn91ZM&O?Hqq%g?|Qed^h<$}ipNkS-uSPZI)beetLMVgm1KT(LZ zI8l;lg57GgqRa)e2Q~>@2yHR!RN+mtei;H}3K16}Ax{1z$>XF|3@T8NExAGILg6WGaU)K5ap5dAkD@=1TlO1mhBl@wkIjmghF;W zwqb`C@4Sx>kK))#oEpUsQ<$AzJvZ~*?{l@+7q%_lcx&m;z-=x37b#=}$^f%YXV1@d zuF|`WMV`{)ZgZJrGY4Ich|m@ny~&_I6_w{zg=SMmBP?j?th-bZ z%_9Ma+UK4Kd#9p-*+h70EWyran*P7|tgGw4Nj77GAh20tYi01qR>oPK&5bRnp1#!1 z;NDK#tDP-xw0G`xckrm~aJRp`Za{9?#Y(sBHP$V4z26+EFHDr@)|`2*UrWU*hN@0q z8En3I;puO`-oG%Q?|$XjuHDmh`>J~J%j@-r4p$!?TY34nryku{^2xcGyw9I_zP0-C z)4M;NIkEWcK#>koQ~%ZvqWbT~H#O8`ZFp?&`G6W0Mb5|1nW` zzF@Jo;ga5SPjtA@sQc>vTZ8Me4-V^Jdb4Y?C;R4sU(cRBRI%cjzbp6reC7L}HV>c5 zTbo1utuNx;O;;zmk`9x5;@X9iy6XiUd3zSKUpD9MKcLxHGZ$dDHP#Gm+%EnDR_^@R literal 0 HcmV?d00001 diff --git a/assets/sprout3.png.import b/assets/sprout3.png.import new file mode 100644 index 0000000..9f25e01 --- /dev/null +++ b/assets/sprout3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://4kt11i2bobre" +path="res://.godot/imported/sprout3.png-0beb960d42dc411ef10af15a6f1954b4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprout3.png" +dest_files=["res://.godot/imported/sprout3.png-0beb960d42dc411ef10af15a6f1954b4.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 diff --git a/src/ingame/sprout.gd b/src/ingame/sprout.gd index f35a65f..b2730ed 100644 --- a/src/ingame/sprout.gd +++ b/src/ingame/sprout.gd @@ -2,8 +2,11 @@ extends Node3D @export var _need_water_drop: Sprite3D @export var _production_timer: Timer +@export var _sprite: Sprite3D var needs_water := true +var stage: int = 1 +var final_stage: int = 3 func _ready() -> void: @@ -17,16 +20,26 @@ func _on_production_timer_timeout() -> void: @rpc("authority", "call_local", "reliable") -func _reflect_combo() -> void: - GameState.fetch().player_data[multiplayer.get_unique_id()].chain_water_combo(1) +func _reflect_texture(p_stage: int) -> void: + _sprite.texture = load("res://assets/sprout%s.png" % p_stage) + + +@rpc("authority", "call_local", "reliable") +func _water_shared(sender_id: int) -> void: + if stage >= final_stage: + return + stage += 1 + _sprite.texture = load("res://assets/sprout%s.png" % stage) + if sender_id != 0: + GameState.fetch().player_data[sender_id].chain_water_combo(1) @rpc("any_peer", "call_local", "reliable") func water(sender_id: int) -> void: if needs_water: - needs_water = false + _water_shared.rpc(sender_id) _need_water_drop.hide() - if sender_id != 0: - _reflect_combo.rpc_id(sender_id) - - _production_timer.start() + + if stage != final_stage: + needs_water = false + _production_timer.start() diff --git a/src/ingame/sprout.tscn b/src/ingame/sprout.tscn index 4e0cee5..e61cbd1 100644 --- a/src/ingame/sprout.tscn +++ b/src/ingame/sprout.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=3 uid="uid://bysgtksvovyur"] [ext_resource type="Script" path="res://src/ingame/sprout.gd" id="1_snma1"] -[ext_resource type="Texture2D" uid="uid://d35y5ckne72qe" path="res://assets/sprout.png" id="2_ipgad"] +[ext_resource type="Texture2D" uid="uid://d35y5ckne72qe" path="res://assets/sprout1.png" id="2_ipgad"] [ext_resource type="Texture2D" uid="uid://cwbl0r1e26eja" path="res://assets/drop.png" id="3_kghdv"] [sub_resource type="SceneReplicationConfig" id="SceneReplicationConfig_rs2qp"] @@ -16,16 +16,18 @@ properties/1/replication_mode = 2 radius = 0.3 height = 0.8 -[node name="Sprout" type="Node3D" node_paths=PackedStringArray("_need_water_drop", "_production_timer")] +[node name="Sprout" type="Node3D" node_paths=PackedStringArray("_need_water_drop", "_production_timer", "_sprite")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00401986, -0.00383317, 0.00119042) script = ExtResource("1_snma1") _need_water_drop = NodePath("NeedWaterDrop") _production_timer = NodePath("ProductionTimer") +_sprite = NodePath("Sprite3D") [node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."] replication_config = SubResource("SceneReplicationConfig_rs2qp") [node name="Sprite3D" type="Sprite3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0) pixel_size = 0.02 billboard = 2 shaded = true @@ -49,6 +51,7 @@ monitoring = false shape = SubResource("CapsuleShape3D_cwbye") [node name="ProductionTimer" type="Timer" parent="."] +wait_time = 5.0 one_shot = true [connection signal="timeout" from="ProductionTimer" to="." method="_on_production_timer_timeout"]