Skip to content

Commit

Permalink
Add sfx.
Browse files Browse the repository at this point in the history
  • Loading branch information
voithos committed Jul 17, 2022
1 parent 200236e commit 907e83a
Show file tree
Hide file tree
Showing 9 changed files with 60 additions and 5 deletions.
8 changes: 4 additions & 4 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# TODOs

- [ ] Main menu

- [ ] Play test
- [ ] Deploy builds

Polish:
- [ ] Finalize key mapping and GamePad mapping
- [ ] Add sfx
- [ ] Replace walk sfx
- [ ] Add gun sfx
Expand All @@ -21,6 +17,7 @@ Polish:
- [ ] Create core pickup sound effects + cutscene

Stretch:
- [ ] Ability to shoot enemy bullets
- [ ] Design complementary systems that augment the color bullets
- [ ] Colored enemy bullets that change your color too
- [ ] Rolling through a colored enemy or bullet grants you that color?
Expand Down Expand Up @@ -81,3 +78,6 @@ Scrapped:
- United states of color
- Monte Coloro
- [x] End screen
- [x] Main menu
- [x] Deploy builds
- [x] Finalize key mapping and GamePad mapping
Binary file added assets/sfx/jump.wavbak
Binary file not shown.
Binary file added assets/sfx/pew.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/sfx/pew.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/pew.wav-346437ca5473f3d0ebc0e75e97174ed1.sample"

[deps]

source_file="res://assets/sfx/pew.wav"
dest_files=[ "res://.import/pew.wav-346437ca5473f3d0ebc0e75e97174ed1.sample" ]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0
Binary file added assets/sfx/take_damage.wav
Binary file not shown.
21 changes: 21 additions & 0 deletions assets/sfx/take_damage.wav.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[remap]

importer="wav"
type="AudioStreamSample"
path="res://.import/take_damage.wav-a3417ef17cea9506893ebc2aacc0caed.sample"

[deps]

source_file="res://assets/sfx/take_damage.wav"
dest_files=[ "res://.import/take_damage.wav-a3417ef17cea9506893ebc2aacc0caed.sample" ]

[params]

force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop=false
compress/mode=0
7 changes: 7 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -85,36 +85,43 @@ debug={
move_left={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777231,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
]
}
move_right={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777233,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
]
}
move_up={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777232,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
]
}
move_down={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":16777234,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
]
}
jump={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
attack={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":90,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null)
]
}
roll={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":0,"physical_scancode":88,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":1,"pressure":0.0,"pressed":false,"script":null)
]
}

Expand Down
3 changes: 3 additions & 0 deletions scenes/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -175,12 +175,14 @@ func fire():
projectile.fire(invec, current_cidx, current_color)
projectile.global_position = $gunsprite/gunanchor.global_position
_add_sibling_at_end(projectile)
sfx.play(sfx.PEW, sfx.QUIET_DB)
$gunsprite/animation.play("muzzle")

func roll(delta):
is_rolling = true
is_controllable = false
$animation.play("roll")
sfx.play(sfx.WALK)
velocity.x = ROLL_HORIZONTAL_VEL * _side_multiplier()
roll_timer = 0.0
#_set_color(colors.CWHITE)
Expand Down Expand Up @@ -453,6 +455,7 @@ func _take_damage(damage, color_cidx):
return
# Player never takes extra damage from colors.
# TODO: Should they?
sfx.play(sfx.TAKE_DAMAGE, sfx.QUIET_DB)
set_health(health - damage)
_begin_invulernability_after_damage()
global_camera.shake(0.35, 30, 3)
Expand Down
5 changes: 4 additions & 1 deletion scripts/sfx.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ const BACKGROUND_QUIET_DB = -40.0
# Preloaded sound effects.
# ========================
enum {
# TODO: Replace with actual sounds
JUMP,
WALK,
TAKE_DAMAGE,
PEW,
}

const SAMPLES = {
JUMP: preload("res://assets/sfx/jump.wav"),
WALK: preload("res://assets/sfx/walk.wav"),
TAKE_DAMAGE: preload("res://assets/sfx/take_damage.wav"),
PEW: preload("res://assets/sfx/pew.wav"),
}
# ========================

Expand Down

0 comments on commit 907e83a

Please sign in to comment.