Learning C# 7 By Developing Games with Unity 2017 - Third Edition

Develop your first interactive 2D and 3D platformer game by learning the fundamentals of C#
Preview in Mapt

Learning C# 7 By Developing Games with Unity 2017 - Third Edition

Micael DaGraca, Greg Lukosek

Develop your first interactive 2D and 3D platformer game by learning the fundamentals of C#

Quick links: > What will you learn?> Table of content

eBook
$28.00
RRP $39.99
Save 29%
Print + eBook
$49.99
RRP $49.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$28.00
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook

Frequently bought together


Learning C# 7 By Developing Games with Unity 2017 - Third Edition Book Cover
Learning C# 7 By Developing Games with Unity 2017 - Third Edition
$ 39.99
$ 28.00
Mastering Unity 2017 Game Development with C# - Second Edition Book Cover
Mastering Unity 2017 Game Development with C# - Second Edition
$ 39.99
$ 28.00
Buy 2 for $35.00
Save $44.98
Add to Cart

Book Details

ISBN 139781788478922
Paperback290 pages

Book Description

With the latest version of Unity 2017 released, are you interested in developing creative and interactive games while learning C# alongside? Then this is the book that you are looking for. Its all about offering you a fun introduction to the world of game programming with C#.

You’ll start with the basics to get started with C# 7 and its latest features. Then you’ll see how to use C# 7 and its latest functional programming capabilities to create amazing games with Unity 2017.

You’ll create your first C# script for Unity, add objects into it, and learn how to create game elements with them. Then you’ll work with the latest functional programming features of C# and how to leverage them for great game scripting.

Throughout the book, you’ll learn to use the new Unity 2017 2D tool set and create an interactive 2D game with it. You will make enemies appear to challenge your player, and go through some optimization techniques to ensure great game performance. At the end, your 2D game will be transformed into 3D, and you’ll be able to skill up to become a pro C# programmer with Unity 2017!

Table of Contents

Chapter 1: Discovering Your Hidden Scripting Skills and Getting Your Environment Ready
Prerequisite knowledge to use this book
Dealing with scriptphobia
Downloading Unity
Teaching behavior to GameObjects
C# documentation – where to find it and do I need it at all?
Working with C# script files
Creating a C# script file
Introducing the MonoDevelop code editor
Instance? What is this?
Summary
Chapter 2: Introducing the Building Blocks for Unity Scripts
Understanding what a variable is and what it does
What is a method?
Introducing the class
The Start(), Update(), and Awake() methods, and the execution order
Components that communicate using dot syntax
Making decisions in code
Pencil and paper are powerful tools
Summary
Chapter 3: Getting into the Details of Variables
Writing C# statements properly
Understanding component properties in Unity's Inspector
Changing a property's value in the Inspector panel
Private variables
Naming your variables properly
Beginning variable names with lowercase
Using multiword variable names
Declaring a variable and its type
Assigning values while declaring a variable
Where you declare a variable is important
Variable scope - determining where a variable can be used
Summary
Chapter 4: Getting into the Details of Methods
Using methods in a script
Naming methods properly
Defining a method the right way
Understanding parentheses - why are they there?
Specifying a method's parameters
Returning a value from a method
Summary
Chapter 5: Lists, Arrays, and Dictionaries
What is an array?
Storing items in the List
List <T> versus arrays
Retrieving the data from the Array or List<T>
ArrayList
Dictionaries
Summary
Chapter 6: Loops
Introduction to loops
The foreach loop
The for loop
The while loop
while versus for loops
Loops in statements
Modulo
Searching for data inside an array
Breaking the loop
Summary
Chapter 7: Object, a Container with Variables and Methods
Working with objects is a class act
Instantiating an object
Bored yet?
Using methods with objects
Custom constructors
Overloading
Summary
Chapter 8: Let's Make a Game! – from Idea to Development
Your first game – avoiding the trap of the never–ending concept
What do I need to learn before I start creating my own game?
Game mechanics and core components
Breaking the concept into smaller parts
Testing the mechanics
Target platform and resolution
Target screen resolution
Summary
Chapter 9: Starting Your First Game
Setting up a new Unity project for our game
Preparing the player prefab
PlayerController
User input
Animator
Code
Summary
Chapter 10: Writing GameManager
Gameplay loops
Singleton class
Starting the game
Setting up input keys
Using triggers
Restarting the game
Setting up the player starting position
Code in this chapter
Summary
Chapter 11: The Game Level
Designed levels versus generated levels
Creating a designed level
Creating a generated level
Creating a copy of the level piece
Instantiating
Vector3
Testing LevelGenerator
Extending the level
The code used in this chapter
Summary
Chapter 12: The User Interface
Introducting the Unity UI
Views
Buttons
Hiding and showing the Canvas
Reference exceptions
GameView
The code in this chapter
Summary
Chapter 13: Collectables
Collectables
The coin prefab
High score and persisting data
Health Points and Health bar
Magic Points and Magic bar
The code in this chapter
Summary
Chapter 14: Enemies
What makes an enemy?
Movement
The code in this chapter
Summary
Chapter 15: Audio, 3D Games, and Export
How to add sound effects and music
How to create a 3D game
How to export and make it playable
Code
Summary

