Check out a free preview of the full Game Development with Unity for Web Developers course

The "Introduction" Lesson is part of the full, Game Development with Unity for Web Developers course featured in this preview video. Here's what you'd learn in this lesson:

Nick Pettit introduces the course by providing some personal background in game design and development. An overview of the course agenda and a demonstration of the completed Unity game are also provided in this segment.


Transcript from the "Introduction" Lesson

>> Well, hey everybody, I'm Nick Pettit, and today's workshop is introduction to Unity for web developers. In today's workshop, we're going to be creating a video game that we're going to deploy to the web using WebGL. And I'll get to the agenda for today in just a second, but first I wanted to talk a little bit about my journey and how I got into game development.

I've been programming for about 20 years now. And I first got into it by just making websites, actually in front page, if anyone remembers what that is. And so I was making websites, learning about programming. I got into PHP and Ruby on Rails. And I was building websites for my friends and doing it on a contractual basis.

And I started making web applications for myself and for a couple of different businesses I was running. And basically, I got into the education side of it. I was very passionate about sharing the knowledge that I had learned, and I wanted to give back to the community in the same way that I had received so much from the community.

So I did get into teaching it at an online school called Treehouse, so I did that for about ten years. And then during that time, I started getting interested in VR and AR, and I kinda saw the trend that was happening there and it was just a very fascinating space to me.

I wanted to just learn more about how to get into that and how to approach it. And at the time, it really was pretty difficult to do stuff with VR in a web environment, but with a game engine like Unity, it was very accessible, it was very democratized.

And so I started getting into the Unity game engine and just teaching myself learning through YouTube videos. And of course, Unity's website has tons of great resources for learning how to create games with their engine. And at this point, I've been making games for about eight years, and now I make games for a living at a company called Buck.

They're a global creative company that brings brand stories and experiences to life through art, design, and technology. So they do lots of high key advertisements, Super Bowl commercials, that kind of thing. And they wanted to create games, they wanted to get into original IP. So unfortunately, I can't really share a whole lot about what we've been up to, but I can show you some of the past projects that I've worked on.

One in particular that I'm very proud of is called Neptune Flux, it's a deep sea adventure game. And that came out in, well, it came out in 2016 for Steam and I released it on the Vive and Rift. It was also playable without a VR headset. And then I also released it for PlayStation VR.

And that was very exciting. I'd never made a console game before, I'd never worked on a triple A team or anything like that, I was just doing this all from my apartment. [LAUGH] And it was kind of not something I would recommend now. Looking back, that was a very big undertaking and certainly not something I regret, but I learned a lot from it.

But I mean, yeah, I've been making games for about eight years and I have done all sorts of things. I executed on contracts for AR projects, I've made Sim and training demos. And we'll get into more of the applications of Unity in a just sec, but let's talk about what we're going to be doing today.

So we are going to make a game. So at the end of this, we'll have a game that we can deploy to WebGL. We'll get started just by learning how to install Unity. You may have Unity installed already, but it's good to know just kind of the ins and outs of that, because it is somewhat of an involved installation process or it can be.

And then we'll take a brief tour of the Unity interface just to kinda get familiar with all of its rearrangeable panels and windows. And then we'll learn about scenes, GameObjects, and components and how those all relate to one another. We'll use C# to make a physics sandbox, and then we'll add player input to that, so that we can actually interact with it and move around.

And then we'll create what's called a game manager script. And so that will kind of be like the game loop, where all of the business logic happens. Then we'll add some UI to the game, so that all of those numbers that we're tracking in the game manager can actually be exposed to the player.

And we'll add more complex behavior on top of that. So we'll start kind of layering more components that will drive some more emergent behavior. And then we'll make the game look better, because we're gonna start out with just kind of gray spheres and cubes. And then we'll add materials and lighting and post-processing on top of that to make things look better.

And then we will deploy the game to a web browser using WebGL, and I think you'll find that is surprisingly easy to do in Unity. So first, I just wanna show you what we're actually going to be creating. So I'll jump here, and you can play this right now, it's at for frontendmasters-unity.

So here's the Unity splash screen. And it says, collect more cubes than your opponent. Press SPACE to Start. So if I hit the spacebar, the game will start, and I can use the WASD keys or the arrow keys to move this gold sphere around and try to collect these little purple orbs.

And you'll see that I have an opponent there, the blue sphere that is also rolling around. It's really using some very simple logic, but it actually has the appearance of having some amount of intelligence, where it's trying to collect these faster than I can. You'll see that there's UI up at the top, so it's keeping score of how many of these I've collected and how many the opponent has collected.

And there's also a timer that starts at 60 seconds and ticks down as the game moves forward. And you'll see that there's other nice little features, like if I roll off the side here, it will actually respawn. And when the timer runs out, there'll be a game over screen.

And I lost. if I had collected more, I would have won, and of course, if it was a tie, it would say it's a tie. And then you can hit the spacebar to start again, and then it'll reset the clock and reset the scores. And there's other cool things that we can do with this.

We can adjust the speeds that you see here to potentially make it a little easier or even more difficult. But yeah, so this is what we're going to be building today.

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now