From 217f0ab18c6802f1050db7943e17b7395c00c136 Mon Sep 17 00:00:00 2001 From: Dan Date: Sat, 1 Jun 2024 20:05:16 +0100 Subject: [PATCH] Increased Glowling speed and added delta time scaling Significant changes include: - The Glowling entity's speed has been quadrupled from 10 to 40. - The _process function now scales the movement speed by the elapsed time (delta) for smoother motion. - VSync mode has been disabled in project settings. --- entities/scripts/glowling.gd | 6 +++--- project.godot | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/entities/scripts/glowling.gd b/entities/scripts/glowling.gd index 1632ae7..fcbf240 100644 --- a/entities/scripts/glowling.gd +++ b/entities/scripts/glowling.gd @@ -4,19 +4,19 @@ class_name Glowling @onready var tilemap = $"../TileMap" # This needs rectifying var current_path : Array[Vector2i] = [] -var speed : int = 10 +var speed : int = 40 func _ready(): $GlowlingAnimations.play("GlowingPulse") pass # Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(_delta): +func _process(delta): if current_path.is_empty(): return var target_position = tilemap.map_to_local(current_path.front()) - global_position = global_position.move_toward(target_position, speed) + global_position = global_position.move_toward(target_position, speed * delta) if global_position == target_position: current_path.pop_front() diff --git a/project.godot b/project.godot index 17b9601..6df6e49 100644 --- a/project.godot +++ b/project.godot @@ -20,6 +20,7 @@ config/icon="res://icon.svg" window/stretch/mode="canvas_items" window/stretch/scale=2.0 window/stretch/scale_mode="integer" +window/vsync/vsync_mode=0 [editor_plugins]