plant needs and adds
This commit was merged in pull request #5.
This commit is contained in:
@@ -12,6 +12,7 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_6gq27")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
@@ -28,9 +29,11 @@ theme_override_constants/margin_bottom = 20
|
||||
|
||||
[node name="SeedQueue" parent="MarginContainer" instance=ExtResource("1_lh8u1")]
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="SeedCard" parent="MarginContainer" instance=ExtResource("2_bt3vo")]
|
||||
layout_mode = 2
|
||||
mouse_filter = 1
|
||||
|
||||
[node name="ScannerModes" parent="MarginContainer" instance=ExtResource("3_bsm7r")]
|
||||
layout_mode = 2
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
class_name Planter
|
||||
|
||||
extends Node2D
|
||||
|
||||
@export var plants: Array[PlantType]
|
||||
|
||||
@onready var plant_scene = preload("res://objects/plant.tscn")
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event is InputEventMouseButton and event.pressed:
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
var chosen_type: PlantType = plants[randi_range(0, plants.size() - 1)]
|
||||
var plant = plant_scene.instantiate()
|
||||
add_child(plant)
|
||||
plant.init(chosen_type, event.position)
|
||||
plant.plant(event.position)
|
||||
@@ -34,21 +34,25 @@ script = ExtResource("1_orxwo")
|
||||
|
||||
[node name="Data" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
z_index = 5
|
||||
centered = false
|
||||
|
||||
[node name="Fertility" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
z_index = 5
|
||||
material = SubResource("ShaderMaterial_05bn7")
|
||||
centered = false
|
||||
|
||||
[node name="Water" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
z_index = 5
|
||||
material = SubResource("ShaderMaterial_lpu5x")
|
||||
texture = SubResource("GradientTexture2D_a7oi7")
|
||||
centered = false
|
||||
|
||||
[node name="Presence" type="Sprite2D" parent="."]
|
||||
visible = false
|
||||
z_index = 5
|
||||
material = SubResource("ShaderMaterial_0lkln")
|
||||
texture = SubResource("GradientTexture2D_a7oi7")
|
||||
centered = false
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bus7qrxwn2ck1"]
|
||||
|
||||
[ext_resource type="Script" path="res://scenes/Planter.gd" id="1_l04h8"]
|
||||
[ext_resource type="Script" path="res://scripts/planter.gd" id="1_l04h8"]
|
||||
[ext_resource type="Script" path="res://scripts/plant_type.gd" id="2_6g58k"]
|
||||
[ext_resource type="Resource" uid="uid://bgi2lo7kb3d2v" path="res://objects/plant_types/chardon.tres" id="3_vfbum"]
|
||||
[ext_resource type="Resource" uid="uid://dnahox31xqy6l" path="res://objects/plant_types/peuplier.tres" id="4_aqqqx"]
|
||||
|
||||
Reference in New Issue
Block a user