feat: reorganized logic + camera
This commit is contained in:
@@ -1,19 +1,24 @@
|
||||
extends Node2D
|
||||
|
||||
var t: float = 0
|
||||
@export var speed: float = 58
|
||||
@export var stepSize: float = 2
|
||||
@export var ant: Sprite2D
|
||||
@export var tiles: TileMapLayer
|
||||
var t: float = -1
|
||||
var paused: bool = false
|
||||
|
||||
# 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 > 60-speed):
|
||||
if (t > stepSize/100):
|
||||
t = 0
|
||||
ant.update()
|
||||
#tiles.render_next()
|
||||
|
||||
Reference in New Issue
Block a user