SlideShare a Scribd company logo
1 of 41
Introducing Text 101
What Text 101 Teaches
• Increase our scripting skills (nearly 200 lines!).
• The basics of “finite state machines”.
• Invite you to create and share your own story.
• Build our game to the web.
• Share with the world.
More About Creating New Projects
More About Creating New Projects
Recap how to create and save projects
Setup & save your Text 101 project
What gets “carried-over” to new projects
Import your prison image asset
Save your project
Carried-over to a new project
Your current layout (easy to reset)
Unity Preferences (e.g. play mode tint)
More About Creating New Projects
In this video…
Recap how to create and save projects
Setup & save your Text 101 project
What gets “carried-over”
Import your prison image asset
Save your project
More About Creating New Projects
Adding 2D User Interface Text
Lecture Summary
• Adding a UI > Text element to a scene
• Setting the camera background colour
• Moving and scaling your text
• How to programatically change text
• Challenge: Change text only on key press
• Challenge: Add and scale the image
Downloads Here
1
2
Download your files
Change text on key press
Use an if statement
Use Input.GetKeyDown
Text starts blank when game first runs
Change text to “key pressed” on key press
Challenge: Add and scale the image
Add an image to the UI canvas
Scale it to around 1/3 height of canvas
Centre it on the canvas
Ensure the background is transparent
Make sure the game runs
Adding 2D User Interface Text
Lecture Summary
• Adding a UI > Text element to a scene
• Setting the camera background colour
• Moving and scaling your text
• How to programatically change text
• Challenge: Change text only on key press
• Challenge: Add and scale the image
More Content Coming Soon
More Content Coming Soon
Why this section isn’t finished.
When we will be adding content.
What to do next
More Content Coming Soon
Why this section isn’t finished.
Lean production system.
We want your feedback.
Gets the content to you ASAP.
More Content Coming Soon
When we will be adding content
This Section Is In Progress
Time Zone Times
Greenwich Mean Time
Mon 3rd November
11am to 5pm GMT
Tuesday 5th November
11am to 5pm GMT
Pacific Standard Time
Mon 3rd November
3 am to 9 am PST
Tuesday 5th November
3 am to 9 am PST
What to do next
Save your scripts, scene and project.
Move on to the next section.
Come back once the section is finished.
More Content Coming Soon
Word Wrapping & Joining Strings
Lecture Summary
How to write long strings in C# code
How word wrapping works on UI Text
Building Your Game Engine
In This Lecture…
• The structure of our “engine”
• What’s an enum?
• Challenge: complete the story
The Structure Of Our “Engine”
• Update() keeps game in the right state.
• State methods: set text & respond to keys.
• One state method per state.
What’s an enum?
“The enum keyword is used to declare an
enumeration, a distinct type that consists of a set of
named constants called the enumerator list.”
http://msdn.microsoft.com/en-us/library/sbbt4032.aspx
Complete The Story
• Write all 8 state methods.
• Write your story text.
• Write the if statements to respond to keys.
• Test your game flow works.
Downloads Here
1
2
Download the code
Re-Organising Your Code
Update Your Update() Method
• Add the new states to States enum.
• Add new if statements to Update().
• Drop state_ prefix (Search > Replace).
• There is a better way, but not now.
Rename freedom to corridor_0
• Change the line in Update().
• Rename your state methods.
• Update your text.
• Update key press options.
• Anything else?
Extending Your Story
Add New State Methods
• Adding at the top may be easier.
• Have your GDD visible.
• Test your game.
Just Skim This Video
• Please create your own story.
• Just skim this video.
• Useful “code-folding” tips at around 11:20.
• Good luck!
Local Play Testing
• “4-eyes” principle.
• Remember to explore all branches.
• In my story: Return to cell => Roam call*.
* Thanks to Bobby, an early access backer.
Build For Web & Share
In this video…
• Encourage you to create your own story.
• How to build for the web.
• Test your build locally.
• Share using GameBucket.io or similar.
• Post to the course discussions & Facebook.
Some Ideas For Creation
• Tweak our text to make it read better.
• Make a whole new game, same structure.
• Make a whole new game, different structure.
• Translate the game to your native language.
• Add images if you want, but we’re covering later.
Web Player Build Settings
Player Settings…
• Default Screen Width = 800
• Default Screen Height = 600
• WebPlayer Template = Black Background
• If your text doesn’t fit, reduce font size
How To Share Your Game
• Copy the URL from www.GameBucket.io.
• Check in an anonymous / private browser.
• Post as a discussion against this lecture.
• Share on www.Facebook.com/UnityCourse
Unity 5 & Tweaks
In this video…
• Remove state logging (line 22).
Recap & What’s Next
Recap & What’s Next
• Did you write your own story?
• Go on, be brave!
• Maybe ask a friend to write it?
• Build for the web.
• Share in the Udemy Discussions, or
www.CompleteUnityDeveloper.com

