# Code problem in Xcode for game?

**URL:** <https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692>\
**Category:** 2D iOS & tvOS Games by Tutorials\
**Created:** [November 10, 2019, 4:35pm UTC](https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692 "2019-11-10T16:35:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![game\_gecko](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/game_gecko/32/81494_2.png) [@game\_gecko](https://forums.kodeco.com/u/game_gecko)\
**Post date:** [November 10, 2019, 4:35pm UTC](https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692/1 "2019-11-10T16:35:36Z")

</div>

I am up to chapter 9(intermediate physics), and I typed the wakeUp() function for the CatNode.swift file and when running the game, as soon as the cat fell on the ground, there was a fatal error alert! The animation didn’t play the game just froze!

I typed the code correctly, but I didn’t make the code block the same way as in the book. The book puts long code on the next line. I try to put keep it on one line.

This is an example of how the book has the code:

let catAwake = SKSpriteNode(fileNamed:  
“CatWakeUp”)!.childNode(withName: “cat\_awake”)!

I usually put code like that on one line. So I am not sure if it is a setting in Xcode or something else, but when I copy and paste the code from the resource file for the book, that game runs without any errors?

---

<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:** [January 11, 2020, 6:48pm UTC](https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692/2 "2020-01-11T18:48:11Z")

</div>

@game_gecko Do you still have issues with this?

---

<div class="post-metadata">

**Author:** ![game\_gecko](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/game_gecko/32/81494_2.png) [@game\_gecko](https://forums.kodeco.com/u/game_gecko)\
**Post date:** [January 25, 2020, 9:30pm UTC](https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692/3 "2020-01-25T21:30:30Z")

</div>

I haven’t noticed this problem again, but I think it may have been Xcode. I have updated it to the latest version and only get error like the previous problem when I have too much space.

---

<div class="post-metadata">

**Author:** ![system](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@system](https://forums.kodeco.com/u/system)\
**Post date:** [April 25, 2020, 8:35am UTC](https://forums.kodeco.com/t/code-problem-in-xcode-for-game/87692/4 "2020-04-25T08:35:38Z")

</div>

Closed on April 25, 2020, 8:35am UTC

This topic was automatically closed after 166 days. New replies are no longer allowed.
