mirror of
https://github.com/Steffo99/hella-farm.git
synced 2024-11-22 08:04:23 +00:00
14 lines
236 B
GDScript3
14 lines
236 B
GDScript3
|
extends Sprite2D
|
||
|
class_name SpriteLeftRight
|
||
|
|
||
|
|
||
|
@export var left_texture: Texture2D
|
||
|
@export var right_texture: Texture2D
|
||
|
|
||
|
|
||
|
func handle_move(movement: Vector2):
|
||
|
if movement.x > 0:
|
||
|
texture = right_texture
|
||
|
else:
|
||
|
texture = left_texture
|