chore: run gdformat on all gdscript files
This commit is contained in:
@@ -14,6 +14,7 @@ var dead: bool = false
|
||||
var death_anim_done: bool = false
|
||||
var god_mode: bool = false
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
camera.position = global_position
|
||||
movement_speed = default_movement_speed
|
||||
@@ -22,6 +23,7 @@ func _ready() -> void:
|
||||
main_ui.player_ui.set_hp(100)
|
||||
GlobalConst.sig_debug_god_mode.connect(toggle_god_mode)
|
||||
|
||||
|
||||
func _physics_process(delta: float) -> void:
|
||||
if dead:
|
||||
return
|
||||
@@ -29,12 +31,14 @@ func _physics_process(delta: float) -> void:
|
||||
velocity = input_direction * movement_speed
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _process(delta: float) -> void:
|
||||
camera.position_smoothing_enabled = true
|
||||
camera.position = global_position
|
||||
if dead and !death_anim_done:
|
||||
death_animation(delta)
|
||||
|
||||
|
||||
func take_damage(value: float) -> void:
|
||||
if dead or god_mode:
|
||||
return
|
||||
@@ -48,6 +52,7 @@ func take_damage(value: float) -> void:
|
||||
if health <= 0:
|
||||
die()
|
||||
|
||||
|
||||
func die():
|
||||
dead = true
|
||||
remove_from_group("damagable")
|
||||
@@ -56,14 +61,16 @@ func die():
|
||||
sprite_2d.z_index += 10
|
||||
get_taunted()
|
||||
|
||||
|
||||
func death_animation(delta: float):
|
||||
# Engine.time_scale = clampf(lerpf(Engine.time_scale, 0.25, 0.5), 0.25, 0.9*delta)
|
||||
camera.zoom = lerp(camera.zoom, Vector2(8,8), 0.99*delta)
|
||||
rotation_degrees = lerpf(rotation_degrees, 90, 0.99*delta)
|
||||
camera.zoom = lerp(camera.zoom, Vector2(8, 8), 0.99 * delta)
|
||||
rotation_degrees = lerpf(rotation_degrees, 90, 0.99 * delta)
|
||||
if rotation_degrees > 88:
|
||||
main_ui.pause_ui.toggle_pause_ui()
|
||||
death_anim_done = true
|
||||
|
||||
|
||||
func get_taunted():
|
||||
var taunting_enemies: Array[Enemy] = []
|
||||
for body in get_tree().get_nodes_in_group(GlobalConst.GROUP_ENEMY):
|
||||
@@ -80,8 +87,7 @@ func get_taunted():
|
||||
add_child(new_target)
|
||||
new_target.add_child(collision)
|
||||
taunting_enemies[i].target = new_target
|
||||
|
||||
|
||||
|
||||
func toggle_god_mode(value: bool):
|
||||
god_mode = value
|
||||
|
||||
|
Reference in New Issue
Block a user