* ajout d'un fondu de musique au changement de phase * résolution de bugs en tout genre
30 lines
661 B
GDScript
30 lines
661 B
GDScript
extends Area2D
|
|
class_name PlantInfluenceZone
|
|
|
|
var radius : int
|
|
var sprite : Circle
|
|
var collision_shape : CollisionShape2D
|
|
var show_influence : bool = false :
|
|
set(v):
|
|
show_influence = v
|
|
if sprite:
|
|
sprite.visible = v
|
|
|
|
func _init(_radius = 100):
|
|
radius = _radius
|
|
|
|
func _ready():
|
|
sprite = Circle.new()
|
|
# sprite.z_index = 100
|
|
sprite.radius = 100
|
|
sprite.fill = false
|
|
sprite.width = 1
|
|
sprite.opacity = 0.5
|
|
sprite.visible = show_influence
|
|
add_child(sprite)
|
|
|
|
collision_shape = CollisionShape2D.new()
|
|
var circle_shape : CircleShape2D = CircleShape2D.new()
|
|
circle_shape.radius = radius
|
|
collision_shape.shape = circle_shape
|
|
add_child(collision_shape) |