Unlocked framerate
This commit is contained in:
parent
28a6e98d3d
commit
39df6cd554
13 changed files with 19 additions and 16 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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():
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue