added background (pt 2) with mountains and clouds

This commit is contained in:
tess 2021-12-06 23:36:22 +01:00
parent 19d25de11a
commit c95d545a94
15 changed files with 185 additions and 31 deletions

10
World/Cloud.gd Normal file
View file

@ -0,0 +1,10 @@
extends Sprite
var direction = 0
func _physics_process(delta):
global_position += Vector2(direction, 0)
func _on_Timer_timeout():
queue_free()

14
World/Cloud.tscn Normal file
View file

@ -0,0 +1,14 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Aseprite/Cloud.png" type="Texture" id=1]
[ext_resource path="res://World/Cloud.gd" type="Script" id=2]
[node name="Cloud" type="Sprite"]
texture = ExtResource( 1 )
script = ExtResource( 2 )
[node name="Timer" type="Timer" parent="."]
wait_time = 20.0
autostart = true
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

25
World/Clouds.gd Normal file
View file

@ -0,0 +1,25 @@
extends Node2D
var size = Vector2(ProjectSettings.get_setting("display/window/size/width") / 2,
ProjectSettings.get_setting("display/window/size/height") - 80)
func _ready():
$Timer.wait_time = rand_range(15, 120)
$Timer.start()
func _on_Timer_timeout():
var Cloud = preload("res://World/Cloud.tscn")
var cloud = Cloud.instance()
add_child(cloud)
var pos
if randi() % 2 == 0:
pos = Vector2(0, randi() % int(size.y))
cloud.direction = 0.1
else:
pos = Vector2(size.x, randi() % int(size.y))
cloud.direction = -0.1
cloud.global_position = pos
$Timer.wait_time = rand_range(15,120)

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=24 format=2]
[gd_scene load_steps=26 format=2]
[ext_resource path="res://World/Plant.tscn" type="PackedScene" id=1]
[ext_resource path="res://World/FullscreenButton.gd" type="Script" id=2]
@ -16,6 +16,8 @@
[ext_resource path="res://Aseprite/wateringcanactive.png" type="Texture" id=14]
[ext_resource path="res://World/Pot.gd" type="Script" id=15]
[ext_resource path="res://Aseprite/Background.png" type="Texture" id=16]
[ext_resource path="res://Aseprite/Mountains.png" type="Texture" id=17]
[ext_resource path="res://World/Clouds.gd" type="Script" id=18]
[sub_resource type="Theme" id=7]
@ -55,11 +57,20 @@ color = Color( 0.341176, 0.337255, 0.756863, 1 )
[node name="Plant" parent="." instance=ExtResource( 1 )]
[node name="Blue" type="ColorRect" parent="."]
margin_left = 128.0
margin_right = 237.0
margin_bottom = 144.0
color = Color( 0.517647, 0.745098, 0.929412, 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Options" type="Panel" parent="."]
margin_left = 236.0
margin_top = 2.0
margin_right = 254.0
margin_bottom = 142.0
margin_left = 237.0
margin_top = 1.0
margin_right = 255.0
margin_bottom = 143.0
mouse_filter = 2
theme = SubResource( 7 )
custom_styles/panel = SubResource( 1 )
@ -69,9 +80,9 @@ __meta__ = {
[node name="FullscreenButton" type="TextureButton" parent="Options"]
margin_left = 1.0
margin_top = 123.0
margin_top = 125.0
margin_right = 17.0
margin_bottom = 139.0
margin_bottom = 141.0
texture_normal = ExtResource( 3 )
texture_hover = ExtResource( 4 )
script = ExtResource( 2 )
@ -81,9 +92,9 @@ __meta__ = {
[node name="MusicVolume" type="VSlider" parent="Options"]
margin_left = 1.0
margin_top = 62.0
margin_top = 63.0
margin_right = 17.0
margin_bottom = 122.0
margin_bottom = 124.0
custom_icons/tick = ExtResource( 7 )
custom_icons/grabber_disabled = ExtResource( 7 )
custom_icons/grabber_highlight = ExtResource( 8 )
@ -101,7 +112,7 @@ bus_channel = "Music"
margin_left = 1.0
margin_top = 1.0
margin_right = 17.0
margin_bottom = 61.0
margin_bottom = 62.0
rect_scale = Vector2( 1, 0.99844 )
custom_icons/tick = ExtResource( 7 )
custom_icons/grabber_disabled = ExtResource( 7 )
@ -116,11 +127,31 @@ __meta__ = {
}
bus_channel = "SFX"
[node name="Node2D" type="Node2D" parent="."]
[node name="Mountains" type="Sprite" parent="Node2D"]
position = Vector2( 64, 74 )
texture = ExtResource( 17 )
[node name="Clouds" type="Node2D" parent="Node2D"]
script = ExtResource( 18 )
[node name="Timer" type="Timer" parent="Node2D/Clouds"]
[node name="Background" type="Sprite" parent="Node2D"]
texture = ExtResource( 16 )
centered = false
[node name="Pot" type="Sprite" parent="Node2D"]
position = Vector2( 64, 135 )
texture = ExtResource( 9 )
script = ExtResource( 15 )
[node name="RightPanel" type="Panel" parent="."]
margin_left = 128.0
margin_top = 2.0
margin_right = 234.0
margin_bottom = 142.0
margin_left = 129.0
margin_top = 1.0
margin_right = 236.0
margin_bottom = 143.0
mouse_filter = 2
theme = SubResource( 7 )
custom_styles/panel = SubResource( 1 )
@ -151,10 +182,10 @@ wait_time = 0.05
[node name="MessageTimer" type="Timer" parent="RightPanel/Terminal"]
[node name="WateringCan" type="TextureButton" parent="RightPanel"]
margin_left = 2.0
margin_top = 122.0
margin_right = 19.0
margin_bottom = 139.0
margin_left = 1.0
margin_top = 125.0
margin_right = 18.0
margin_bottom = 142.0
texture_normal = ExtResource( 12 )
texture_pressed = ExtResource( 14 )
texture_hover = ExtResource( 14 )
@ -174,20 +205,12 @@ amount = 15
lifetime = 0.5
process_material = SubResource( 13 )
[node name="Background" type="Sprite" parent="."]
texture = ExtResource( 16 )
centered = false
[node name="Pot" type="Sprite" parent="."]
position = Vector2( 64, 135 )
texture = ExtResource( 9 )
script = ExtResource( 15 )
[connection signal="good_water" from="Plant" to="Pot" method="_on_Plant_good_water"]
[connection signal="good_water" from="Plant" to="Node2D/Pot" method="_on_Plant_good_water"]
[connection signal="has_need" from="Plant" to="RightPanel/Terminal" method="_on_Plant_has_need"]
[connection signal="pressed" from="Options/FullscreenButton" to="Options/FullscreenButton" method="_on_FullscreenButton_pressed"]
[connection signal="value_changed" from="Options/MusicVolume" to="Options/MusicVolume" method="_on_MusicVolume_value_changed"]
[connection signal="value_changed" from="Options/SFXVolume" to="Options/SFXVolume" method="_on_MusicVolume_value_changed"]
[connection signal="timeout" from="Node2D/Clouds/Timer" to="Node2D/Clouds" method="_on_Timer_timeout"]
[connection signal="was_social" from="RightPanel/Terminal" to="Plant" method="_on_Terminal_was_social"]
[connection signal="timeout" from="RightPanel/Terminal/Reveal" to="RightPanel/Terminal" method="_on_Reveal_timeout"]
[connection signal="timeout" from="RightPanel/Terminal/MessageTimer" to="RightPanel/Terminal" method="_on_MessageTimer_timeout"]

View file

@ -6,20 +6,24 @@ var last = "sample tess"
var water_msg_low = [
"Please water me :o",
"I'm THIRSTY i could drink a [shake rate=10 level=2]100!!![/shake] ... somethings"
"I'm THIRSTY i could drink a [shake rate=10 level=2]100!!![/shake] ... somethings",
"Water me!!!",
"I need more water!",
]
var water_msg_high = [
"EEE! Too wet!!!",
"The pot is like a swamp... :(",
"I need to dry!!!",
"Wet wet wet!!!! AAAAAA",
"Way too wet :( If this was nintendo ds game i would ask you to blow into the microphone, but [shake rate=10 level=2]NO![/shake]"
"Way too wet :( If this was nintendo ds game i would ask you to blow into the microphone, but [shake rate=10 level=2]NO![/shake]",
"I need a bit to dry.. Please don't water me for a while, okay?",
]
var water_msg_good = [
"Comfy wet soil :)",
"Thank you!!!",
"Thank you for taking such good care of me!",
"When i'm happy i grow [shake rate=10 level=2]flowers[/shake]!"
"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 = [
@ -32,6 +36,8 @@ var social = [
"Ladybirds play dead to avoid predators. Don't we all sometimes...",
"Do you ever forget if you already told someone something and then you just tell them like [shake rate=10 level=2]50 times[/shake]? Yeah.",
"If i had to fight someone i would simply look up the weaknesses section on their wikipedia page.",
"Do you wanna watch anime together?",
"I hope you had a nice day today!",
]
func _ready() -> void: