Swift 2.0 and Sprite Kit Basics for Game Developers

Learn the basics of Swift 2.0 and Sprite Kit. Included are past lessons for Swift 1 which still apply.
3.9 (43 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.
7,276 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 35
  • Length 6 hours
  • Skill Level All Levels
  • 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 10/2014 English

Course Description

In the Swift Basics section of video tutorials, I’ll teach some of the basic things you can do with Swift in Xcode. If you’re completely new to programming or just need a little refresher, this is a great starter tutorial series, and it is all completely free.

In the Swift and Sprite Kit section, you can follow right along with me during my first week with Sprite Kit and Swift. Although, I’m quite comfortable behind the wheel with Sprite Kit, these videos were recorded over my first 5 days with Swift, so this series is a bit more off-the-cuff, experimental, and reveals some of my initial “ah-ha” moments with the language.

What are the requirements?

  • Have Xcode 6 or 6.1
  • Use a Mac, preferably with Yosemite but not required

What am I going to get from this course?

  • Feel comfortable with common programming terms in Swift
  • Create functions, variables, and work with different types
  • Be able to import image assets and work in a simple Sprite Kit based physics environment

What is the target audience?

  • No prior programming knowledge is needed
  • Anyone who wants a refresher in some general programming topics with Swift

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: Swift 2.0 Basics
Swift 2.0 - Variables and Optionals
Preview
14:28
Swift 2.0 Functions and Returning Values
Preview
09:57
Swift 2.0 Enum types and Switch Statements
Preview
09:28
Swift 2.0 Iterating through Arrays
Preview
09:43
Swift 2.0 Looking up keys and values in a Dictionary
Preview
07:45
Section 2: Swift 2.0 with Sprite Kit in Xcode 7
SpriteKit & Swift 2.0 Tutorial - Importing Images and Safe Casting
Preview
13:13
SpriteKit & Swift 2.0 Tutorial - Enumerating all children (even in SKReferences)
Preview
08:13
SpriteKit & Swift 2.0 Tutorial - Subclassing with the new Custom Class Inspector
Preview
05:44
SpriteKit & Swift 2.0 Tutorial - Physics & using SKCameraNode to track a node
Preview
14:41
SpriteKit & Swift 2.0 Tutorial - SKActions, in particular RunBlock
Preview
10:51
SpriteKit & Swift 2.0 Tutorial - Detecting collisions with SKPhysicsContacts
Preview
08:36
More Gaming Resources
Preview
02:01
Section 3: Swift 1.0 Basics (recorded in the not-so-distant past, so it still applies)
06:47

In these video tutorials I’ll be teaching some of the basics of Swift in Xcode. This lesson we’ll look at simply opening Xcode and creating a Swift based Sprite project.

Variables, Optionals and More
09:47
11:15

This video we’ll look at writing a function (or the thing formally known as "methods" in Objective C), passing a parameter into it, and returning a value from the function.

12:24

This lesson we’ll look at if statements, if…else statements, bool variables, and how to create a variable in an if statement when an optional does not equal nil. For example…

if let siteName = siteToPlug {

println(siteName)

}

09:36

This lesson we’ll look at enumerations and switch statements

06:47

This tutorial we’ll look at the Swift way of making Arrays and iterating through either with a for loop.

09:23

This tutorial we’ll look at the Swift way of making Dictionaries and iterating through either with a for loop.

12:51

This tutorial we'll look at creating Classes (and briefly Structs).

11:23

This tutorial we'll look at adding initializers to our class from the previous lesson.

10:30

This tutorial we'll look briefly at creating a subclass of an Enemy class.

Section 4: Swift 1.0 and SpriteKit (recorded in the not-so-distant past)
12:07

In this series, I'll be documenting my first 5 days using Swift. The highs, the lows, the "ah-ha" moments, it'll all be here. Although I'm no novice to game programming (I've written a book, recorded hundreds of hours of programming tutorials and created an iOS game engine), this is a brand new programming language for me too. I'll be using Swift and Sprite Kit, so for you budding game developers out there, this is a great primer series to get you started on the road to making your first app.

10:55

This continues right where the first video from Day 1 leaves off.

14:59

In this video, we'll play around with some of the physics using Swift and Sprite Kit.

10:36

Its now my 3rd day with Swift, and in this video, I'll start a new project, bring in new art assets, and discuss enum types, and look at how we could use them to examine different states of a game character or enemy. If you feel comfortable with setting up your Swift-based project already feel free to skip to around the 6:00 mark.

07:57

We'll look at testing class types, using the update function in the main game scene class to update other classes and cycling through various states with different SKTextures. Sound fun? Hit Play.

11:12

In this video, we'll continue right where we left off in the previous video and enumerate through all children in the scene during the update statement

11:22

In this video we will play around with moving sprite during the update statement when we tap the screen and also change textures depending on the current state.

10:00

In Day 4 of this series, we will look at creating a Dictionary to pass into a subclass of SKNode which we'll use as a platform for our game character to fall onto (and kind of walk along).

09:48

We will continue by subclassing SKNode for our platform

10:11

Continuing from the previous video, we'll create multiple instances of the platform using a for loop.

07:23

Continuing from the previous video, we'll now add an SKPhysicsBody for each sprite and trigger them to switch from dynamic to non-dynamic from the main Game Scene class.

10:11

Day 5, In this video we'll look at creating collision / contact listeners in the GameScene class. This will enable us to test when two objects have collided with each other (or through each other). We'll look at code specifics such as SKPhysicsContactDelegate, categoryBitMask, collisionBitMask, contactBitMask and plenty more.

Update: toRaw() is now rawValue in Xcode 6.1. The compiler will prompt you to change it.

Day 5 - More testing with the Contact Delegate
11:21

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Justin Dike, CartoonSmart / Owner / Leader Developer and Instructor

Justin Dike is the founder of CartoonSmart one of the internet's first video training websites. He is a long-time illustrator and animator, focusing mostly on Adobe Flash, and experienced programmer with Swift, Sprite Kit, Actionscript 3, Objective C and Cocos2d. For CartoonSmart he has recorded hundreds of hours of video tutorials and recently published his first full length book titled iOS Programming with Xcode and Cocos2d available in the iBookstore. Justin has also developed many iOS games, including a side scrolling game engine.

Ready to start learning?
Take This Course