This course is all about starting to learn how to develop video games using the C# programming language and the Unity game engine on Windows or Mac. Why use C# and Unity instead of some other language and game engine? Well, C# is a really good language for learning how to program and then programming professionally. Also, the Unity game engine is very popular with indie game developers; Unity games were downloaded 16,000,000,000 times in 2016! Finally, C# is one of the programming languages you can use in the Unity environment.
This course doesn't assume you have any previous programming experience. Don't worry if you've never written code before; we'll start at the very beginning and work our way up to building small games by the end of the course. Throughout the course you'll learn core programming concepts that apply to lots of programming languages, including C#, and you'll also learn how to apply those concepts when you develop games.
Computer programming is really fun in general, and programming games is even better!
Caution: Beginning (assuming no prior programming knowledge) is not the same as easy (not hard to do). Learning to program IS hard to do, especially since this course is essentially the first half of a freshman-level college course. Meeting the course challenges while you master the material will be rewarding to you, but doing that will require hard work and maybe even a few expletives along the way.
Module 1: Write your first C# console application and Unity script and learn how we store data in our programs
Module 2: Learn how we use classes and objects to implement our code
Module 3: Learn the basics of Unity 2D games and discover how we make decisions in our code
Module 4: Get and use player input in your Unity games
Module 5: Complete final peer review and take "Final Exam"
“Unity” is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere.
This course is an independent work and is not sponsored by, authorized by, or affiliated with Unity Technologies or its affiliates

Taught By

Dr. Tim "Dr. T" Chamillard

Associate Professor

Transcript

In this lecture, we'll talk about Booleans. And Booleans can only have one of two values, true or false. Now there's a whole algebra called the Boolean algebra built around this idea of Booleans. But from our perspective within our coding, Booleans are particularly helpful to us as we need to make decisions in our code. And so we'll see how useful that is starting in the next lecture. You'll just have to believe me for now that this is really going to help us as we write our code. Before we continue discussing Booleans, you should go do an in-video quiz asking you about information that I haven't shared with you at all. Okay, the answer is George Boole, in case you were wondering. With NC Sharp we get a data type to store values of only true or false, and that data type is called bool. We've actually seen this when we did the lecture and we accessed the deck empty property, that property returned a bool to us and the decks can only be empty or not. So, variables of the data type of bool can only have values true or false. The other thing that we're really going to use a lot is Boolean expressions. So, Boolean expressions can also only evaluate to true or false. Let's start by talking about the logical operators that we include in Boolean expressions. The first one we'll discuss is And. So if we have two Boolean variables, A and B, and we evaluate A ampersand ampersand B, that will evaluate to true only if both A and B are true. If either A or B is false or both of them is false, then the And operation will evaluate to false. So And means both of them are true, Or means that one or both of them is true. So the only way Or can evaluate to false is if both of them are false. And the final logical operator that we'll regularly use is something called Not, and it's a unary operator. And so it only works on a particular Boolean variable, and it's a negation. So, basically, if A, let's say Not A, if A is true then Not A is false because Not true is false. And similarly, if A is false, then Not A is true. So, that might seem like really confusing stuff. As we work our way through the course and later courses, we will develop a Boolean expressions and it will become more natural to you to sort of think about the conditions you're trying to check and to formulate a Boolean expression to check them. Now, the other kind of operator that we regularly use in our Boolean expressions is called a relational operator. It's checking the relationship between two different values. So, equal equal is checking for equality. If name equal equal Bob, for example, or if score equal equal 10 million, not equal is obviously checking non-equality. And then of course we have less than, less than or equal to, greater than, and greater than or equal to, which should seem natural to you. So before we go to the recap for this lecture, you should do an in-video quiz about Boolean expressions. To recap, today we learned that Booleans can only have a value of true or false. And we learned that we get both a data type, bool, in C-sharp to store values of true or false. And we also learned that we have Boolean expressions that we can use to build more complicated expressions to evaluate particular conditions, and that's going to be really helpful to us when we start making decisions in our code.

Explore our Catalog

Join for free and get personalized recommendations, updates and offers.