diff --git a/Assets/Graphics/Thumbs.db b/Assets/Graphics/Thumbs.db index 26b845b..b3cb298 100644 Binary files a/Assets/Graphics/Thumbs.db and b/Assets/Graphics/Thumbs.db differ diff --git a/Assets/Prefabs/Player.prefab b/Assets/Prefabs/Player.prefab index e0024f5..c96f253 100644 --- a/Assets/Prefabs/Player.prefab +++ b/Assets/Prefabs/Player.prefab @@ -47,6 +47,8 @@ GameObject: - 114: {fileID: 11472154} - 114: {fileID: 11478382} - 114: {fileID: 11485758} + - 82: {fileID: 8297600} + - 82: {fileID: 8260042} m_Layer: 0 m_Name: Player m_TagString: Player @@ -121,6 +123,146 @@ BoxCollider2D: m_Offset: {x: 0, y: 0} serializedVersion: 2 m_Size: {x: .159999996, y: .239999995} +--- !u!82 &8260042 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 197158} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 2703c121ca5fca441bbefd2256ecbd35, type: 3} + m_PlayOnAwake: 0 + m_Volume: .300000012 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 +--- !u!82 &8297600 +AudioSource: + m_ObjectHideFlags: 1 + m_PrefabParentObject: {fileID: 0} + m_PrefabInternal: {fileID: 100100000} + m_GameObject: {fileID: 197158} + m_Enabled: 1 + serializedVersion: 4 + OutputAudioMixerGroup: {fileID: 0} + m_audioClip: {fileID: 8300000, guid: 9b17eb77ac949714d9ab50a9bb170d8f, type: 3} + m_PlayOnAwake: 0 + m_Volume: .100000001 + m_Pitch: 1 + Loop: 0 + Mute: 0 + Spatialize: 0 + Priority: 128 + DopplerLevel: 1 + MinDistance: 1 + MaxDistance: 500 + Pan2D: 0 + rolloffMode: 0 + BypassEffects: 0 + BypassListenerEffects: 0 + BypassReverbZones: 0 + rolloffCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + - time: 1 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + panLevelCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + spreadCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 0 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 + reverbZoneMixCustomCurve: + serializedVersion: 2 + m_Curve: + - time: 0 + value: 1 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + m_PreInfinity: 2 + m_PostInfinity: 2 --- !u!95 &9514794 Animator: serializedVersion: 3 @@ -152,6 +294,7 @@ MonoBehaviour: rocket: {fileID: 5027078, guid: 1cf24e915b357664f94ba440a1d1ec1a, type: 2} rocket_position_offset: {x: .100000001, y: 0, z: 0} speed: 3 + audioRocket: {fileID: 8260042} --- !u!114 &11413024 MonoBehaviour: m_ObjectHideFlags: 1 @@ -173,6 +316,7 @@ MonoBehaviour: serializedVersion: 2 m_Bits: 256 jumpForce: 175 + audioJump: {fileID: 8297600} --- !u!114 &11472154 MonoBehaviour: m_ObjectHideFlags: 1 @@ -264,6 +408,42 @@ Prefab: propertyPath: m_Interpolate value: 0 objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: jumpSound + value: + objectReference: {fileID: 8300000, guid: 9b17eb77ac949714d9ab50a9bb170d8f, type: 3} + - target: {fileID: 0} + propertyPath: volume + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_Volume + value: .300000012 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_audioClip + value: + objectReference: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} + - target: {fileID: 0} + propertyPath: audioJump + value: + objectReference: {fileID: 8297600} + - target: {fileID: 0} + propertyPath: audioRocket + value: + objectReference: {fileID: 8260042} + - target: {fileID: 0} + propertyPath: BypassListenerEffects + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: BypassReverbZones + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_PlayOnAwake + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 197158} diff --git a/Assets/Prefabs/bombCrate.prefab b/Assets/Prefabs/bombCrate.prefab index c44666e..315b890 100644 --- a/Assets/Prefabs/bombCrate.prefab +++ b/Assets/Prefabs/bombCrate.prefab @@ -68,6 +68,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 2568094dbdb537b49880253a6eedeada, type: 3} m_Name: m_EditorClassIdentifier: + audioPickup: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} --- !u!212 &21218118 SpriteRenderer: m_ObjectHideFlags: 1 @@ -100,7 +101,27 @@ Prefab: serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} - m_Modifications: [] + m_Modifications: + - target: {fileID: 0} + propertyPath: audioPickup + value: + objectReference: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} + - target: {fileID: 0} + propertyPath: m_audioClip + value: + objectReference: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} + - target: {fileID: 0} + propertyPath: m_Volume + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: m_PlayOnAwake + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: BypassListenerEffects + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 176050} diff --git a/Assets/Prefabs/healthCrate.prefab b/Assets/Prefabs/healthCrate.prefab index fb81ee1..87dc511 100644 --- a/Assets/Prefabs/healthCrate.prefab +++ b/Assets/Prefabs/healthCrate.prefab @@ -68,6 +68,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a395f7557cbd20d45826e16e4264ee4a, type: 3} m_Name: m_EditorClassIdentifier: + audioPickup: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} health: {fileID: 0} --- !u!212 &21237158 SpriteRenderer: @@ -130,6 +131,10 @@ Prefab: propertyPath: m_Radius value: 2.5 objectReference: {fileID: 0} + - target: {fileID: 0} + propertyPath: audioPickup + value: + objectReference: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} m_RemovedComponents: [] m_ParentPrefab: {fileID: 0} m_RootGameObject: {fileID: 140204} diff --git a/Assets/Scenes/MasterScene.unity b/Assets/Scenes/MasterScene.unity index bbd1e53..f557208 100644 --- a/Assets/Scenes/MasterScene.unity +++ b/Assets/Scenes/MasterScene.unity @@ -841,6 +841,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a395f7557cbd20d45826e16e4264ee4a, type: 3} m_Name: m_EditorClassIdentifier: + audioPickup: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3} health: {fileID: 1113329686} --- !u!61 &1736051096 BoxCollider2D: diff --git a/Assets/Scripts/BombPickup.cs b/Assets/Scripts/BombPickup.cs index 4d116a1..41823c3 100644 --- a/Assets/Scripts/BombPickup.cs +++ b/Assets/Scripts/BombPickup.cs @@ -3,21 +3,17 @@ using System.Collections; public class BombPickup : MonoBehaviour { - - - void Awake() - { - - } - + public AudioClip audioPickup; void OnTriggerEnter2D (Collider2D other) { // If the player enters the trigger zone... if(other.tag == "Player") { - // Increase the number of bombs the player has. - other.GetComponent().bombCount++; + AudioSource.PlayClipAtPoint(audioPickup, transform.position); + + // Increase the number of bombs the player has. + other.GetComponent().bombCount++; // Destroy the crate. Destroy(gameObject); diff --git a/Assets/Scripts/FireScript.cs b/Assets/Scripts/FireScript.cs index b9b193e..9392683 100644 --- a/Assets/Scripts/FireScript.cs +++ b/Assets/Scripts/FireScript.cs @@ -7,10 +7,13 @@ public class FireScript : MonoBehaviour { public Vector3 rocket_position_offset; public float speed = 10f; + public AudioSource audioRocket; + // Update is called once per frame void Update () { if (Input.GetButtonDown("Fire1")) { + audioRocket.Play(); FireRocket(gameObject.GetComponent().GetFacingRight()); } diff --git a/Assets/Scripts/HealthPickup.cs b/Assets/Scripts/HealthPickup.cs index 764a9fa..d762bf5 100644 --- a/Assets/Scripts/HealthPickup.cs +++ b/Assets/Scripts/HealthPickup.cs @@ -6,13 +6,15 @@ using UnityEngine.UI; public class HealthPickup : MonoBehaviour { - + public AudioClip audioPickup; public Text health; void OnTriggerEnter2D(Collider2D other) { if(other.tag == "Player") { + AudioSource.PlayClipAtPoint(audioPickup, transform.position); + // Destroy the crate. Destroy(gameObject); diff --git a/Assets/Scripts/PlayerBehavior.cs b/Assets/Scripts/PlayerBehavior.cs index a8e6f94..8f92a29 100644 --- a/Assets/Scripts/PlayerBehavior.cs +++ b/Assets/Scripts/PlayerBehavior.cs @@ -15,6 +15,8 @@ public class PlayerBehavior : MonoBehaviour public LayerMask ground; public float jumpForce = 7.0f; + public AudioSource audioJump; + private Rigidbody2D rb; private Animator anim; private bool facingRight = true; @@ -32,6 +34,7 @@ public class PlayerBehavior : MonoBehaviour { if (grounded && Input.GetButtonDown("Jump")) { + audioJump.Play(); anim.SetBool("Ground", false); rb.AddForce(new Vector2(0, jumpForce)); } diff --git a/Assets/Sound.meta b/Assets/Sound.meta new file mode 100644 index 0000000..ef7e5ed --- /dev/null +++ b/Assets/Sound.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 87ea32dcd705a6d4ea164f43731a9994 +folderAsset: yes +timeCreated: 1448922331 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sound/Jump.wav b/Assets/Sound/Jump.wav new file mode 100644 index 0000000..aee8133 Binary files /dev/null and b/Assets/Sound/Jump.wav differ diff --git a/Assets/Sound/Jump.wav.meta b/Assets/Sound/Jump.wav.meta new file mode 100644 index 0000000..28d27b1 --- /dev/null +++ b/Assets/Sound/Jump.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 9b17eb77ac949714d9ab50a9bb170d8f +timeCreated: 1448922331 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sound/Pickup.wav b/Assets/Sound/Pickup.wav new file mode 100644 index 0000000..e9384d0 Binary files /dev/null and b/Assets/Sound/Pickup.wav differ diff --git a/Assets/Sound/Pickup.wav.meta b/Assets/Sound/Pickup.wav.meta new file mode 100644 index 0000000..4c04d18 --- /dev/null +++ b/Assets/Sound/Pickup.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: a48a7087d05490f4b913e6cd1d177494 +timeCreated: 1448923974 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sound/Rocket.wav b/Assets/Sound/Rocket.wav new file mode 100644 index 0000000..c1f68b3 Binary files /dev/null and b/Assets/Sound/Rocket.wav differ diff --git a/Assets/Sound/Rocket.wav.meta b/Assets/Sound/Rocket.wav.meta new file mode 100644 index 0000000..e1a6e67 --- /dev/null +++ b/Assets/Sound/Rocket.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 2703c121ca5fca441bbefd2256ecbd35 +timeCreated: 1448923734 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: