Today we look at how to extend our functions beyond the Update loop by allowing them to pause and resume execution using “Coroutines”. We also take our first look at Unity’s UI system, and use these together to create a “Get Ready” state to prepare our players for gameplay. Get Ready!!! Part 1: Coroutines Incontinue reading
Day 8: Easy Pong 3 (Enumeration & Finite State Machines)
Today we build out the flow of our game logic – setting up the game, starting a round, identifying a scoring event, and starting the next round. There are many steps to consider and so we visually map them out into a flow diagram that we will use to build our “finite state machine”. We will also use an “enumerated type” to create an easy-to-read variable to hold our current state, and use the “GameObject.Find( )” command to allow one object to easily locate another. Let’s go!
continue readingDay 7: Easy Pong 2 (Collisions & Sound)
Today we take a look at collisions – when objects bump into one another. These are some of the most commonly used events because so much of our game mechanics depend on whether or not two things have touched. We use them to determine if a hit was successful, if an enemy has touched us, if we are on the ground, if we should be making a sound. Understanding how collision events are generated and how to interpret them is incredibly important. And today, we will use them to generate game feedback in the form of sounds.
continue readingAssignment #2: Finish Easy Pong
Your assignment is to complete our Pong game by placing and managing the remaining UI components for scoring and messaging, adding the missing steps from our state outline, and customizing the game with your own personal touches. There are five required parts to this, and two that are optional. Completing the required will get youcontinue reading
Day 6: Easy Pong (Unity Physics)
Today we made a better version of our game in a fraction of the time thanks to Unity’s physics engine, and had enough time left over to recreate our paddles using prefab scripts.
continue readingDay 5: Hard Pong Collisions
In our latest class, we established our collision and bouncing system using a two-step process:
- Identify whether or not our ball was still inside of the field of play
- If we are outside of the box, figure out what our position inside should be and move the ball there.
To use this, we will run a number of checks and scenarios using the “if/elseif” and “switch” conditional statements.
continue readingDay 4: Hard Pong (Ping)
In today’s class, we discussed the principles behind what makes an “animation” – the rapid succession of images that create the illusion of movement. We discussed the difference between display rates of monitors (refresh rate) and game engines (frame rates), and covered a little bit of “vector math” which we will use to position and move objects.
continue readingAssignment 1: Paddles
For our first week, we will keep things relatively simple – you will add the two features outlined below to our game. Try to get these working to the best of your ability. For this first assignment you will be graded on the attempt rather than the execution.
continue readingDay 3: Code Basics & Hard Pong
In class today we covered some of the basic rules and concepts of code, such as how to declare a variable, the importance of type, and why you should never confuse = (assignment) with == (is equal to).
Next we started out making our own version of Pong which we called “Ping”. We used Unity primitives to create a playing field, changed the color of the playing field with a material, and set the camera position to give us a top down view.
(Slides and Zipped project from today’s session are available on the course Box folder)
continue readingDay 2: Unity Basics
Today we took a closer look at Unity Hub, the file structure of a Unity Project, and made our first application… an eternal fountain of prefab boxes.
continue reading