More Related Content

Similar to Text101 Game in Unity3D

Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
slantsixgames
 
Polybot Onboarding Process
Polybot Onboarding ProcessPolybot Onboarding Process
Polybot Onboarding Process
Nina Park
 
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless InfrastructureHow Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
Percolate
 
Windows Movie Maker
Windows Movie MakerWindows Movie Maker
Windows Movie Maker
u2818660
 

Similar to Text101 Game in Unity3D (20)

Supersize your production pipe enjmin 2013 v1.1 hd
Supersize your production pipe    enjmin 2013 v1.1 hdSupersize your production pipe    enjmin 2013 v1.1 hd
Supersize your production pipe enjmin 2013 v1.1 hd
 
How to Hone a Game Trailer for a Foreign Audience: The Top Secrets and a Deve...
How to Hone a Game Trailer for a Foreign Audience: The Top Secrets and a Deve...How to Hone a Game Trailer for a Foreign Audience: The Top Secrets and a Deve...
How to Hone a Game Trailer for a Foreign Audience: The Top Secrets and a Deve...
 
Heroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on FacebookHeroes of Paragon: publishing Unity WebGL game on Facebook
Heroes of Paragon: publishing Unity WebGL game on Facebook
 
Intro To Java Alpharetta Meetup Day-1
Intro To Java Alpharetta Meetup Day-1Intro To Java Alpharetta Meetup Day-1
Intro To Java Alpharetta Meetup Day-1
 
Windows 7
Windows 7Windows 7
Windows 7
 
Maximize Your Production Effort (English)
Maximize Your Production Effort (English)Maximize Your Production Effort (English)
Maximize Your Production Effort (English)
 
Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015Ottawa unity user_group_feb13_2015
Ottawa unity user_group_feb13_2015
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Eval final 6
Eval final 6Eval final 6
Eval final 6
 
Untangling11
Untangling11Untangling11
Untangling11
 
11 Amazing things I Learnt At Word Camp Sydney 2014
11 Amazing things I Learnt At Word Camp Sydney 201411 Amazing things I Learnt At Word Camp Sydney 2014
11 Amazing things I Learnt At Word Camp Sydney 2014
 
Polybot Onboarding Process
Polybot Onboarding ProcessPolybot Onboarding Process
Polybot Onboarding Process
 
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless InfrastructureHow Percolate uses CFEngine to Manage AWS Stateless Infrastructure
How Percolate uses CFEngine to Manage AWS Stateless Infrastructure
 
Windows Movie Maker
Windows Movie MakerWindows Movie Maker
Windows Movie Maker
 
Windows Movie Maker
Windows Movie MakerWindows Movie Maker
Windows Movie Maker
 
