mirror of
https://git.kittycat.homes/BatHeartTiger/untitled-plant-game.git
synced 2024-08-15 03:16:27 +00:00
watering :)
This commit is contained in:
parent
b7670afa78
commit
b3774be296
19 changed files with 380 additions and 6 deletions
12
Tools/WateringCan.gd
Normal file
12
Tools/WateringCan.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends TextureButton
|
||||
var watering = false
|
||||
|
||||
func _on_WateringCan_pressed():
|
||||
watering = !watering
|
||||
if watering:
|
||||
$Timer.start(1)
|
||||
$Particles2D.emitting = true
|
||||
if !watering:
|
||||
$Timer.stop()
|
||||
$Particles2D.emitting = false
|
||||
|
40
Tools/WateringCan.tscn
Normal file
40
Tools/WateringCan.tscn
Normal file
|
@ -0,0 +1,40 @@
|
|||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://Menu/WateringCan.gd" type="Script" id=1]
|
||||
[ext_resource path="res://Aseprite/wateringcan.png" type="Texture" id=2]
|
||||
|
||||
[sub_resource type="CapsuleShape2D" id=1]
|
||||
radius = 8.0
|
||||
height = 0.0
|
||||
|
||||
[sub_resource type="ParticlesMaterial" id=2]
|
||||
flag_disable_z = true
|
||||
direction = Vector3( -1, 0, 0 )
|
||||
gravity = Vector3( 0, 10, 0 )
|
||||
initial_velocity = 5.0
|
||||
orbit_velocity = 0.0
|
||||
orbit_velocity_random = 0.0
|
||||
color = Color( 0.341176, 0.337255, 0.756863, 1 )
|
||||
|
||||
[node name="WateringCan" type="Area2D"]
|
||||
collision_mask = 2
|
||||
script = ExtResource( 1 )
|
||||
|
||||
[node name="Sprite" type="Sprite" parent="."]
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||
position = Vector2( 0, 1 )
|
||||
shape = SubResource( 1 )
|
||||
|
||||
[node name="Particles2D" type="Particles2D" parent="."]
|
||||
position = Vector2( -7, -4 )
|
||||
emitting = false
|
||||
amount = 25
|
||||
lifetime = 10.0
|
||||
process_material = SubResource( 2 )
|
||||
|
||||
[connection signal="area_entered" from="." to="." method="_on_WateringCan_area_entered"]
|
||||
[connection signal="area_exited" from="." to="." method="_on_WateringCan_area_exited"]
|
||||
[connection signal="mouse_entered" from="." to="." method="_on_WateringCan_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="." method="_on_WateringCan_mouse_exited"]
|
Loading…
Add table
Add a link
Reference in a new issue