Sound effects

This commit is contained in:
Felipe M 2021-05-23 00:38:30 +02:00
parent 6ea21b3181
commit 6671b455c4
Signed by: fmartingr
GPG key ID: 716BC147715E716F
17 changed files with 94 additions and 6 deletions

View file

@ -1,6 +1,7 @@
extends Powerup
func _pickup():
SoundFx.play_fx("Powerup", 1, -30)
PlayerStats.missiles_unlocked = true
PlayerStats.missiles += 1
queue_free()

View file

@ -123,6 +123,7 @@ func fire_missile():
PlayerStats.missiles -= 1
func create_dust_effect():
SoundFx.play_fx("Step", rand_range(0.6, 1.2), -30)
var dust_position = global_position
dust_position.x += rand_range(-4, 4)
Utils.instance_scene_on_main(DustEffect, dust_position)
@ -146,6 +147,7 @@ func update_snap_vector():
snap_vector = Vector2.DOWN
func jump(force):
SoundFx.play_fx("Jump", rand_range(0.6, 1.4), -20)
Utils.instance_scene_on_main(JumpEffect, global_position)
motion.y = -force
snap_vector = Vector2.ZERO
@ -225,6 +227,7 @@ func get_wall_axis():
func wall_slide_jump_check(wall_axis):
if Input.is_action_just_pressed("ui_select"):
SoundFx.play_fx("Jump", rand_range(0.8, 1.2), -20)
motion.x = wall_axis * max_speed
motion.y = -jump_force/1.25
state = MOVE
@ -262,6 +265,7 @@ func save():
func _on_Hurtbox_hit(damage):
if not invincible:
SoundFx.play_fx("Hurt", 1, -20)
PlayerStats.health -= damage
blinkAnimator.play("Blink")
SaverLoader.custom_data.health = PlayerStats.health

View file

@ -2,4 +2,5 @@ extends "res://Scenes/Objects/Proyectile.gd"
func _ready():
# Do not run _process()
SoundFx.play_fx("Bullet", rand_range(0.6, 1.4), -20)
set_process(false)

View file

@ -6,7 +6,8 @@ const BRICK_LAYER_BIT = 4
func _ready():
pass # Replace with function body.
SoundFx.play_fx("Explosion", 1.5)
pass
func _on_Hitbox_body_entered(body):
if body.get_collision_layer_bit(BRICK_LAYER_BIT):