# How To Make a Game Like Space Invaders with Sprite Kit and Swift Tutorial: Part 1

**URL:** <https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700>\
**Category:** 🎓 Courses & Articles\
**Created:** [May 10, 2016, 1:01pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700 "2016-05-10T13:01:28Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![naturaln0va](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/naturaln0va/32/105148_2.png) [@naturaln0va](https://forums.kodeco.com/u/naturaln0va)\
**Post date:** [May 10, 2016, 1:01pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/1 "2016-05-10T13:01:28Z")

</div>

Learn how to make a game like Space Invaders using Apple's built-in 2D game framework: Sprite Kit!

* * *
 This is a companion discussion topic for the original entry at [https://www.raywenderlich.com/1167-how-to-make-a-game-like-space-invaders-with-spritekit-and-swift-part-1](https://www.raywenderlich.com/1167-how-to-make-a-game-like-space-invaders-with-spritekit-and-swift-part-1)

---

<div class="post-metadata">

**Author:** ![navytrident933](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/navytrident933/32/32974_2.png) [@navytrident933](https://forums.kodeco.com/u/navytrident933)\
**Post date:** [May 18, 2016, 5:14pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/2 "2016-05-18T17:14:24Z")

</div>

Hello, when I downloaded this tutorial on Xcode, it didn’t build. Instead, it gave me six errors. I don’t know if that is because I didn’t put the code in, however, when I tried to simulate the Gamescene.swift, it opened up an iphone screen instead without the opening screen as shown. If you could please help, I would appreciate it. Thank you.

---

<div class="post-metadata">

**Author:** ![naturaln0va](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/naturaln0va/32/105148_2.png) [@naturaln0va](https://forums.kodeco.com/u/naturaln0va)\
**Post date:** [May 18, 2016, 5:49pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/3 "2016-05-18T17:49:50Z")

</div>

Hi @navytrident933, I’d love to help you get this working. What version of Xcode are you using? This tutorial has been updated for Xcode 7.3. Also what are the errors you are getting?

---

<div class="post-metadata">

**Author:** ![navytrident933](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/navytrident933/32/32974_2.png) [@navytrident933](https://forums.kodeco.com/u/navytrident933)\
**Post date:** [May 18, 2016, 6:38pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/4 "2016-05-18T18:38:40Z")

</div>

The Xcode version I am using is version 7.1. I just realized that myself and I am updating it right now. I think that might have been the reason as to why I was getting the errors. I didn’t realize it had an update. Thank you for letting me know. The errors I was getting were in the gamescene.swift file and they were syntax errors such as missing argument in parameter and the expected ‘,’ separator error. Also the expected expression in list of expressions.

---

<div class="post-metadata">

**Author:** ![naturaln0va](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/naturaln0va/32/105148_2.png) [@naturaln0va](https://forums.kodeco.com/u/naturaln0va)\
**Post date:** [May 18, 2016, 6:52pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/5 "2016-05-18T18:52:47Z")

</div>

Okay, getting Xcode updated to 7.3 should solve this then. Let me know if it works after the update if not I’ll see how else I can help you get this working. :]

---

<div class="post-metadata">

**Author:** ![kithril](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/kithril/32/94147_2.png) [@kithril](https://forums.kodeco.com/u/kithril)\
**Post date:** [May 22, 2016, 5:50pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/6 "2016-05-22T17:50:51Z")

</div>

Great tutorial! Small bug in the text: “Now replace the _ **println** _ statement in processUserMotionForUpdate (right after comment // 4) with the following:” should read “Now replace the _ **print** _ statement in processUserMotionForUpdate (right after comment // 4) with the following:”.

As an aside, I like that Swift ditched strangely non-camelCase println with print. I suspect that println reflects Java influence.

---

<div class="post-metadata">

**Author:** ![smokedog969](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/smokedog969/32/56582_2.png) [@smokedog969](https://forums.kodeco.com/u/smokedog969)\
**Post date:** [December 19, 2016, 5:51pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/7 "2016-12-19T17:51:15Z")

</div>

Great tutorial. Has someone an idea for realizing the invader movement sound like in the original game?

---

<div class="post-metadata">

**Author:** ![strifecrafter](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@strifecrafter](https://forums.kodeco.com/u/strifecrafter)\
**Post date:** [January 20, 2017, 5:50pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/8 "2017-01-20T17:50:11Z")

</div>

Shouldn’t

```
   // 4
    for _ in 1..<kInvaderRowCount {
      // 5

```

Actually be referring to ‘kInvaderColCount’ ?

Since both the row and the column counts are identical, the result is the same in this case, but it would have made the logic of placing the sprites on the grid easier to understand for me.

---

<div class="post-metadata">

**Author:** ![naturaln0va](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/naturaln0va/32/105148_2.png) [@naturaln0va](https://forums.kodeco.com/u/naturaln0va)\
**Post date:** [January 20, 2017, 6:12pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/9 "2017-01-20T18:12:57Z")

</div>

Good catch! I updated the tutorial so it’s not confusing for others in the future.

---

<div class="post-metadata">

**Author:** ![strifecrafter](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@strifecrafter](https://forums.kodeco.com/u/strifecrafter)\
**Post date:** [January 24, 2017, 5:53pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/10 "2017-01-24T17:53:09Z")

</div>

Minor syntax change:

> Add the following code to createContent() right before the setupInvaders() line:  
> physicsBody = SKPhysicsBody(edgeLoopFromRect: frame)  
> The new code adds the physics body to your scene.

XCode 8.2.1 helpfully informed me that the new syntax is:

> physicsBody = SKPhysicsBody(edgeLoopFrom: frame)

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [October 16, 2017, 12:28pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/11 "2017-10-16T12:28:47Z")

</div>

This tutorial is more than six months old so questions regarding it are no longer supported for the moment. We will update it as soon as possible. Thank you! :]

---

<div class="post-metadata">

**Author:** ![shogunkaramazov](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/shogunkaramazov/32/108826_2.png) [@shogunkaramazov](https://forums.kodeco.com/u/shogunkaramazov)\
**Post date:** [October 16, 2017, 12:28pm UTC](https://forums.kodeco.com/t/how-to-make-a-game-like-space-invaders-with-sprite-kit-and-swift-tutorial-part-1/14700/12 "2017-10-16T12:28:52Z")

</div>

Closed on October 16, 2017, 12:28pm UTC


