Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m

Next lesson playing in 5 seconds

Cancel

Free Preview: Code a Side-Scrolling Game With Swift and SpriteKit

Introduction

00:50
  • Overview
  • Transcript

Once in a while, it's important for us as developers to go back to what made us excited about computers in the first place. For Derek Jensen, that is gaming. Games are what originally brought him to the world of computers, and every time he reaches back to that point in his life, he learns something that he wants to share with the Envato Tuts+ community. Today, he wants to share SpriteKit and the world of infinite runner style games.

If you are just starting to code games for iOS, it may seem like a lot to learn. But with a few basic skills, some math, and some determination, you can begin to create games—whether just for you or for sharing with everyone on the App Store. So grab your Mac, and let's start coding a game from scratch with Derek.

We've built a complete guide to help you learn Swift, whether you're just getting started with the basics or you want to explore more advanced topics: Learn Swift.

1. Introduction

1.1 Introduction

Hey there, Tuts fans, Derek Jensen here again and I've recently gone back to playing games. Every once in a while I like to go back to what originally got me into computers in the first place and that's games. So when I start to dive into these things I like to get my hands dirty and I like to play with stuff. And when I do that I typically uncover something that I wanna share with you guys. So today we're gonna be talking about creating a very basic SpriteKit game, but this time we're gonna start to dig into side scrolling, infinite runner, parallax background style games. Now while that may sound a little bit complicated, it really isn't. If you can handle some basic math, have a decent understanding of the Swift programming language and have maybe dabbled a little bit with the SpriteKit built into iOS, then this course is for you. So hold on to your hats. It's time to get into game mode.

1.2 Prerequisites

So let's dive straight into prerequisites. Now for this particular course, like so many other iOS development courses and tutorials that you followed along on Tutsplus, you're gonna know that for the most part, you really only need one tool and that's Xcode. And if you don't already have it, then all you need to do is head over to app store. It's a free download, and you can download it and install it on just about any Mac. I highly recommend you getting the latest and greatest version. The latest version in this case is actually 8.1 or a new build of 8.1. So you can go ahead and download that and install it. I have a previous build of 8.1, so I don't have the latest and greatest bits. But for the most part, those were additions for the touch bar and some of the new things that are gonna be supported now on the new Mac Books. So for the most part, as long as you have an 8.x version, you should be fine to follow along with this course. And that's really all you're going to need as far as tooling. Now in addition to that, I'm going to be going over several concepts in this course that are gonna have to do with SpriteKit. Now if you have never done any sort of SpriteKit development, then you may wanna think about heading back to one of my previous courses. It's a little bit old. It was done in 2015, but the good thing is that for the most part SpriteKit really hasn't changed all that much from then until now. What has changed though, is the Swift programming language. At that point, we were right around 1.0 or 1.1 and we're up to version 3 right now. So what you will see are some changes in the way things are written within Swift. Although it will be all that difficult for you to follow along, if you're familiar with an older version, it would definitely behoove you to go back to this particular course, to understand some of the basics and fundamentals like what is a Sprite? What are seams? What are nodes? How to add things to the scene? How do you detect collisions and things like that. Since we're gonna be talking about a lot of these topics in this course, and I'm not gonna be going really deep into them or as deep as I went into them in this previous course, because we're trying to get from nothing to a side scrolling game. That's really the goal here. So like I said, if you don't have a lot of familiarity with either Swift or SpriteKit, then I would definitely advise you to go back and take a look at this course. And kind of bring yourself up to speed a little bit and then hop into this one. So without further ado, let's get started.