Skip to content

Commit f125dd9

Browse files
committed
- ADDED: Power Up Sounds
- FIXED: Bugs
1 parent abd15c7 commit f125dd9

File tree

46 files changed

+619
-171
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+619
-171
lines changed

Assets/Prefabs/Bricks/Brick_Green.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ MonoBehaviour:
152152
type: 3}
153153
_bulletPowerUp: {fileID: 8572359908198561518, guid: bf44dcccf7a713b4b9c3a1d4d1fe3009,
154154
type: 3}
155+
_spawnPowerUpClip: {fileID: 8300000, guid: 4caf3541243805e4cb726100fc52684c, type: 3}
155156
--- !u!114 &364465209502513189
156157
MonoBehaviour:
157158
m_ObjectHideFlags: 0

Assets/Prefabs/Bricks/Brick_Magenta.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ MonoBehaviour:
153153
type: 3}
154154
_bulletPowerUp: {fileID: 8572359908198561518, guid: bf44dcccf7a713b4b9c3a1d4d1fe3009,
155155
type: 3}
156+
_spawnPowerUpClip: {fileID: 8300000, guid: 4caf3541243805e4cb726100fc52684c, type: 3}
156157
--- !u!114 &-295864129651666023
157158
MonoBehaviour:
158159
m_ObjectHideFlags: 0

Assets/Prefabs/Bricks/Brick_Orange.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ MonoBehaviour:
155155
type: 3}
156156
_bulletPowerUp: {fileID: 8572359908198561518, guid: bf44dcccf7a713b4b9c3a1d4d1fe3009,
157157
type: 3}
158+
_spawnPowerUpClip: {fileID: 8300000, guid: 4caf3541243805e4cb726100fc52684c, type: 3}
158159
--- !u!114 &5437508484046080693
159160
MonoBehaviour:
160161
m_ObjectHideFlags: 0

Assets/Prefabs/Bricks/Brick_Turquoise.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ MonoBehaviour:
154154
type: 3}
155155
_bulletPowerUp: {fileID: 8572359908198561518, guid: bf44dcccf7a713b4b9c3a1d4d1fe3009,
156156
type: 3}
157+
_spawnPowerUpClip: {fileID: 8300000, guid: 4caf3541243805e4cb726100fc52684c, type: 3}
157158
--- !u!114 &-8425475133697438624
158159
MonoBehaviour:
159160
m_ObjectHideFlags: 0

Assets/Prefabs/Bricks/Brick_White_Unbreakable.prefab

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,9 @@ MonoBehaviour:
148148
hitSound: {fileID: 8300000, guid: 8778bfa057e7cd94f84c4db65429c871, type: 3}
149149
destroySound: {fileID: 8300000, guid: 8778bfa057e7cd94f84c4db65429c871, type: 3}
150150
particleEmission: {fileID: 153354, guid: 410b27f9c439fb945ab475308f7ad157, type: 3}
151+
_increaseSizePowerUp: {fileID: 0}
152+
_bulletPowerUp: {fileID: 0}
153+
_spawnPowerUpClip: {fileID: 8300000, guid: 4caf3541243805e4cb726100fc52684c, type: 3}
151154
--- !u!114 &3961309992695004815
152155
MonoBehaviour:
153156
m_ObjectHideFlags: 0

Assets/Prefabs/Paddle/Paddle.prefab

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ MonoBehaviour:
141141
_rightBulletSpawn: {fileID: 8655378041993414002}
142142
_hasSizeIncreased: 0
143143
_isTopTurret: 0
144+
_gunPowerUpCollected: {fileID: 8300000, guid: 514d61334217c3a4d8fecb6ec17b33cb,
145+
type: 3}
146+
_lengthPowerUpCollected: {fileID: 8300000, guid: b161212973bf29f41879bae75ffa60b2,
147+
type: 3}
144148
--- !u!60 &6086770
145149
PolygonCollider2D:
146150
m_ObjectHideFlags: 0

Assets/Scripts/Brick.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public class Brick : MonoBehaviour
3030
[SerializeField]
3131
private GameObject _bulletPowerUp;
3232

33+
[SerializeField]
34+
AudioClip _spawnPowerUpClip;
35+
3336
// Use this for initialization
3437
void Start()
3538
{
@@ -126,6 +129,11 @@ private void SpawnPowerUp()
126129
{
127130
GameObject spawnedObject = null;
128131

132+
if (_spawnPowerUpClip != null)
133+
{
134+
AudioSource.PlayClipAtPoint(_spawnPowerUpClip, transform.position);
135+
}
136+
129137
switch (UnityEngine.Random.Range(0, 2))
130138
{
131139
case 0:

Assets/Scripts/LevelManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public void BrickDestroyed()
6363
{
6464
if (ScoreManager.Instance != null)
6565
ScoreManager.Instance.AddScore(Brick.ALL_BRICK_DESTROY_SCORE);
66-
LoadNextLevel();
66+
67+
StartCoroutine(nameof(LoadLevelCoroutine), 2f);
6768
}
6869
}
6970
}

Assets/Scripts/Paddle.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ public class Paddle : MonoBehaviour
4545
[SerializeField]
4646
private bool _isTopTurret;
4747

48+
[SerializeField]
49+
private AudioClip _gunPowerUpCollected;
50+
51+
[SerializeField]
52+
private AudioClip _lengthPowerUpCollected;
53+
4854
private void Awake()
4955
{
5056
if (isKeyboardMovement)
@@ -120,7 +126,7 @@ private void HandleTurret()
120126
}
121127
else
122128
{
123-
_isInTurretMode = true;
129+
_isInTurretMode = false;
124130
GetComponent<SpriteRenderer>().sprite = _defaultSprite;
125131
}
126132
}
@@ -173,9 +179,20 @@ private void HandlePowerUp(PowerUpType powerUpType)
173179
{
174180
case PowerUpType.INCREASE_SIZE:
175181
if (!_hasSizeIncreased)
182+
{
183+
if (_lengthPowerUpCollected != null)
184+
{
185+
AudioSource.PlayClipAtPoint(_lengthPowerUpCollected, transform.position);
186+
}
187+
176188
StartCoroutine(nameof(IncreaseSizePowerUp), 10f);
189+
}
177190
break;
178191
case PowerUpType.ATTACH_GUN:
192+
if (_gunPowerUpCollected != null)
193+
{
194+
AudioSource.PlayClipAtPoint(_gunPowerUpCollected, transform.position);
195+
}
179196
EnableTurret();
180197
break;
181198
}
@@ -196,6 +213,7 @@ private void EnableTurret()
196213
{
197214
_isInTurretMode = true;
198215
_currentBullets += 10;
216+
GetComponent<SpriteRenderer>().sprite = _turretPaddleSprite;
199217
}
200218
else
201219
{

Assets/Sounds/191177__cahen__mip03.aiff.meta

Lines changed: 18 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)