From 39df6cd554bdcab2cc176882a4886723baf2ae88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Melvin=20Wei=C3=9F?= Date: Tue, 23 Sep 2025 12:36:15 +0200 Subject: [PATCH] Unlocked framerate --- enemies/boss/blob.gd | 2 +- enemies/boss/blob_big.gd | 2 +- enemies/boss/boss.gd | 7 ++++--- enemies/ghost/ghost.gd | 2 +- enemies/leech/leech.gd | 2 +- enemies/leech/segment.gd | 2 +- items/active_items/bow/arrow.gd | 2 +- items/active_items/horizontal_dash/horizontal_dash.gd | 2 +- items/generic/item.gd | 2 +- player/player.gd | 6 ++++-- player/sword.gd | 2 +- traps/morning_star.gd | 2 +- utils/earth_aligner.gd | 2 +- 13 files changed, 19 insertions(+), 16 deletions(-) diff --git a/enemies/boss/blob.gd b/enemies/boss/blob.gd index 7b3c037..5e8fe50 100644 --- a/enemies/boss/blob.gd +++ b/enemies/boss/blob.gd @@ -13,7 +13,7 @@ func _ready() -> void: await get_tree().create_timer(1).timeout moving = true -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if moving: position += (target - global_position).normalized().rotated(-get_parent().rotation) * speed * delta if((global_position - target).length() < 40): diff --git a/enemies/boss/blob_big.gd b/enemies/boss/blob_big.gd index 04062ea..78f9c11 100644 --- a/enemies/boss/blob_big.gd +++ b/enemies/boss/blob_big.gd @@ -18,7 +18,7 @@ func _ready() -> void: child.connect("target_reached", _on_target_reached) $SplashSound.play() -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if ready_blobs == num_blobs: position += (player.position - position).normalized() * speed * delta rotate(angular_speed * delta) diff --git a/enemies/boss/boss.gd b/enemies/boss/boss.gd index 09288dd..0f1277a 100644 --- a/enemies/boss/boss.gd +++ b/enemies/boss/boss.gd @@ -30,16 +30,17 @@ func choose_next_move() -> String: pool.append("wave") return ["slam", "wave", "splash"].pick_random() -func _physics_process(delta: float) -> void: +func _process(_delta: float) -> void: if dead: return - up_direction = earthaligner.global_from_local(Vector2.UP) if attack_ready: attack_ready = false call(choose_next_move()) +func _physics_process(delta: float) -> void: + if dead: return + up_direction = earthaligner.global_from_local(Vector2.UP) if(is_on_floor()): grounded.emit() - if idle_move: move_idle(delta) if($Hitbox.overlaps_body(player)): player.hurt(damage, self.position - player.position) diff --git a/enemies/ghost/ghost.gd b/enemies/ghost/ghost.gd index 90fb052..119d714 100644 --- a/enemies/ghost/ghost.gd +++ b/enemies/ghost/ghost.gd @@ -14,7 +14,7 @@ func _ready() -> void: player = get_tree().get_root().get_node_or_null("main/Player") $AnimatedSprite2D.play("default") -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if !is_instance_valid(player): return diff --git a/enemies/leech/leech.gd b/enemies/leech/leech.gd index 7b3def3..467a72a 100644 --- a/enemies/leech/leech.gd +++ b/enemies/leech/leech.gd @@ -15,7 +15,7 @@ func _ready() -> void: for segment in segments: segment.segment_damaged.connect(hurt) -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if dead: return if not $RayCast2D2.has_overlapping_bodies(): position += 200 * delta * $EarthAligner.global_from_local(Vector2.DOWN) diff --git a/enemies/leech/segment.gd b/enemies/leech/segment.gd index f6a3b65..54061bf 100644 --- a/enemies/leech/segment.gd +++ b/enemies/leech/segment.gd @@ -4,7 +4,7 @@ var damage = 1 signal segment_damaged -func _physics_process(_delta: float) -> void: +func _process(_delta: float) -> void: if (player != null and overlaps_body(player)): player.hurt(damage, self.global_position-player.global_position) diff --git a/items/active_items/bow/arrow.gd b/items/active_items/bow/arrow.gd index 69e848c..cc9a2a4 100644 --- a/items/active_items/bow/arrow.gd +++ b/items/active_items/bow/arrow.gd @@ -4,7 +4,7 @@ var damage = 20 var direction = Vector2(1,0) @export var speed = 2000 -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: self.position += delta * speed * direction for area in get_overlapping_areas(): area.hurt(damage, -3 * direction) diff --git a/items/active_items/horizontal_dash/horizontal_dash.gd b/items/active_items/horizontal_dash/horizontal_dash.gd index c905682..a9cc308 100644 --- a/items/active_items/horizontal_dash/horizontal_dash.gd +++ b/items/active_items/horizontal_dash/horizontal_dash.gd @@ -4,7 +4,7 @@ var dash_time = 0.15 var dashing = 0 var dash_dir -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: super(delta) if dashing > 0: dashing -= delta diff --git a/items/generic/item.gd b/items/generic/item.gd index 61b4862..6e9d407 100644 --- a/items/generic/item.gd +++ b/items/generic/item.gd @@ -2,7 +2,7 @@ class_name Item extends Area2D @onready var player = get_tree().get_root().get_node_or_null("main/Player") var collected = false -func _physics_process(_delta: float) -> void: +func _process(_delta: float) -> void: if(is_instance_valid(player) and overlaps_body(player)): if(self.has_method("collect") and collect()): set_deferred("monitoring", false) diff --git a/player/player.gd b/player/player.gd index cebc8fe..ca09017 100644 --- a/player/player.gd +++ b/player/player.gd @@ -72,13 +72,15 @@ func _ready() -> void: health_changed.emit(current_hp) func _physics_process(delta: float) -> void: + manage_velocity(delta) + move_and_slide() + +func _process(delta: float) -> void: manage_iframes(delta) manage_movement_options() manage_active(delta) manage_animation() manage_attack(delta) - manage_velocity(delta) - move_and_slide() func manage_iframes(delta: float): if(inv_time > 0): diff --git a/player/sword.gd b/player/sword.gd index b273ff0..e9dec69 100644 --- a/player/sword.gd +++ b/player/sword.gd @@ -24,7 +24,7 @@ func swing(dir_str) -> void: await get_tree().create_timer(0.01).timeout slash_timer = slash_duration -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: if slash_timer > 0: slash_timer = max(0, slash_timer-delta) if(slash_timer == 0): diff --git a/traps/morning_star.gd b/traps/morning_star.gd index 6d5cf31..384e93b 100644 --- a/traps/morning_star.gd +++ b/traps/morning_star.gd @@ -8,7 +8,7 @@ func _ready() -> void: rotate(randf() * TAU) anglespeed = anglespeed * (2 * randi_range(0,1) - 1) -func _physics_process(delta: float) -> void: +func _process(delta: float) -> void: rotate(anglespeed * delta * TAU) for target in ball.get_overlapping_areas(): damage_target(target) diff --git a/utils/earth_aligner.gd b/utils/earth_aligner.gd index 94cb1e0..4778d6d 100644 --- a/utils/earth_aligner.gd +++ b/utils/earth_aligner.gd @@ -8,7 +8,7 @@ func _ready() -> void: parent = get_parent() align() -func _physics_process(_delta: float) -> void: +func _process(_delta: float) -> void: align() func align():