Porous Boundary

I just set up a boundary for my game which seems to be working alright until it is really forced, as in I make my character run towards it for several seconds, and then my character will just go straight through. Any explanations for this and how I c...
more »

2017-04-14 15:04 (1) Answers

Mute and unmute Swift Spritekit

I have the following code written in my MainMenuScene.swift file to mute and unmute the background music var mute: Bool = false override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) { if nameOfTappedNode == "musicBu...
more »

2017-04-13 09:04 (2) Answers

SpriteKit retaining memory after I leave game

So I am developing an app that includes a SpriteKit game. What I noticed is that after I start and close the game the memory keeps increasing as shown on the graph below: I am presenting the game from a View Controller using a modal presentation. ...
more »

2017-04-11 19:04 (2) Answers

dismiss SKScene go back to UIKit Menu

Once my SpriteKit game has ended, I would like to go back to my UIKit MenuViewController. From what I've learned so far, using protocol/delegate is the best(?) option, but I haven't been able to get that to work. I know that the protocol would probab...
more »

2017-04-11 06:04 (1) Answers

Exponentially shrink an SKNode

In a game I'm developing with SpriteKit, I want certain objects to appear and shrink. I already know how to scale them down, and I'm achieving this using the following code: myNode.run(SKAction.scale(to: 0, duration: 3)) However, the shrinking hap...
more »

2017-04-10 20:04 (2) Answers

Fix for Xcode Tile Editor Bug?

I'm testing the title editor that comes with Xcode 8 (8.2.1). It seems that there's a major bug. I can create a tile map. But if I set the title size to 32 x 32 and then quit Xcode and reopen the same project, Xcode resets the size to 128 x 128....
more »

2017-04-10 06:04 (0) Answers

Using a timer vs update to run game SpriteKit

I am curious what to use for my game. A timer: let goodFPS = SKAction.wait(forDuration: 0.01666) let mainGameRunner = SKAction.run { //my code is here } let toRepeat = SKAction.repeatForever(SKAction.sequence([goodFPS,mainGameRunner])) inGameHighSc...
more »

2017-04-09 21:04 (3) Answers

Emitter changes its colour to default yellow

I am trying to create some explosion using the emitters. I am adding my custom texture which is red and also I set colour ramp to red. But the problem is that if in scene I add it, it changes its colour to the yellow. What causes this? This is how I...
more »

2017-04-09 15:04 (0) Answers

Spritekit - Tableview scrolling cut off

I’m currently developing a Menu screen in my sprite kit game to show all of the items and i’ve used a tableview to achieve this because it allows me to have a uilabel for the item description. my uitableview is subclassed as follows: UITableview...
more »

2017-04-09 07:04 (1) Answers

Crop SKTexture with SKLabel text

To create a button in SpriteKit, I created a rounded rectangle with a SKShapeNode and then placed a SKLabel on top of it. It looks like this: I want to have the background that is under the label change with whatever is under it. So inside the pic...
more »

2017-04-06 23:04 (1) Answers

Change an SKScene centerpoint

I am working with a simple 2d game and I am trying to switch from level 1 (scene one) to level 2 (scene two). For the sake of testing, both levels contain the same content. This is my code for transitioning: let transition = SKTransition.push(w...
more »

2017-04-04 23:04 (1) Answers

Converting Position of SKEmitterNode

I am trying to convert the SKEmitterNode position to the view, but I don't know how. I've tried using the code to convert SKSpriteNode from Apple, but it doesn't work. Here is my original code, which doesn't work: override func touchesMoved(touches:...
more »

2017-04-03 07:04 (0) Answers

How To Create a Pulse Effect On an SKSpriteNode?

Hi would like to learn how to create a visual pulse effect as in the video below. https://www.youtube.com/watch?v=uiHj-KZWjpU I followed the link posted in the video; however, I have not been able to achieve the same effect. I am having trouble doi...
more »

2017-03-29 04:03 (1) Answers

Why are swift functions so expensive?

Why are swift functions so expensive? I have been writing an app using SpriteKit. Every frame, I recalculate the position of the CameraNode in the update() function. Lets call this the //(cameraNodeCode). This current setup had little influence on t...
more »

2017-03-27 09:03 (2) Answers

Swift 3 Change Hue Of Sprite

In my game, i have a wizard sprite. I would like to be able to change the colour of this sprite programatically so put a faded color over the top to change the color. So when the player changes the character, the sprite color changes. Any ideas ...
more »

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

Swift 3 - Background loop not working properly

I am trying to make a Flappy Bird like game and have to make my background loop infinitely. I found some tutorials online but it is just not working for me and I can't figure out why. This is my code so far var Background = SKSpriteNode() var txtB...
more »

2017-03-24 16:03 (1) Answers

Detecting Key Presses in Xcode Playground

The Aim I am trying to find a way to detect key presses in an Xcode playground (MacOS). (Like the arrow keys). I am trying to achieve this with SpriteKit, if that is at all possible. What I have already tried I have already looked online and found...
more »

2017-03-23 07:03 (0) Answers

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