rotation rework, deletion of complex objects
This commit is contained in:
parent
609b1b976d
commit
8dcd7725a9
15 changed files with 103 additions and 147 deletions
12
scripts/structures/directional_sprite.gd
Normal file
12
scripts/structures/directional_sprite.gd
Normal file
|
@ -0,0 +1,12 @@
|
|||
extends Sprite2D
|
||||
|
||||
@export var textures : Array[Texture]
|
||||
@export var structure : Structure
|
||||
|
||||
func _ready() -> void:
|
||||
structure.changed_direction.connect(on_direction_changed)
|
||||
|
||||
func on_direction_changed(to: float, max_directions: int) -> void:
|
||||
var indexed_direction = to*max_directions/TAU
|
||||
|
||||
texture = textures[indexed_direction]
|
Loading…
Add table
Add a link
Reference in a new issue