fix camera shake intensities (20x) so shake is actually visible

main
Artur David 2026-06-18 10:31:00 +02:00
parent 376930483a
commit 4780d9ae36
2 changed files with 8 additions and 7 deletions

View File

@ -6,6 +6,7 @@ const FLASH_FADE_DURATION := 0.6
@onready var summon_circle: AnimatedSprite2D = $SummonCircle/AnimatedSprite2D @onready var summon_circle: AnimatedSprite2D = $SummonCircle/AnimatedSprite2D
func _ready() -> void: func _ready() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
summon_circle.sprite_frames = summon_circle.sprite_frames.duplicate() summon_circle.sprite_frames = summon_circle.sprite_frames.duplicate()
summon_circle.sprite_frames.set_animation_loop("default", false) summon_circle.sprite_frames.set_animation_loop("default", false)
summon_circle.animation_finished.connect(_unleash) summon_circle.animation_finished.connect(_unleash)
@ -13,7 +14,7 @@ func _ready() -> void:
func _unleash() -> void: func _unleash() -> void:
var camera = get_node("/root/Game/Camera2D") var camera = get_node("/root/Game/Camera2D")
camera.shake(0.5, 1.5) camera.shake(0.5, 30)
for enemy in get_tree().get_nodes_in_group("enemies"): for enemy in get_tree().get_nodes_in_group("enemies"):
if not is_instance_valid(enemy): if not is_instance_valid(enemy):

View File

@ -69,7 +69,7 @@ func shoot_fireballs():
get_parent().add_child(fb) get_parent().add_child(fb)
fb.launch(enemy.global_position) fb.launch(enemy.global_position)
_play_fire_sfx() _play_fire_sfx()
camera.shake(0.15, 0.5) camera.shake(0.15, 10)
await get_tree().create_timer(0.12).timeout await get_tree().create_timer(0.12).timeout
$AnimatedSprite2D.play("south") $AnimatedSprite2D.play("south")
@ -92,7 +92,7 @@ func shoot_fire_swirl():
var fs = fire_swirl.instantiate() var fs = fire_swirl.instantiate()
fs.global_position = global_position fs.global_position = global_position
get_parent().add_child(fs) get_parent().add_child(fs)
camera.shake(0.3, 0.8) camera.shake(0.3, 16)
func shoot_shuriken(): func shoot_shuriken():
for i in range(shuriken_count): for i in range(shuriken_count):
@ -106,13 +106,13 @@ func shoot_tornado():
var tw = tornado.instantiate() var tw = tornado.instantiate()
tw.global_position = target.global_position if target != null else global_position tw.global_position = target.global_position if target != null else global_position
get_parent().add_child(tw) get_parent().add_child(tw)
camera.shake(0.3, 0.8) camera.shake(0.3, 16)
func shoot_laser(): func shoot_laser():
var ls = laser.instantiate() var ls = laser.instantiate()
ls.global_position = global_position ls.global_position = global_position
get_parent().add_child(ls) get_parent().add_child(ls)
camera.shake(0.4, 1.2) camera.shake(0.4, 24)
var asp = AudioStreamPlayer.new() var asp = AudioStreamPlayer.new()
asp.stream = _laser_sfx asp.stream = _laser_sfx
asp.volume_db = 6 asp.volume_db = 6
@ -125,7 +125,7 @@ func shoot_purge():
var pg = purge.instantiate() var pg = purge.instantiate()
pg.global_position = global_position pg.global_position = global_position
get_parent().add_child(pg) get_parent().add_child(pg)
camera.shake(0.3, 0.8) camera.shake(0.3, 16)
func take_damage(amount: int, attacker = null) -> void: func take_damage(amount: int, attacker = null) -> void:
if is_invincible: if is_invincible: