From dd07f52e34dcca98cd38c8be14f1afe64ebb7727 Mon Sep 17 00:00:00 2001 From: SondreElg Date: Sat, 4 Oct 2025 17:23:23 +0200 Subject: [PATCH] fix: virus --- growth/player.gd | 2 +- growth/project.godot | 2 +- growth/virus.gd | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/growth/player.gd b/growth/player.gd index 7a6227a..1dbb81d 100644 --- a/growth/player.gd +++ b/growth/player.gd @@ -4,7 +4,7 @@ extends Node2D enum ActionState {None, Cycling, Firing, Charging} enum MoveState {Still, Moving, Dashing, Knockback} -@export var speed = 100 # How fast the player will move (pixels/sec). +@export var speed = 200 # How fast the player will move (pixels/sec). @export var dash_cooldown = 0.3 @export var hand_size = 3 diff --git a/growth/project.godot b/growth/project.godot index c3aba4e..b674a6e 100644 --- a/growth/project.godot +++ b/growth/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="growth" -run/main_scene="uid://dhhnr3xkxbxlu" +run/main_scene="uid://c5qbqj52kr0aw" config/features=PackedStringArray("4.5", "GL Compatibility") config/icon="res://icon.svg" diff --git a/growth/virus.gd b/growth/virus.gd index a34fc1f..8a4bed9 100644 --- a/growth/virus.gd +++ b/growth/virus.gd @@ -13,7 +13,7 @@ enum ActionState {Blocked, Waiting, Running} var spawning_state var action_state -var targets # who the virus will attack +var targets = [] # who the virus will attack func _ready(): self.spawning_state = SpawningState.Spawning @@ -22,13 +22,13 @@ func _ready(): func _process(delta): if self.spawning_state != SpawningState.Spawned: return # do nothing if not yet spawned - if len(self.targets) == 0: + if self.targets.size() == 0: return # do nothing if no set targets # --- determine nearest target var nearest_target = self.targets[0] var shortest_distance = 0 - for i in range(1, len(self.targets)): + for i in range(1, self.targets.size()): var target = self.targets[i] var distance = self.position.distance_to(target) if distance < shortest_distance: