# 2D iOS & tvOS Games by Tutorials

**URL:** https://forums.kodeco.com/c/books/2d-ios-tvos-games-by-tutorials/14.md?page=3

[Latest](https://forums.kodeco.com/latest.md) · [Categories](https://forums.kodeco.com/categories.md) · [Tags](https://forums.kodeco.com/tags.md)

**Page:** 4

---

## [Zombie conga project](https://forums.kodeco.com/t/zombie-conga-project/22675)

<div class="topic-metadata">

**Author:** [@alexwibowo](https://forums.kodeco.com/u/alexwibowo)\
**Replies:** 5\
**Last updated:** [November 28, 2017, 9:31pm UTC](https://forums.kodeco.com/t/zombie-conga-project/22675 "2017-11-28T21:31:25Z")

</div>

Hi, I’m reading the zombie conga project on the book, and I’m up to page 66. I got a bit confused with what the book says about velocity vector: " The length is zombieMovePointsPerSec, the constant you defined earlier …

---

## [2D book game CatNap](https://forums.kodeco.com/t/2d-book-game-catnap/36408)

<div class="topic-metadata">

**Author:** [@khodiev979](https://forums.kodeco.com/u/khodiev979)\
**Replies:** 2\
**Last updated:** [November 20, 2017, 2:30pm UTC](https://forums.kodeco.com/t/2d-book-game-catnap/36408 "2017-11-20T14:30:21Z")

</div>

Good day! Help a newbie to solve the issues). 1) How to remove the outline around the cat? 2) Why when I open sks file xcode crashes? Below is a link to the photo Xcode error Dropbox - File Deleted

---

## [Chapter 10 - scene editor not recognizing custom class?](https://forums.kodeco.com/t/chapter-10-scene-editor-not-recognizing-custom-class/15297)

<div class="topic-metadata">

**Author:** [@soggybag](https://forums.kodeco.com/u/soggybag)\
**Replies:** 2\
**Last updated:** [November 19, 2017, 10:25pm UTC](https://forums.kodeco.com/t/chapter-10-scene-editor-not-recognizing-custom-class/15297 "2017-11-19T22:25:49Z")

</div>

I’m sure I’ve got everything setup correctly but, Xcode doesn’t recognize the custom BedNode class. There are no errors. I can enumerate all of the nodes. I tried adding initializers to the BedNode class, these don’t see…

---

## [Dependency Analysis Warning](https://forums.kodeco.com/t/dependency-analysis-warning/36531)

<div class="topic-metadata">

**Author:** [@salanthonyc](https://forums.kodeco.com/u/salanthonyc)\
**Replies:** 1\
**Last updated:** [November 13, 2017, 7:41pm UTC](https://forums.kodeco.com/t/dependency-analysis-warning/36531 "2017-11-13T19:41:05Z")

</div>

After I completed the fourth challenge on page 455, the game is working fine but I now have a Dependency Analysis Warning stating: Multiple build commands for output file … CoinArrow.sks I checked and there is only one…

---

## [Update on p.106, checkCollisions()](https://forums.kodeco.com/t/update-on-p-106-checkcollisions/36516)

<div class="topic-metadata">

**Author:** [@myrhillion](https://forums.kodeco.com/u/myrhillion)\
**Replies:** 1\
**Last updated:** [November 13, 2017, 4:40pm UTC](https://forums.kodeco.com/t/update-on-p-106-checkcollisions/36516 "2017-11-13T16:40:24Z")

</div>

func checkCollisions() { var hitCats: \[SKSpriteNode\] = \[\] enumerateChildNodes(withName: "cat") { node, \_ in let cat = node as! SKSpriteNode if cat.frame.intersects(self.zombie.frame) { hitCats.append(cat) } } for cat in …

---

## [Trouble Testing with iOS 11.1.1](https://forums.kodeco.com/t/trouble-testing-with-ios-11-1-1/36488)

<div class="topic-metadata">

**Author:** [@salanthonyc](https://forums.kodeco.com/u/salanthonyc)\
**Replies:** 2\
**Last updated:** [November 12, 2017, 3:23am UTC](https://forums.kodeco.com/t/trouble-testing-with-ios-11-1-1/36488 "2017-11-12T03:23:38Z")

</div>

I am on page 440 where you can not test in the simulator because of Core Motion. The device that I want to test on is an iPad Air 2 with iOS 11.1.1. Unfortunately, I can not restore iOS 11.0 because I updated from iOS 10…

---

## [Error occurring from p.431 code, Swift 4 Version](https://forums.kodeco.com/t/error-occurring-from-p-431-code-swift-4-version/36467)

<div class="topic-metadata">

**Author:** [@salanthonyc](https://forums.kodeco.com/u/salanthonyc)\
**Replies:** 4\
**Last updated:** [November 12, 2017, 1:17am UTC](https://forums.kodeco.com/t/error-occurring-from-p-431-code-swift-4-version/36467 "2017-11-12T01:17:02Z")

</div>

When I add the code at the top of page 431, I get an error saying: Type ‘Int’ has no member ‘random’ Any suggestions?

---

## [Chap 3 Actions: Memory Leak does not happen](https://forums.kodeco.com/t/chap-3-actions-memory-leak-does-not-happen/31031)

<div class="topic-metadata">

**Author:** [@sevenyoona1990](https://forums.kodeco.com/u/sevenyoona1990)\
**Replies:** 4\
**Last updated:** [November 4, 2017, 9:09pm UTC](https://forums.kodeco.com/t/chap-3-actions-memory-leak-does-not-happen/31031 "2017-11-04T21:09:25Z")

</div>

In Chapter 3, there is a note saying we need to use \[weak self\] in the action closure to prevent memory leak. However, I tried with the following code and run the Instruments Leak checks and can’t see the leak happening. …

---

## [Chapter 3 actionMidMove error](https://forums.kodeco.com/t/chapter-3-actionmidmove-error/36240)

<div class="topic-metadata">

**Author:** [@abunur](https://forums.kodeco.com/u/abunur)\
**Replies:** 1\
**Last updated:** [November 4, 2017, 6:38pm UTC](https://forums.kodeco.com/t/chapter-3-actionmidmove-error/36240 "2017-11-04T18:38:20Z")

</div>

(iBooks / ePub version, so left the page number out) SKAction.move() has the following method signature: let actionMidMove = SKAction.move(by: CGVector, duration: TimeInterval) The code sample in the book reads as fol…

---

## [Vector Math needs better explanation](https://forums.kodeco.com/t/vector-math-needs-better-explanation/35836)

<div class="topic-metadata">

**Author:** [@abunur](https://forums.kodeco.com/u/abunur)\
**Replies:** 1\
**Last updated:** [October 23, 2017, 10:00pm UTC](https://forums.kodeco.com/t/vector-math-needs-better-explanation/35836 "2017-10-23T22:00:13Z")

</div>

just some feedback, Chapter 2: The vector math in Chapter 2 of 2D games RW book kind of lost me. It wasn’t clear why the offset vector has the right direction but the wrong length… or why a “unit vector” means a “vect…

---

## [Cannot assign value of type 'GameScene.CGPoint' to type 'CGPoint'](https://forums.kodeco.com/t/cannot-assign-value-of-type-gamescene-cgpoint-to-type-cgpoint/35506)

<div class="topic-metadata">

**Author:** [@melrain](https://forums.kodeco.com/u/melrain)\
**Replies:** 1\
**Last updated:** [October 13, 2017, 4:35pm UTC](https://forums.kodeco.com/t/cannot-assign-value-of-type-gamescene-cgpoint-to-type-cgpoint/35506 "2017-10-13T16:35:25Z")

</div>

import SpriteKit class GameScene: SKScene{ struct CGPoint { var x: CGFloat var y: CGFloat } struct CGSize { var width:CGFloat var height:CGFloat } override func didMove(to view: SKView) { le…

---

## [Chapter 8 - Challenge 1 - Why Timer?](https://forums.kodeco.com/t/chapter-8-challenge-1-why-timer/35472)

<div class="topic-metadata">

**Author:** [@dbarton](https://forums.kodeco.com/u/dbarton)\
**Replies:** 0\
**Last updated:** [October 11, 2017, 5:11pm UTC](https://forums.kodeco.com/t/chapter-8-challenge-1-why-timer/35472 "2017-10-11T17:11:55Z")

</div>

Hi, I am working on Challenge 1 of Chapter 8 - Forces. I am wondering why the text uses Timer to call an extension method in SKScene? Can the same functionality be created using combinations of SKAction.run and SKActio…

---

## [Dino Defense addNodes to Layer](https://forums.kodeco.com/t/dino-defense-addnodes-to-layer/35310)

<div class="topic-metadata">

**Author:** [@hcastellanos22](https://forums.kodeco.com/u/hcastellanos22)\
**Replies:** 1\
**Last updated:** [October 9, 2017, 7:11am UTC](https://forums.kodeco.com/t/dino-defense-addnodes-to-layer/35310 "2017-10-09T07:11:09Z")

</div>

Dino Defense Entities and Components this is a Dictionary of type \[enum: SKnode\] gameLayerNodes\[.Hud\]!.addChild(towerSelectorNode) My question is How can a Dictionary use the addChild property here. Were is the trick? …

---

## [Is setting a SKScene's size to a multiple of the bounds of SKView a good idea?](https://forums.kodeco.com/t/is-setting-a-skscenes-size-to-a-multiple-of-the-bounds-of-skview-a-good-idea/35214)

<div class="topic-metadata">

**Author:** [@mueller](https://forums.kodeco.com/u/mueller)\
**Replies:** 0\
**Last updated:** [October 4, 2017, 9:01pm UTC](https://forums.kodeco.com/t/is-setting-a-skscenes-size-to-a-multiple-of-the-bounds-of-skview-a-good-idea/35214 "2017-10-04T21:01:46Z")

</div>

Hi, I have a SKView that’s presenting a SKScene. The scene contains a camera and several SKLabelNodes (there are more things, but the labels are my main concern). At first, I created my scene like this(bounds are the bo…

---

## [Error Iphone 8 Xcode 9](https://forums.kodeco.com/t/error-iphone-8-xcode-9/34713)

<div class="topic-metadata">

**Author:** [@archideus](https://forums.kodeco.com/u/archideus)\
**Replies:** 2\
**Last updated:** [September 22, 2017, 6:43am UTC](https://forums.kodeco.com/t/error-iphone-8-xcode-9/34713 "2017-09-22T06:43:12Z")

</div>

2017-09-21 18:04:58.079750+0300 ZombieConga\[6480:772618\] 378: failed assertion: inChannelsPerFrame \>= 4

---

## [Zombie Conga alternate game over strategy](https://forums.kodeco.com/t/zombie-conga-alternate-game-over-strategy/34178)

<div class="topic-metadata">

**Author:** [@spgms](https://forums.kodeco.com/u/spgms)\
**Replies:** 3\
**Last updated:** [September 11, 2017, 2:35pm UTC](https://forums.kodeco.com/t/zombie-conga-alternate-game-over-strategy/34178 "2017-09-11T14:35:42Z")

</div>

In Zombie Conga, instead of game over scenes with images, how would you do a fly-in label with “win” or “lose” message and a button to “play again”. Basically, keeping game and score visible behind label and button inst…

---

## [GameCenter based multiplayer game](https://forums.kodeco.com/t/gamecenter-based-multiplayer-game/33904)

<div class="topic-metadata">

**Author:** [@marcusbambo](https://forums.kodeco.com/u/marcusbambo)\
**Replies:** 0\
**Last updated:** [August 31, 2017, 9:49am UTC](https://forums.kodeco.com/t/gamecenter-based-multiplayer-game/33904 "2017-08-31T09:49:57Z")

</div>

Hi everyone Will there be a section where you describe how to make a multiplayer game using GameCenter (similar to https://www.raywenderlich.com/60980/game-center-tutorial-how-to-make-a-simple-multiplayer-game-with-spri…

---

## [Xcode SpriteKit2D Tile Map Node](https://forums.kodeco.com/t/xcode-spritekit2d-tile-map-node/33782)

<div class="topic-metadata">

**Author:** [@mutagen\_ego](https://forums.kodeco.com/u/mutagen_ego)\
**Replies:** 2\
**Last updated:** [August 29, 2017, 8:20pm UTC](https://forums.kodeco.com/t/xcode-spritekit2d-tile-map-node/33782 "2017-08-29T20:20:42Z")

</div>

I want to create a 2D game platformer on Swift like Mario, and I want to use Tile Map Node. Can I give this Map physical settings, for example let the player be able to run on the textures I make for my game? Or should I…

---

## [DropCharge, Ch17 Juice... coins stop spinning?](https://forums.kodeco.com/t/dropcharge-ch17-juice-coins-stop-spinning/25848)

<div class="topic-metadata">

**Author:** [@emilhizer](https://forums.kodeco.com/u/emilhizer)\
**Replies:** 9\
**Last updated:** [August 13, 2017, 8:54pm UTC](https://forums.kodeco.com/t/dropcharge-ch17-juice-coins-stop-spinning/25848 "2017-08-13T20:54:13Z")

</div>

On page 482/483 we programmatically make the coins (template) use the animated (spinning) coins. This looks great until the player jumps high enough to start using the addRandomForegroundOverlay() method. At this point, …

---

## [Confused about where to get images](https://forums.kodeco.com/t/confused-about-where-to-get-images/32873)

<div class="topic-metadata">

**Author:** [@isorensen](https://forums.kodeco.com/u/isorensen)\
**Replies:** 1\
**Last updated:** [August 12, 2017, 8:10pm UTC](https://forums.kodeco.com/t/confused-about-where-to-get-images/32873 "2017-08-12T20:10:05Z")

</div>

In the ZombieConga it says to drag the appropriate icon from starter/resources/icons. What does this mean? I’ve tried to add it to the link but didn’t work. Help please!

---

## [zPosition Not Rotating? (FIXED)](https://forums.kodeco.com/t/zposition-not-rotating-fixed/33226)

<div class="topic-metadata">

**Author:** [@puppet](https://forums.kodeco.com/u/puppet)\
**Replies:** 0\
**Last updated:** [August 12, 2017, 4:59pm UTC](https://forums.kodeco.com/t/zposition-not-rotating-fixed/33226 "2017-08-12T16:59:15Z")

</div>

FIXED: autocompleted as zPosition instead of zRotation and I didnt catch it. Hello, it seems the following code will not rotate 22.5 degrees as indicated in the book (page 48). The background image just stays perfect…

---

## [Drop Charge Scrolling Twitches - Seen in many other scrolling projects too](https://forums.kodeco.com/t/drop-charge-scrolling-twitches-seen-in-many-other-scrolling-projects-too/32819)

<div class="topic-metadata">

**Author:** [@arrow](https://forums.kodeco.com/u/arrow)\
**Replies:** 9\
**Last updated:** [August 4, 2017, 1:11pm UTC](https://forums.kodeco.com/t/drop-charge-scrolling-twitches-seen-in-many-other-scrolling-projects-too/32819 "2017-08-04T13:11:31Z")

</div>

Scrolling the background with large images 2048x1536px makes the scrolling twitch at first. When the background images has looped once, the background scroll is smooth and stays smooth. To see this better, set the spac…

---

## [I am stuck, I need help](https://forums.kodeco.com/t/i-am-stuck-i-need-help/24463)

<div class="topic-metadata">

**Author:** [@abd1kadir](https://forums.kodeco.com/u/abd1kadir)\
**Replies:** 5\
**Last updated:** [July 26, 2017, 10:22am UTC](https://forums.kodeco.com/t/i-am-stuck-i-need-help/24463 "2017-07-26T10:22:30Z")

</div>

I am making the zombie conga game in the book but I can’t move the zombie,. It keeps showing errors. The last three lines keeps showing errors in xcode, it is saying use of unresolved identifier ‘zombie’, and also overri…

---

## [Swift 4 - Cannot use mutating member on immutable value: '-' returns immutable value](https://forums.kodeco.com/t/swift-4-cannot-use-mutating-member-on-immutable-value-returns-immutable-value/31964)

<div class="topic-metadata">

**Author:** [@tlevans](https://forums.kodeco.com/u/tlevans)\
**Replies:** 1\
**Last updated:** [July 9, 2017, 11:31pm UTC](https://forums.kodeco.com/t/swift-4-cannot-use-mutating-member-on-immutable-value-returns-immutable-value/31964 "2017-07-09T23:31:03Z")

</div>

I know I am early but I like to repeat the training with the next Swift version as a learning experience. So far the changes have been minimal and easily implemented. I am stuck on how to resolve the following from Cha…

---

## [Chap 7: page 159: Cat Nap: Vertical Wooden Blocks Move](https://forums.kodeco.com/t/chap-7-page-159-cat-nap-vertical-wooden-blocks-move/30045)

<div class="topic-metadata">

**Author:** [@roblawson](https://forums.kodeco.com/u/roblawson)\
**Replies:** 2\
**Last updated:** [June 24, 2017, 4:25pm UTC](https://forums.kodeco.com/t/chap-7-page-159-cat-nap-vertical-wooden-blocks-move/30045 "2017-06-24T16:25:53Z")

</div>

In the game scene, two vertical wooden blocks are positioned. One of the wooden blocks, located at x = 1024, is positioned to be directly underneath the cat. However, when I run the simulator, this block does not stay a…

---

## [Pest Control: Create a bonus level](https://forums.kodeco.com/t/pest-control-create-a-bonus-level/30805)

<div class="topic-metadata">

**Author:** [@ryguy](https://forums.kodeco.com/u/ryguy)\
**Replies:** 1\
**Last updated:** [June 12, 2017, 4:14am UTC](https://forums.kodeco.com/t/pest-control-create-a-bonus-level/30805 "2017-06-12T04:14:10Z")

</div>

I was wondering if there was a way to create a doorway in gameScene.sks. If Arnie walked into the door way could it load another .sks file where he could walk around and explore that tileMap then go back to the door way…

---

## [CatNap - Cat is not curling](https://forums.kodeco.com/t/catnap-cat-is-not-curling/27674)

<div class="topic-metadata">

**Author:** [@leovinister](https://forums.kodeco.com/u/leovinister)\
**Replies:** 1\
**Last updated:** [June 9, 2017, 9:09pm UTC](https://forums.kodeco.com/t/catnap-cat-is-not-curling/27674 "2017-06-09T21:09:21Z")

</div>

I have tried to make it optional and retyped a few times. Every time the cat hits the bed an error appears. Before of that it works well. Thanks!

---

## [DropCharge - Making nodes flashing white](https://forums.kodeco.com/t/dropcharge-making-nodes-flashing-white/30739)

<div class="topic-metadata">

**Author:** [@jackiedog](https://forums.kodeco.com/u/jackiedog)\
**Replies:** 0\
**Last updated:** [June 9, 2017, 8:47pm UTC](https://forums.kodeco.com/t/dropcharge-making-nodes-flashing-white/30739 "2017-06-09T20:47:15Z")

</div>

So, I’ve finished this game and I’m trying to juice it up even further by watching the recommended video at the very end of the chapter (Ray Wenderlich - Adding Juice to your Games - YouTube). I’m trying to reproduce fl…

---

## [Chapter 5 Camera Fix Needed?](https://forums.kodeco.com/t/chapter-5-camera-fix-needed/30442)

<div class="topic-metadata">

**Author:** [@roach\_physics](https://forums.kodeco.com/u/roach_physics)\
**Replies:** 1\
**Last updated:** [June 9, 2017, 12:24am UTC](https://forums.kodeco.com/t/chapter-5-camera-fix-needed/30442 "2017-06-09T00:24:33Z")

</div>

I just got around to updating to swift 3 and one of the problems I immediately faced was that the camera doesn’t center vertically for iphones anymore. I checked chapter 5 when I thought that there had been a work around…

---

## [CatNap -- Chapter 11, Challenge 2 solution missing?](https://forums.kodeco.com/t/catnap-chapter-11-challenge-2-solution-missing/25952)

<div class="topic-metadata">

**Author:** [@orangephoenix](https://forums.kodeco.com/u/orangephoenix)\
**Replies:** 2\
**Last updated:** [June 8, 2017, 6:34am UTC](https://forums.kodeco.com/t/catnap-chapter-11-challenge-2-solution-missing/25952 "2017-06-08T06:34:14Z")

</div>

The included code for Chapter 11, Challenge 2 (changing fill-colors of the Hint arrow) doesn’t seem to make any changes to the appropriate file: HintNode.swift. I’ve gotten it to work with my own coding, but I’d like to…

[Previous page](https://forums.kodeco.com/c/books/2d-ios-tvos-games-by-tutorials/14.md?page=2)

[Next page](https://forums.kodeco.com/c/books/2d-ios-tvos-games-by-tutorials/14.md?page=4)
