stop watering if plant has enough water

This commit is contained in:
zoe 2022-01-23 20:13:52 +01:00
parent 2abfa54906
commit cc347d3766
10 changed files with 56 additions and 9 deletions

View File

@ -0,0 +1,3 @@
source_md5="fbfefef2a65ed1a7a9c92b489749044f"
dest_md5="693b134ec89e539e9df9c309685e9619"

BIN
Music/Talk.wav Normal file

Binary file not shown.

21
Music/Talk.wav.import Normal file
View File

@ -0,0 +1,21 @@
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/Talk.wav-fb28b520dfe4921bc9c03a8382a0798d.sample"
[deps]
source_file="res://Music/Talk.wav"
dest_files=[ "res://.import/Talk.wav-fb28b520dfe4921bc9c03a8382a0798d.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=false
compress/mode=0

View File

@ -7,6 +7,12 @@ func _on_WateringCan_pressed():
$Timer.start(0.1)
$WaterParticles.emitting = true
if !watering:
$Timer.stop()
$WaterParticles.emitting = false
stop_watering()
func on_enough_water():
watering = false
stop_watering()
func stop_watering():
$Timer.stop()
$WaterParticles.emitting = false

View File

@ -17,7 +17,6 @@ color = Color( 0.341176, 0.337255, 0.756863, 1 )
[node name="GoodAndWellBalancedWaterParticles" type="Particles2D"]
position = Vector2( 0, -3 )
z_index = 2
emitting = false
amount = 32
lifetime = 2.0
explosiveness = 1.0

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=28 format=2]
[gd_scene load_steps=30 format=2]
[ext_resource path="res://World/Plant.tscn" type="PackedScene" id=1]
[ext_resource path="res://World/FullscreenButton.gd" type="Script" id=2]
@ -20,6 +20,7 @@
[ext_resource path="res://World/Clouds.gd" type="Script" id=18]
[ext_resource path="res://Aseprite/sfx.png" type="Texture" id=19]
[ext_resource path="res://Aseprite/sfx-hover.png" type="Texture" id=20]
[ext_resource path="res://Music/Talk.wav" type="AudioStream" id=21]
[sub_resource type="Theme" id=7]
@ -55,6 +56,14 @@ orbit_velocity = 0.0
orbit_velocity_random = 0.0
color = Color( 0.341176, 0.337255, 0.756863, 1 )
[sub_resource type="Environment" id=14]
background_mode = 4
glow_enabled = true
glow_levels/4 = true
glow_levels/5 = false
glow_levels/7 = true
glow_bloom = 0.34
[node name="Main" type="Node2D"]
[node name="Plant" parent="." instance=ExtResource( 1 )]
@ -165,7 +174,7 @@ __meta__ = {
material = SubResource( 3 )
margin_left = 1.0
margin_top = 1.0
margin_right = 105.0
margin_right = 106.0
margin_bottom = 124.0
theme = ExtResource( 5 )
custom_colors/default_color = Color( 0.94902, 0.988235, 0.878431, 1 )
@ -183,6 +192,10 @@ wait_time = 0.05
[node name="MessageTimer" type="Timer" parent="RightPanel/Terminal"]
[node name="Talk" type="AudioStreamPlayer" parent="RightPanel/Terminal"]
stream = ExtResource( 21 )
bus = "SFX"
[node name="WateringCan" type="TextureButton" parent="RightPanel"]
margin_left = 1.0
margin_top = 125.0
@ -209,7 +222,11 @@ amount = 15
lifetime = 0.5
process_material = SubResource( 13 )
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource( 14 )
[connection signal="good_water" from="Plant" to="PlantBackground/Pot" method="_on_Plant_good_water"]
[connection signal="good_water" from="Plant" to="RightPanel/WateringCan" method="on_enough_water"]
[connection signal="has_need" from="Plant" to="RightPanel/Terminal" method="_on_Plant_has_need"]
[connection signal="timeout" from="PlantBackground/Clouds/Timer" to="PlantBackground/Clouds" method="_on_Timer_timeout"]
[connection signal="pressed" from="Options/FullscreenButton" to="Options/FullscreenButton" method="_on_FullscreenButton_pressed"]

View File

@ -25,7 +25,6 @@ var water_msg_good = [
"When i'm happy i grow [shake rate=10 level=2]flowers[/shake]!",
"I'm [wave amp=24 freq=2]way[/wave] bigger than the flowers outside :)"
]
var social = [
"You ever think about bees?",
"You like [wave amp=24 freq=2]Jazz[/wave]?",
@ -79,6 +78,8 @@ func print_message(mesage):
func _on_Reveal_timeout() -> void:
if visible_characters <= text.length():
visible_characters += 1
$Talk.play(0)
$Talk.pitch_scale = rand_range(0.7, 1.3)
else: $Reveal.stop()

View File

@ -6,11 +6,11 @@ bus/1/name = "Music"
bus/1/solo = false
bus/1/mute = false
bus/1/bypass_fx = false
bus/1/volume_db = -80.0
bus/1/volume_db = -11.952
bus/1/send = "Master"
bus/2/name = "SFX"
bus/2/solo = false
bus/2/mute = false
bus/2/bypass_fx = false
bus/2/volume_db = 0.0
bus/2/volume_db = -11.9576
bus/2/send = "Master"

View File

@ -18,7 +18,7 @@ custom_template/release=""
variant/export_type=0
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=true
html/export_icon=true
html/export_icon=false
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2