Commit ac616219 authored by Leandro Motta Barros's avatar Leandro Motta Barros

Add many SFX

parent 757fbac3
......@@ -11,6 +11,7 @@ License is GPL3.
* Engine: [Godot](http://godotengine.org) 3.1.1.
* Graphics: [Krita](https://krita.org).
* Font: [Lato](http://www.latofonts.com), by Łukasz Dziedzic.
* Audio: Some effects recorded by myself, some generated by [jfxr](https://jfxr.frozenfractal.com), edited with [Audacity](https://www.audacityteam.org).
## Notes to self
......
......@@ -77,7 +77,9 @@ func doLeave(_arg) -> void:
func receiveDamage(damage: float) -> void:
_health -= damage
SoundManager.hit()
if _health <= 0.0:
SoundManager.die()
die()
......
......@@ -14,6 +14,7 @@ func _init():
func useImplementation() -> void:
SoundManager.hammer()
useToolToFix(fixPower)
......
......@@ -16,10 +16,12 @@ func _process(delta: float) -> void:
func fix(amount: float) -> void:
SoundManager.fix()
condition += amount
condition = min(condition, 1.0)
func suddenBreak() -> void:
SoundManager.breaking()
condition -= rand_range(0.3, 1.0)
condition = max(condition, 0.0)
......@@ -2,3 +2,43 @@ extends Node2D
func drill():
$Drill.play()
func hammer():
$Hammer.play()
func press():
$Press.play()
func attack():
$Attack.play()
func breaking():
$Breaking.play()
func hit():
$Hit.play()
func powerUp():
$PowerUp.play()
func pickUp():
$PickUp.play()
func fix():
$Fix.play()
func die():
$Die.play()
func visitor():
$Visitor.play()
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=13 format=2]
[ext_resource path="res://scenes/SoundManager.gd" type="Script" id=1]
[ext_resource path="res://sfx/drill.wav" type="AudioStream" id=2]
[ext_resource path="res://sfx/hammer.wav" type="AudioStream" id=3]
[ext_resource path="res://sfx/press.wav" type="AudioStream" id=4]
[ext_resource path="res://sfx/attack.wav" type="AudioStream" id=5]
[ext_resource path="res://sfx/break.wav" type="AudioStream" id=6]
[ext_resource path="res://sfx/hit.wav" type="AudioStream" id=7]
[ext_resource path="res://sfx/powerup.wav" type="AudioStream" id=8]
[ext_resource path="res://sfx/pickup.wav" type="AudioStream" id=9]
[ext_resource path="res://sfx/fix.wav" type="AudioStream" id=10]
[ext_resource path="res://sfx/die.wav" type="AudioStream" id=11]
[ext_resource path="res://sfx/visitor.wav" type="AudioStream" id=12]
[node name="SoundManager" type="Node2D"]
script = ExtResource( 1 )
[node name="Drill" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 2 )
[node name="Hammer" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 3 )
[node name="Press" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 4 )
[node name="Attack" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 5 )
[node name="Breaking" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 6 )
[node name="Hit" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 7 )
[node name="PowerUp" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 8 )
[node name="PickUp" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 9 )
[node name="Fix" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 10 )
[node name="Die" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 11 )
[node name="Visitor" type="AudioStreamPlayer" parent="."]
stream = ExtResource( 12 )
......@@ -61,6 +61,7 @@ func useToolToFix(amount: float) -> void:
# Assuming this is an attack tool
func useToolToAttack(damage: float) -> void:
SoundManager.attack()
var enemy := getNearbyEnemy()
if enemy:
enemy.receiveDamage(damage)
......
......@@ -14,6 +14,7 @@ func _init():
func useImplementation() -> void:
SoundManager.press()
useToolToFix(fixPower)
......
......@@ -93,6 +93,7 @@ func generateRandomEventMaybe(deltaInSecs: float) -> void:
func generateBrokenMachineEvent() -> void:
SoundManager.breaking()
var machine = Globals.gameState.machines[randi() % 4] as Machine
machine.suddenBreak()
showToast("Your %s just had a failure!" % machine.machineName)
......@@ -100,6 +101,7 @@ func generateBrokenMachineEvent() -> void:
onready var ThiefScene := preload("res://characters/Thief.tscn")
func generateThiefEvent() -> void:
SoundManager.visitor()
var thief := ThiefScene.instance()
thief.position = getPointInGroup("ThiefSpawnPoints")
gameScene.add_child(thief)
......
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/attack.wav-d3936ded900cb7e5ab21dff4e1398336.sample"
[deps]
source_file="res://sfx/attack.wav"
dest_files=[ "res://.import/attack.wav-d3936ded900cb7e5ab21dff4e1398336.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/break.wav-d511423f636fae72253de2cd7a92293d.sample"
[deps]
source_file="res://sfx/break.wav"
dest_files=[ "res://.import/break.wav-d511423f636fae72253de2cd7a92293d.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
File added
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/die.wav-4974a6b200a80bb453a6d99d970f8f9f.sample"
[deps]
source_file="res://sfx/die.wav"
dest_files=[ "res://.import/die.wav-4974a6b200a80bb453a6d99d970f8f9f.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
File added
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/fix.wav-a4a2a678630f73d14d17610a2f4ff77a.sample"
[deps]
source_file="res://sfx/fix.wav"
dest_files=[ "res://.import/fix.wav-a4a2a678630f73d14d17610a2f4ff77a.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
File added
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/hit.wav-a92ea39c0d020236e572273e8ae7e65c.sample"
[deps]
source_file="res://sfx/hit.wav"
dest_files=[ "res://.import/hit.wav-a92ea39c0d020236e572273e8ae7e65c.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/pickup.wav-1bbcc22e1c5a9d6d82de89d4923d6b8b.sample"
[deps]
source_file="res://sfx/pickup.wav"
dest_files=[ "res://.import/pickup.wav-1bbcc22e1c5a9d6d82de89d4923d6b8b.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/powerup.wav-692b0679cd593fab535d64426fcd90c4.sample"
[deps]
source_file="res://sfx/powerup.wav"
dest_files=[ "res://.import/powerup.wav-692b0679cd593fab535d64426fcd90c4.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
[remap]
importer="wav"
type="AudioStreamSample"
path="res://.import/visitor.wav-0aa5f75fe4bfd36c01de4fcfc0d5e984.sample"
[deps]
source_file="res://sfx/visitor.wav"
dest_files=[ "res://.import/visitor.wav-0aa5f75fe4bfd36c01de4fcfc0d5e984.sample" ]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=true
edit/normalize=true
edit/loop=false
compress/mode=0
......@@ -17,6 +17,7 @@ func _process(delta):
# Equip tool
_tool.isTaking = true
Globals.player.setTool(_tool)
SoundManager.pickUp()
else:
# Buy (and equip) tool
createTool()
......@@ -24,6 +25,7 @@ func _process(delta):
Globals.addCoinRateModifier("Bought %s" % _tool.toolName, _tool.costTime, -_tool.costAmount)
_tool.isTaking = true
Globals.player.setTool(_tool)
SoundManager.powerUp()
func _on_Area2D_body_entered(body):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment