#42 ajout d'un inspecteur

This commit is contained in:
2025-08-21 14:29:49 +02:00
parent 52b2df8639
commit 49e16d12f8
19 changed files with 165 additions and 15 deletions

View File

@@ -99,7 +99,6 @@ script = ExtResource("1_pq8o7")
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.15, 0.15)
texture = ExtResource("2_hyinx")
offset = Vector2(0, -100)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {

View File

@@ -1,7 +1,7 @@
extends Area2D
extends InspectableEntity
class_name Plant
const PLANT_AREA_WIDTH = 10
const PLANT_AREA_WIDTH = 20
const HARVESTED_SEED_POSITION_RANGE = 100
const RANDOM_MAX_GROW_INTERVAL = 0.4
@@ -23,6 +23,11 @@ func _init(_plant_type = null, _planet = null):
plant_type = _plant_type
planet = _planet
func inspected_text():
var state_text = "Growing"
if state == State.MATURE: state_text = "Mature"
return state_text + " " + plant_type.name
func generate_sprite() -> PlantSprite:
var spriteObject : PlantSprite = SPRITE_SCENE.instantiate()