SlideShare uma empresa Scribd logo
1 de 50
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
Drag “laser_on”
from “Sprites”
subfolder into
Scene
Rename
“laser_on”
to just “laser”
Set the laser’s Sorting Layer to “Objects”
For the laser object, click
Add Component  “Physics 2D”
Click “Box Collider 2D” Verify “Box Collider 2D”
Enable “Is Trigger” Checkbox
(This allows you to handle collisions
in your code instead of the Physics engine)
Update Size:
• X = 0.18
• Y = 3.1
For the laser object, click
Add Component  “New Script”
Enter “LaserScript”,
click “Create and Add”
Verify new script
Add these 6
instance
variables
inside
LaserScript
Add 1 line
in Start()
method
Add FixedUpdate()
method just before
the class ends
With “laser”
selected,
drag on/off
sprites
into script
properties
Position:
• X = 2
• Y = 0.25
• Z = 0
Laser Script
• Rotation Speed = 30
Drag “laser”
from Hierarchy
to Prefabs folder
Run
You should see a rotating laser!
Add 1
new
instance
variable
Add 2
new
methods
just before
Start()
Reassign
jetPackActive
boolean
Check if (!dead)
i.e. not dead
All your animation clips
will be created here
In the Animation tab, with Cat selected in Hierarchy…
Create New Clip, “die”
under Animations subfolder
Verify “die” animation in Animations subfolder
Ctrl-Select
“die0” and
“die1”, then
drag
animation
frames into
Animation
window
Change Sample Value to 8 for “die” animation
Click “Record” button to stop recording
In the Animation tab, with Cat selected in Hierarchy…
Create New Clip, “fall”
under Animations subfolder
Verify “fall” animation in Animations subfolder
Select
“fall”, then
drag
animation
frame (just
one) into
Animation
window
Click “Record” button to stop recording
In the
Animator tab
Click the +
next to
Parameters,
Then add a
new Bool
Name the new
parameter
“dead”
Right-click “Any State”, then click “Make Transition”
Click the “fall” state to complete the transition from “Any State” to “Fall”
Click the new Transition in the Animator tab,
Then, select “dead” under Conditions in Inspector
Set “dead” to true, then…
Click + to “Add to list”
Set “grounded “
to false
Select
“grounded”
for the
new condition…
NOTE: For this transition, “dead” is true, but “grounded” is false
Right-click “Any State”, then click “Make Transition”
Click the “die” state to complete the transition from “Any State” to “Die”
Click the new Transition in the Animator tab,
Then, select “dead” under Conditions in Inspector
Set “dead” to true, then…
Click + to “Add to list”
Set “grounded “
to true
Select
“grounded”
for the
new condition…
NOTE: For this transition, BOTH conditions are true! (“dead” AND “grounded”)
Add 1 line of code
inside HitByLaser()
NOTE: This ensures that “dead” condition is set to true when HitByLaser() is called
In the
Animator tab
Click the +
next to
Parameters,
Then add a
new Trigger
Name the new
Trigger parameter
“dieOnceTrigger”
Select the “die” animation
in the Project panel
Uncheck Loop Time
Run
What happens when the cat touches the laser?
Ninja Cat Flyer - 4 of 6

Mais conteúdo relacionado

Destaque

Sviluppare Videogiochi in 2D con Unity
Sviluppare Videogiochi in 2D con UnitySviluppare Videogiochi in 2D con Unity
Sviluppare Videogiochi in 2D con UnityCodemotion
 
Game Development with Unity
Game Development with UnityGame Development with Unity
Game Development with Unitydavidluzgouveia
 
Bài 5: Thiết kế giao diện - Giáo trình FPT
Bài 5: Thiết kế giao diện - Giáo trình FPTBài 5: Thiết kế giao diện - Giáo trình FPT
Bài 5: Thiết kế giao diện - Giáo trình FPTMasterCode.vn
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person TutorialShahed Chowdhuri
 
Giới thiệu môn học Làm quen với unity3d
Giới thiệu môn học Làm quen với unity3dGiới thiệu môn học Làm quen với unity3d
Giới thiệu môn học Làm quen với unity3dTrí Bằng
 
Introduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First GameIntroduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First GameSarah Sexton
 

Destaque (7)

Sviluppare Videogiochi in 2D con Unity
Sviluppare Videogiochi in 2D con UnitySviluppare Videogiochi in 2D con Unity
Sviluppare Videogiochi in 2D con Unity
 
Game Development with Unity
Game Development with UnityGame Development with Unity
Game Development with Unity
 
Bài 5: Thiết kế giao diện - Giáo trình FPT
Bài 5: Thiết kế giao diện - Giáo trình FPTBài 5: Thiết kế giao diện - Giáo trình FPT
Bài 5: Thiết kế giao diện - Giáo trình FPT
 
