24 lines
525 B
GDScript
24 lines
525 B
GDScript
extends Node2D
|
|
|
|
var t: float = -1
|
|
var paused: bool = false
|
|
@export var stepSize: float = 20
|
|
@export var ant: Sprite2D
|
|
@export var tiles: TileMapLayer
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready() -> void:
|
|
pass
|
|
|
|
func _input(event):
|
|
if event.is_action_pressed("togglePause"):
|
|
paused = !paused
|
|
|
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
func _process(delta: float) -> void:
|
|
if paused: return
|
|
|
|
t += delta
|
|
if (t > stepSize/1000):
|
|
t = 0
|
|
ant.update()
|