Make a Tetris-style Puzzler in Unity

Build a tile-based puzzle game with C# and Unity
4.8 (65 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
468 students enrolled
$19
$40
52% off
Take This Course
  • Lectures 96
  • Length 10 hours
  • Skill Level Intermediate Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 4/2016 English

Course Description

Update 6/2016:  New lessons on porting our application to Android have been added!   See your glorious game run on a mobile device!

Unity 3D  has quickly become one of today's fastest growing game development tools. Learn more about this fascinating game engine in our project-based class, where we build a Tetris-style puzzle game from scratch! If you have some basic knowledge of C# and Unity, take your skills to a new level by exploring this short course in remaking a classic arcade game.

If you have completed a few basic tutorials on Unity and have some basic knowledge of C# (variables, loops, data structures, etc.),this class is for you! We take a project-based approach, where we follow one game from start to finish.

We will:

  • start with a blank Unity project and flesh out a fully working game.
  • learn some fundamental techniques for creating your own puzzle game
  • follow several C# scripts line-by-line and learn how to organize our scripts logically and cleanly

What is covered:

  1. Setup our project settings and environment
  2. Breaking down the gameplay mechanics
  3. Creating a Board class to store our data
  4. Laying out user interface items
  5. Creating our game piece Shape class
  6. Setting up our master GameController class to handle logic
  7. Apply Time to our game logic
  8. Script to handle player input
  9. Add sound effects to game events
  10. Apply particle effects to add some punch to our graphics
  11. Making a score manager to track player progress and high scores
  12. Enhance our game with extra features to make it a polished experience

Join the democratization of game development! Level up your Unity 3D skills and build your Tetris-style game today!

What are the requirements?

  • Unity 3D version 5 or above (FREE versions)
  • Mac or PC
  • OPTIONAL Photoshop or image-editing program to customize art assets (otherwise, use the downloadable art assets provided)

What am I going to get from this course?

  • Make their own Tetris-like puzzle game to be deployed on Mac or PC!

What is the target audience?

  • This course is meant for beginning to intermediate students with some familiarity with Unity and C#
  • This course is NOT meant as an introduction to Unity; though we will walk you step-by-step through the project, do NOT use this as your first course in Unity
  • Some working knowledge of C# is necessary; do NOT use this as an introduction to C#
  • If you are a beginning to intermediate game developer interested in improving your skill set, this course is for you!

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Introduction
01:13

Unity 5 has quickly become one of today's fastest growing game development tools. Learn more about this fascinating game engine in our project-based class, where we build a Tetris-style puzzle game from scratch! If you have some basic knowledge of C# and Unity, take your skills to a new level by exploring this short course in remaking a classic arcade game.

Prerequisites: Before you begin this course you should have:

  • Mac or PC capable of running Unity 5
  • Unity 5 (Free Version)
  • Basic knowledge of Unity's interface
  • Some basic working knowledge with C# language
  • Optional: Photoshop or any image-editor to customize art assets

What is the target audience?

  • Beginner to intermediate developers who want to continue exploring Unity 3D
  • Game artists who want to improve their coding skills in C#

If you have completed a few basic tutorials on Unity and have some basic knowledge of C# (variables, loops, data structures, etc.),this class is for you! We take a project-based approach, where we follow one game from start to finish.

We will:

  • start with a blank Unity project and flesh out a fully working game.
  • learn some fundamental techniques for creating your own puzzle game
  • follow several C# scripts line-by-line and learn how to organize our scripts logically and cleanly

What is covered:

  1. Setup our project settings and environment
  2. Breaking down the gameplay mechanics
  3. Creating a Board class to store our data
  4. Laying out user interface items
  5. Creating our game piece Shape class
  6. Setting up our master GameController class to handle logic
  7. Apply Time to our game logic
  8. Script to handle player input
  9. Add sound effects to game events
  10. Apply particle effects to add some punch to our graphics
  11. Making a score manager to track player progress and high scores
  12. Enhance our game with extra features to make it a polished experience


Join the democratization of game development! Level up your Unity 3D skills and build your Tetris-style game today!

02:10

Before you take this Course, you need:

  • Mac or PC capable of running Unity 5
  • Unity 5 (Free Version)
  • Basic knowledge of Unity's interface
  • Basic working knowledge with C# language
  • Optional: Photoshop or any image-editor to customize art assets


01:34

Each lecture of this course will build on the last. So you should be able to follow straight through these lessons if you are going quickly in about a day or a weekend.

Periodically there will be "save points," where you can download an entire project in case you lose your way or you want to pick up from a particular point and start in the middle.

Look for the Lectures marked Save Point so you download the project from the Downloadable Resources tab.


03:54

Flashbacks from 1984 to present day!

Section 2: Project Setup
03:30

An overview of our project structure. Download the TetrisCloneStart.zip file if you want a project with the folders already created!

Article

This slide shows our sample project organization structure.

Article

Download the TetrisCloneStart.zip file if you want a project with the folders already created!

Section 3: The Game Board
02:26

Here we will introduce the core classes of our game:

  • Board
  • Shape
  • Spawner
  • GameController
03:36

Here we set up our Board class, which will draw an empty grid and store our shapes... eventually.

05:05

Create an empty grid square in Photoshop or use the one from the Downloadable Resources tab.

05:14

We will need to setup some camera settings to see our game board.

04:02

We create a prefab from our empty square sprite, so it can be replicated to form a grid.

02:09

Let's create a method to draw the empty grid.

03:25

Here we cover a few ground rules for how our methods and variables are named for this project.

06:29

Finally we get our empty grid drawn on screen!

02:21

Let's create a two-dimensional array to store our landed Shapes.

Article

Our game board and Board class is complete.

Section 4: User Interface
01:51

Let's start exploring Unity's User Interface system. If you already have experience with the UI system and don't want to go through the section, skip to Save Point III and resume the course in the next section.

03:46

Exploring our first Canvas object in Render Mode: Overlay.

11:56

Here we will start layout out our user interface.

10:12

We use Layout Groups to space the icons in our lower panels automatically!

04:04

We add a border to our game board using a nine-slice sprite.

07:19

We add a Canvas in Render Mode: World space to add a background.

Article

This Save Point includes our roughed out but non-functional interface along with our rudimentary Board class.

Section 5: Core Components
06:46

We lay out our seven Shape prefabs that will be our main game pieces.

The Shape Class
05:42
The GameController Class
02:38
Referencing Other Game Objects
09:31
The Spawner Class
04:42
The Vectorf Class
03:06
Article

This Save Point has our Board, Shape, GameController and Spawner classes created, but has no game mechanics implemented yet.

Section 6: Game Mechanics
04:22

Move and Rotate our Shape

02:53

Here we being to explore Unity's Time class, which will help us create events that happen at an interval.

05:51

We add some methods to the Board class to check for boundaries.

04:49

Here we store any Shapes that land in our Board's grid array.

12:40

Here we will explore the Input class and the Input Manager, where we will setup our "virtual axes" for MoveRight, MoveLeft, MoveDown and Rotate.

05:07

We'll briefly examine the Input.GetKey and Input.GetKeyDown methods and refactor our code to use a PlayerInput method in our GameController class

12:53

Here we finish setting up all four inputs:  MoveRight, MoveLeft, MoveDown and Rotate.  We should be able to manipulate our active shape once we are finished!

09:56

We add the ability to clear rows when they are complete!

12:14

Let's check for our Game Over condition!

Article

Our first iteration of the game is complete!

Section 7: Sounds
05:32

We setup our SoundManager class, which will help us playback sound effects and music.

12:38

We setup an AudioSource for our BackgroundMusic audio and configure the SoundManager to control music playback.

09:57

Let's add some sound effects.

06:53

We add some sounds when we move our Shapes.

04:12

Let's add some sounds when we clear a row.

04:33

We add some vocal effects for different events in our game.

Article

We've added some basic background music and sound effects to our game!

Section 8: UI Enhancements
06:29

We create a class that lets us toggle between two alternate icons.

07:01

We add the toggle that allows us to switch our default rotation direction.

10:58

We create a Pause button to pause to the game.

06:50

We create a Screen Fader to help transition our game to its starting and end states.

11:39

Here we finish our Screen Fader and learn how Coroutines work.

Article

We have added some UI enhancements to our project!

Section 9: Scoring
07:07

The ScoreManager class will help the game keep score of player progress.

04:31

Let's add some UI to show off our score!

12:31

We finish the Lines and Level indicator in the lower left of the user interface!

Article

Our game can now keep score!

Section 10: Gameplay Extras
10:25

We add a helper "ghost" to preview where our Shape will land.  Definitely a great gameplay feature!

06:01

We modify the Spawner class to give us a three-Shape preview of things to come.

13:58

We finish the Shape queue!

11:23

We add a small button to hold a Shape for layaway!

10:54

We finish the Hold button.

Article

We have finished our Ghost, Shape Queue and Hold button features!

Section 11: Particles
02:19

We learn to jazz up our game with some particle effects!

10:26

Let's make a simple glowing square effect that we can re-use through our game.

16:13

We add the vertical streak effects to accompany our Glowing Square effect.

12:12

No glowing square is complete without sparkles!

04:46

The Particle Player class allows you playback multiple ParticleSystems at runtime.

07:20

Let's modify our Glowing Square effect to show off an effect when a whole row clears!

07:55

Let's make the Row Glow effect work for more than one row at a time!

10:21

We modify the Glowing Square effect to trigger an effect whenever a Shape lands on the board.

09:42

We swap out our Rounded Block sprite to give our game a little more style.  We also add lots of ParticleSystem goodies to help make our background come alive!

11:52

Let's add some more ParticleSystem goodies and trigger them with events in our scripts!

Article

Our game is complete!

02:55

Let's build our game as a Standalone application!

Section 12: Bonus: Porting to Mobile Devices
01:52

Let's convert our PC and Mac Standalone project to use either iOS or Android!

02:36

We connect our Android device and prepare it to receive our Unity game!

04:41

Here we setup the device for Developer Options and edit Unity's Preferences to point to our SDKs.

09:24

In this lesson, we will set up our Developer account, download Xcode and then prepare our  iOS device for building!

09:56

We Build and Run for Android!  Finally!

10:29

Let's build our game to your iOS device

05:32

A look at the Input class's properties on how we access touchscreen information.

06:42

Some background on C# delegates before we get too far in our TouchController.

04:50

Events use C# delegates to create a unique structure for sending messages from one object to another using the broadcaster/listener model.

The TouchController Class
05:10
07:12

Because we don't have a console onscreen, we add some UI.Text elements that will give us a diagnostic readout when we interact with the screen.

09:01

In this lesson, we add a function to the GameController that can handle the SwipeEvent from the TouchController.  We also look into adding a new event, the SwipeEndEvent.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Instructor Wilmer Lin, Game Developer / Visual Effects Artist

Wilmer Lin is a 3D and visual effects artist with over fifteen years of industry experience and has trained several hundred artists over the course of a decade. Now an independent game developer, Wilmer helps new game developers learn the craft of programming and designing video games using Unity3D, Maya and Photoshop.






Ready to start learning?
Take This Course