Unity 5: First-Person Tutorial
Unity 5: First-Person TutorialUnity 5: First-Person Tutorial
Unity 5: First-Person Tutorial
 
Unity 3d Basics
Unity 3d BasicsUnity 3d Basics
Unity 3d Basics
 
Giới thiệu môn học Làm quen với unity3d
Giới thiệu môn học Làm quen với unity3dGiới thiệu môn học Làm quen với unity3d
Giới thiệu môn học Làm quen với unity3d
 
Introduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First GameIntroduction to Unity3D and Building your First Game
Introduction to Unity3D and Building your First Game
 

Mais de Shahed Chowdhuri

ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsShahed Chowdhuri
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsShahed Chowdhuri
 
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive ServicesShahed Chowdhuri
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsShahed Chowdhuri
 
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive ServicesShahed Chowdhuri
 
Microsoft Cognitive Services
Microsoft Cognitive ServicesMicrosoft Cognitive Services
Microsoft Cognitive ServicesShahed Chowdhuri
 
Intro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DBIntro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DBShahed Chowdhuri
 
Game On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UYGame On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UYShahed Chowdhuri
 
Game On with Windows & Xbox One!
Game On with Windows & Xbox One!Game On with Windows & Xbox One!
Game On with Windows & Xbox One!Shahed Chowdhuri
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure FunctionsShahed Chowdhuri
 
ASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web AppsASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web AppsShahed Chowdhuri
 
Intro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application DevelopmentIntro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application DevelopmentShahed Chowdhuri
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with AzureShahed Chowdhuri
 
Intro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed RealityIntro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed RealityShahed Chowdhuri
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewShahed Chowdhuri
 

Mais de Shahed Chowdhuri (20)

ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality: HoloLens & Azure Cognitive Services
 
ASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web AppsASP.NET Core 2.1: The Future of Web Apps
ASP.NET Core 2.1: The Future of Web Apps
 
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive ServicesCloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
Cloud-Backed Mixed Reality with HoloLens & Azure Cognitive Services
 
Microsoft Cognitive Services
Microsoft Cognitive ServicesMicrosoft Cognitive Services
Microsoft Cognitive Services
 
Intro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DBIntro to Bot Framework v3 with DB
Intro to Bot Framework v3 with DB
 
Game On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UYGame On with Windows & Xbox One @ .NET Conf UY
Game On with Windows & Xbox One @ .NET Conf UY
 
Game On with Windows & Xbox One!
Game On with Windows & Xbox One!Game On with Windows & Xbox One!
Game On with Windows & Xbox One!
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure Functions
 
ASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web AppsASP.NET Core 2.0: The Future of Web Apps
ASP.NET Core 2.0: The Future of Web Apps
 
Azure for Hackathons
Azure for HackathonsAzure for Hackathons
Azure for Hackathons
 
Intro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application DevelopmentIntro to Xamarin: Cross-Platform Mobile Application Development
Intro to Xamarin: Cross-Platform Mobile Application Development
 
Xbox One Dev Mode
Xbox One Dev ModeXbox One Dev Mode
Xbox One Dev Mode
 
What's New at Microsoft?
What's New at Microsoft?What's New at Microsoft?
What's New at Microsoft?
 
Capture the Cloud with Azure
Capture the Cloud with AzureCapture the Cloud with Azure
Capture the Cloud with Azure
 
Intro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed RealityIntro to HoloLens Development + Windows Mixed Reality
Intro to HoloLens Development + Windows Mixed Reality
 
Intro to Bot Framework v3
Intro to Bot Framework v3Intro to Bot Framework v3
Intro to Bot Framework v3
 
Azure: PaaS or IaaS
Azure: PaaS or IaaSAzure: PaaS or IaaS
Azure: PaaS or IaaS
 
ASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with OverviewASP.NET Core MVC + Web API with Overview
ASP.NET Core MVC + Web API with Overview
 

Último

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Ninja Cat Flyer - 4 of 6

Notas do Editor

  1. Title Page: Unity 2D: Step by Step Based on Kirill Muzykov’s Rocket Mouse Tutorial http://www.raywenderlich.com/69392/make-game-like-jetpack-joyride-unity-2d-part-1 By Shahed Chowdhuri Senior Technical Evangelist Blog: WakeUpAndCode.com Twitter: @shahedC
  2. Moving the Mouse
  3. Moving the Mouse
  4. Moving the Mouse
  5. Moving the Mouse
  6. Contact Web: OnekSoft.com Email: games@OnekSoft.com Twitter: @OnekSoftGames Microsoft email: shchowd@microsoft.com Personal Twitter: @shahedC R&D: OnekSoftLabs.com Dev Blog: WakeUpAndCode.com