What You Will Learn

  • Learn C# 7 using new features like tuples, variables, and non-nullable reference types while building games
  • Understand the fundamentals of variables, methods, and code syntax in C#
  • Use loops and collections efficiently in Unity to reduce the amount of code
  • Develop a game using the object-oriented programming principles
  • Implement simple enemy characters into the game to learn point to point movement and Tree behaviors
  • Avoid performance mistakes by implementing different optimization techniques
  • Export 3D models and 3D animations and import them inside a Unity project
  • With your new knowledge of coding, you will be able to look at Unity's Scripting Reference code examples with confidence

Authors

Table of Contents

Chapter 1: Discovering Your Hidden Scripting Skills and Getting Your Environment Ready
Prerequisite knowledge to use this book
Dealing with scriptphobia
Downloading Unity
Teaching behavior to GameObjects
C# documentation – where to find it and do I need it at all?
Working with C# script files
Creating a C# script file
Introducing the MonoDevelop code editor
Instance? What is this?
Summary
Chapter 2: Introducing the Building Blocks for Unity Scripts
Understanding what a variable is and what it does
What is a method?
Introducing the class
The Start(), Update(), and Awake() methods, and the execution order
Components that communicate using dot syntax
Making decisions in code
Pencil and paper are powerful tools
Summary
Chapter 3: Getting into the Details of Variables
Writing C# statements properly
Understanding component properties in Unity's Inspector
Changing a property's value in the Inspector panel
Private variables
Naming your variables properly
Beginning variable names with lowercase
Using multiword variable names
Declaring a variable and its type
Assigning values while declaring a variable
Where you declare a variable is important
Variable scope - determining where a variable can be used
Summary
Chapter 4: Getting into the Details of Methods
Using methods in a script
Naming methods properly
Defining a method the right way
Understanding parentheses - why are they there?
Specifying a method's parameters
Returning a value from a method
Summary
Chapter 5: Lists, Arrays, and Dictionaries
What is an array?
Storing items in the List
List <T> versus arrays
Retrieving the data from the Array or List<T>
ArrayList
Dictionaries
Summary
Chapter 6: Loops
Introduction to loops
The foreach loop
The for loop
The while loop
while versus for loops
Loops in statements
Modulo
Searching for data inside an array
Breaking the loop
Summary
Chapter 7: Object, a Container with Variables and Methods
Working with objects is a class act
Instantiating an object
Bored yet?
Using methods with objects
Custom constructors
Overloading
Summary
Chapter 8: Let's Make a Game! – from Idea to Development
Your first game – avoiding the trap of the never–ending concept
What do I need to learn before I start creating my own game?
Game mechanics and core components
Breaking the concept into smaller parts
Testing the mechanics
Target platform and resolution
Target screen resolution
Summary
Chapter 9: Starting Your First Game
Setting up a new Unity project for our game
Preparing the player prefab
PlayerController
User input
Animator
Code
Summary
Chapter 10: Writing GameManager
Gameplay loops
Singleton class
Starting the game
Setting up input keys
Using triggers
Restarting the game
Setting up the player starting position
Code in this chapter
Summary
Chapter 11: The Game Level
Designed levels versus generated levels
Creating a designed level
Creating a generated level
Creating a copy of the level piece
Instantiating
Vector3
Testing LevelGenerator
Extending the level
The code used in this chapter
Summary
Chapter 12: The User Interface
Introducting the Unity UI
Views
Buttons
Hiding and showing the Canvas
Reference exceptions
GameView
The code in this chapter
Summary
Chapter 13: Collectables
Collectables
The coin prefab
High score and persisting data
Health Points and Health bar
Magic Points and Magic bar
The code in this chapter
Summary
Chapter 14: Enemies
What makes an enemy?
Movement
The code in this chapter
Summary
Chapter 15: Audio, 3D Games, and Export
How to add sound effects and music
How to create a 3D game
How to export and make it playable
Code
Summary

Book Details

ISBN 139781788478922
Paperback290 pages
Read More

Read More Reviews

Recommended for You

Mastering Unity 2017 Game Development with C# - Second Edition Book Cover
Mastering Unity 2017 Game Development with C# - Second Edition
$ 39.99
$ 28.00
Unity 2017 Game AI programming - Third Edition Book Cover
Unity 2017 Game AI programming - Third Edition
$ 39.99
$ 28.00
C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development - Third Edition Book Cover
C# 7.1 and .NET Core 2.0 – Modern Cross-Platform Development - Third Edition
$ 31.99
$ 22.40
OpenCV 3.x with Python By Example - Second Edition Book Cover
OpenCV 3.x with Python By Example - Second Edition
$ 35.99
$ 25.20
Learning C# by Developing Games with Unity 5.x - Second Edition Book Cover
Learning C# by Developing Games with Unity 5.x - Second Edition
$ 35.99
$ 7.20
Getting Started with Visual Studio 2017, C# 7.0, and Source Control [Video] Book Cover
Getting Started with Visual Studio 2017, C# 7.0, and Source Control [Video]
$ 124.99
$ 106.25