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.
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?
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.
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. :]
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.
Great tutorial. Has someone an idea for realizing the invader movement sound like in the original game?
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.
1 Like
Good catch! I updated the tutorial so itās not confusing for others in the future.
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)
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! :]