Download presentation
Presentation is loading. Please wait.
Published byCleopatra Pearson Modified over 9 years ago
1
Derived from Kirill Muzykov’s Rocket Mouse Tutorial http://www.raywenderlich.com/69392/make-game-like-jetpack-joyride-unity-2d-part-1 @shahedC WakeUpAndCode.com
4
Add new instance variable
6
This 1 line calls DisplayGemsCount()
9
Drag gem into Gem Icon Texture
10
Run See your score on the top left!
13
You can add it to the bottom of the class, just before the class ends
14
Add a call to DisplayRestartButton()
15
Run What happens when the cat touches a laser?
16
You can now restart the game, with the new button!
18
a)Go to www.bfxr.netwww.bfxr.net b)Add a laser sound. c)Click “Play” on the right to hear it. d)Click Export Wav to download the file. b a c d
19
Click Save
20
Verify
21
In Prefabs folder, select “laser” prefab
22
For the laser object, click Add Component “Audio” Click “Audio” Click “Audio Source”
23
For the laser object in Prefabs… … verify “Audio Source”
24
With laser prefab selected…
25
… click Prefabs folder, then drag your Laser sound into Audio Clip under Audio Source Also, uncheck “Play on Awake” checkbox
27
Add if statement to play laser sound
28
Run You should hear the laser sound on collision with the laser!
30
Repeat steps a-b-c-d for Pickup/Coin Explosion Hit/Hurt a)Go to www.bfxr.netwww.bfxr.net b)Add a sound. c)Click “Play” on the right to hear it. d)Click Export Wav to download the file. b a c d
31
Click Save New Sounds Pickup/Coin Explosion Hit/Hurt
33
Click “Apply” for each Uncheck 3D Sound for each sound clip
34
1.Select “Cat” in Hierarchy 2.Click “Add Component”
35
Click “Audio” Click “Audio Source”
36
Verify 2 Audio Sources for Cat!
37
Drag “Explosion” and “Hit_Hurt” into each empty Audio Clip
38
For both Audio Sources, enable: Play on Awake Loop
40
Add 2 new instance variables
42
Add this 1 line at the end of FixedUpdate()
43
Drag “Explosion” Audio Source into JetPack Audio under Cat’s Script Component
44
Drag “Hit_Hurt” Audio Source into Footsteps Audio under Cat’s Script Component
46
Add 1 new instance variable
47
Add 1 new line to play sound
48
Drag Pickup_Coin audio file into “Gem Collec Sound” under Cat’s script
49
Run Do you hear the sounds?
51
For the Main Camera… Click “Audio Source”… click Add Component “Audio”
52
Verify Audio Source in Inspector
53
Drag music audio to Camera’s audio clip Enable Play on awake Loop
55
Click File Build Settings…
56
Choose one of many platforms!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.