Desktop apps with node webkit
Desktop apps with node webkitDesktop apps with node webkit
Desktop apps with node webkit
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Text101 Game in Unity3D

  • 2. What Text 101 Teaches • Increase our scripting skills (nearly 200 lines!). • The basics of “finite state machines”. • Invite you to create and share your own story. • Build our game to the web. • Share with the world.
  • 3. More About Creating New Projects
  • 4. More About Creating New Projects Recap how to create and save projects Setup & save your Text 101 project What gets “carried-over” to new projects Import your prison image asset Save your project
  • 5. Carried-over to a new project Your current layout (easy to reset) Unity Preferences (e.g. play mode tint) More About Creating New Projects
  • 6. In this video… Recap how to create and save projects Setup & save your Text 101 project What gets “carried-over” Import your prison image asset Save your project More About Creating New Projects
  • 7. Adding 2D User Interface Text
  • 8. Lecture Summary • Adding a UI > Text element to a scene • Setting the camera background colour • Moving and scaling your text • How to programatically change text • Challenge: Change text only on key press • Challenge: Add and scale the image
  • 10. Change text on key press Use an if statement Use Input.GetKeyDown Text starts blank when game first runs Change text to “key pressed” on key press
  • 11. Challenge: Add and scale the image Add an image to the UI canvas Scale it to around 1/3 height of canvas Centre it on the canvas Ensure the background is transparent Make sure the game runs Adding 2D User Interface Text
  • 12. Lecture Summary • Adding a UI > Text element to a scene • Setting the camera background colour • Moving and scaling your text • How to programatically change text • Challenge: Change text only on key press • Challenge: Add and scale the image
  • 14. More Content Coming Soon Why this section isn’t finished. When we will be adding content. What to do next More Content Coming Soon
  • 15. Why this section isn’t finished. Lean production system. We want your feedback. Gets the content to you ASAP. More Content Coming Soon
  • 16. When we will be adding content This Section Is In Progress Time Zone Times Greenwich Mean Time Mon 3rd November 11am to 5pm GMT Tuesday 5th November 11am to 5pm GMT Pacific Standard Time Mon 3rd November 3 am to 9 am PST Tuesday 5th November 3 am to 9 am PST
  • 17. What to do next Save your scripts, scene and project. Move on to the next section. Come back once the section is finished. More Content Coming Soon
  • 18. Word Wrapping & Joining Strings
  • 19. Lecture Summary How to write long strings in C# code How word wrapping works on UI Text
  • 21. In This Lecture… • The structure of our “engine” • What’s an enum? • Challenge: complete the story
  • 22. The Structure Of Our “Engine” • Update() keeps game in the right state. • State methods: set text & respond to keys. • One state method per state.
  • 23. What’s an enum? “The enum keyword is used to declare an enumeration, a distinct type that consists of a set of named constants called the enumerator list.” http://msdn.microsoft.com/en-us/library/sbbt4032.aspx
  • 24. Complete The Story • Write all 8 state methods. • Write your story text. • Write the if statements to respond to keys. • Test your game flow works.
  • 27. Update Your Update() Method • Add the new states to States enum. • Add new if statements to Update(). • Drop state_ prefix (Search > Replace). • There is a better way, but not now.
  • 28. Rename freedom to corridor_0 • Change the line in Update(). • Rename your state methods. • Update your text. • Update key press options. • Anything else?
  • 30. Add New State Methods • Adding at the top may be easier. • Have your GDD visible. • Test your game.
  • 31. Just Skim This Video • Please create your own story. • Just skim this video. • Useful “code-folding” tips at around 11:20. • Good luck!
  • 32. Local Play Testing • “4-eyes” principle. • Remember to explore all branches. • In my story: Return to cell => Roam call*. * Thanks to Bobby, an early access backer.
  • 33. Build For Web & Share
  • 34. In this video… • Encourage you to create your own story. • How to build for the web. • Test your build locally. • Share using GameBucket.io or similar. • Post to the course discussions & Facebook.
  • 35. Some Ideas For Creation • Tweak our text to make it read better. • Make a whole new game, same structure. • Make a whole new game, different structure. • Translate the game to your native language. • Add images if you want, but we’re covering later.
  • 36. Web Player Build Settings Player Settings… • Default Screen Width = 800 • Default Screen Height = 600 • WebPlayer Template = Black Background • If your text doesn’t fit, reduce font size
  • 37. How To Share Your Game • Copy the URL from www.GameBucket.io. • Check in an anonymous / private browser. • Post as a discussion against this lecture. • Share on www.Facebook.com/UnityCourse
  • 38. Unity 5 & Tweaks
  • 39. In this video… • Remove state logging (line 22).
  • 41. Recap & What’s Next • Did you write your own story? • Go on, be brave! • Maybe ask a friend to write it? • Build for the web. • Share in the Udemy Discussions, or www.CompleteUnityDeveloper.com

Editor's Notes

  1. Don’t use image asset yet, just import it
  2. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  3. Don’t use image asset yet, just import it
  4. public Text text; if (Input.GetKeyDown(KeyCode.B)) { text.text = "Test"; // small t as it's the instance }
  5. public Text text; if (Input.GetKeyDown(KeyCode.B)) { text.text = "Test"; // small t as it's the instance }
  6. public Text text; if (Input.GetKeyDown(KeyCode.B)) { text.text = "Test"; // small t as it's the instance }
  7. public Text text; if (Input.GetKeyDown(KeyCode.B)) { text.text = "Test"; // small t as it's the instance }
  8. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  9. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  10. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  11. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  12. text.text = "YOUR PARTNER BETRAYS YOU TOO, consectetur adipisicing elit, " + "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. " + "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris " + "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in ";
  13. private enum states {elf, wizard, spy}; see GDD for list of states
  14. AFTER: IF done skip to end of video.
  15. It’s worth the effort to keep things simple. Use Search > Replace
  16. Hint 1: Update lock_1() to go to new state. Hint 2: Remember enum list.
  17. Skip this if you’re writing your own story.
  18. Pull panel from RHS of screen