SpriteKit - SpriteNode never shows

I am attempting to learn SpriteKit. I want to add a rectangle/square to the scene in code; but the item never shows; All I want to do is add a white square to the screen, but find that it never adds. In a breakpoint, I notice that didMove() never ...
more »

2017-03-18 19:03 (2) Answers

Import external nodes in SpriteKit using Swift

I'm working on a Breakout type game. I created the paddle in a different scene (PaddleScene.sks) so I could reference it across multiple levels. Not sure if that's how it's done yet, still a newbie. I added the paddle inside GameScene.sks through SK...
more »

2017-03-18 15:03 (2) Answers

Multiple scenes in macOS Spritekit Game

I am working on a game for macOS using Spritekit. Want to use a second scene. How do I set up App Delegate and ViewController to accomplish that? I can make a transition to a second scene var secondScene = SecondScene(size: self.size) ...
more »

2017-03-15 00:03 (0) Answers

How to stop a SKCameraNode at the edge of a scene

I have a SpriteKit scene where i have a background (SKSpriteNode) that is 2x the size of the scene frame. I've added a camera that moves around as the user pans and pinches with their fingers. I have the pinch to zoom and panning implemented, howev...
more »

2017-03-10 00:03 (1) Answers

Arrow keys in SpriteKit

In Xcode does sprite-kit have any type of built in arrow key support? I am currently using the regular swift key codes and there is a delay when the key is held. This makes it hard for my game controls. this is how I am currently reading the arrow ...
more »

2017-03-09 22:03 (1) Answers

Swift: Using switch statement in touchesBegan

I want to clean up my touchesBegan(..) in SKScene. I wanted to make a case statement instead of my if .. else chain. However, I get errors when implementing, which suggests that I don't know how equality is done under the hood. Before code: overri...
more »

2017-03-03 18:03 (3) Answers

SpriteKit scene node scale clarification

I'm working on a 2D iOS game and taking a crack at using the Scene builder in xCode for the first time. So forgive me if this is rudimentary. I've added a SKColorNode to the scene and by default it creates a small square. So i resized that square ...
more »

2017-03-02 15:03 (1) Answers

System font not working in iOS Simulator

I've read most all of the questions and answers here on this topic and they all seem to apply to custom fonts, not system fonts. Im using Interface builder and have a SKLabelNode on a SpriteKit scene that i changed the font to 'Lithos Pro'. It disp...
more »

2017-03-01 14:03 (1) Answers

SpriteKit scene is blank on iOS 8

I'm creating a SceneKit game and ran into this issue today. The game works how it's supposed to in any iOS 9 and later version, but older versions are a big trouble. What basically game looks like on iOS 8 is just a blank SpriteKit scene (I set the b...
more »

2017-03-01 13:03 (1) Answers

watchOS 3 SpriteKit TilemapNode Error

I think that SpriteKit on watchOS doesn't support new Tile map Node element. I've done next steps (XCode 8.2.1, Swift 3): Created new SpriteKit game Added WatchOS game target Created TileSet with default tiles (provided by XCode) Placed Tilemap ...
more »

2017-02-28 22:02 (0) Answers

SpriteKit Nodes with Gravity False tilted in place

I'm building a menu Game Scene where I have a Logo and 4 buttons, all of those have a SKPhysicsBody with the rectangle size of the image. All of those I only set: logo.physicsBody = SKPhysicsBody(rectangleOf: logo.size) logo.physicsBody?.affectedByG...
more »

2017-02-27 05:02 (1) Answers

Every 3 hours make event happen in Spritekit

Like many other games, I want to have this feature where, for example, every 3 hours, an event happens in my game. This timer works in the background of the app. I'm working on Spritekit and all I want is every 3 hours for a boolean variable to turn ...
more »

2017-02-26 19:02 (0) Answers

AVAudioPlayer produces lag playing sound effect

I'm using the SKTAudio library given by Ray Wenderlich on his Github. Here's the code I've modified for playing a sound effect that I call everytime I play one: public func playSoundEffect(_ filename: String) { let url = Bundle.main.url(forResou...
more »

2017-02-25 22:02 (0) Answers

spritekit objects not detect each other

I'm making a small game, like flappy bird. I have no idea why objects not "see" ourselves. I'm adding a Wall, Ground, and a Ghost, and what is pretty strange, Ghost detect a Ground, and vice versa, but Wall is still invisible. Why? a ghost should s...
more »

2017-02-23 12:02 (1) Answers