Questions tagged [sprite-kit]

SpriteKit is a framework for making 2D games that comes built-in to iOS 7. It has sprite support, support for special effects like videos, filters, and masking, an integrated physics library, and a lot more.

Filter by
Sorted by
Tagged with
1
vote
1answer
67 views

SKAction on SKLabel with array of Strings

I have an SKLabel attached to a parent SKNode and an array of strings: ...
1
vote
2answers
101 views

Boolean array, NAND of [SKSpritenodes]

I'm using spritekit, using on touch to detect what the users has tapped, ie., no collisions, etc. I have an array of sprite nodes which in effect is a multi-state boolean switch for now the user ...
1
vote
0answers
40 views

Displaying sprites causing lag (2D platformer game)

I've made a 2D platformer game. The map is an array and I also have a separate array for entities such as spinning coins and moving enemies. This array is declared like this: ...
41
votes
0answers
807 views

Swiftly turning wheels – The May 2017 Community Challenge

This is my attempt at the May 2017 Community Challenge in Swift, with a chain consisting of rigid links. I took this as an opportunity to learn SpriteKit, Apple's framework for 2D games. At least ...
0
votes
1answer
3k views

Calling a method only once in an updateScore function in SpriteKit

This works fine, but obviously it's messy and I'm thinking there has to be a better way to do this. Having to constantly remember to flip the bool back is a pain, is there anything else I can do here? ...
1
vote
0answers
619 views

Spawning nodes with random time interval in SpriteKit

I want to spawn objects with random time interval (from 1 to 3 seconds). I've wrote this function: ...
2
votes
0answers
105 views

didSimulatePhysics to animate a ball, taking 45% of CPU

According to my time profiler this is taking 45% of my cpu usage: have tried to optimize, and someone on stack overflow -- recommended to post here. Time profiler says 99% of the time is spent on the ...
5
votes
1answer
410 views

Vertical-scrolling 2D platform game

I am working on a vertical-scrolling 2D platform game using GameplayKit, SpriteKit and I am writing it in Swift 2.0. Today I ...
3
votes
1answer
175 views

Creating a class which has a method running every frame

I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility. ...
5
votes
0answers
76 views

Moves box in direction of touch, and has wraparound when reaching edge of screen

Part of me thinks that it would be simpler to ditch Apple's move API and just updated position with a timer. I know that's what I did with a JS canvas snake game I built a while ago. But I'm also ...
5
votes
2answers
318 views

Sprite-Kit/Swift game

I was writing a game in Swift and Sprite Kit and it is very simple. It works perfectly other than the fact that it gets a bit laggy sometimes. I'd like to use this experience as both a learning tool, ...
4
votes
1answer
1k views

Animated Score Amounts for Game

This is a simple class for a label with a score that animates counting up or down. When someone in the game scores points, the numbers count up or down to the new total. Here is an example of what ...
11
votes
1answer
169 views

Bedazzling My Bejeweled Animations

I've spent a few days working on the animations for my Bejeweled clone and I am pretty happy with the results so I am posting the code for review. This is the most advanced animation code that I have ...
2
votes
1answer
4k views

Subclass SKSpriteNode

I decided to subclass SKSpriteNode for a game test in Swift today and soon realised that it was not as simple as my Objective-C background suggested. After a little ...
4
votes
1answer
1k views

Dirty but Efficient Texture Atlas in Spritekit

I have spent quite a bit of time trying to optimize the performance of my 2D mining game. After a lot of research, experimentation, and testing, I finally found something very interesting that ...
7
votes
1answer
338 views

Multithreading in a 2D Mining Game

I have implemented some basic multithreading in my 2D mining game that I asked about in a previous question. The first part is working out great (creating the initial object instances in the ...
10
votes
1answer
165 views

Chunk Loader for 2D Mining Game

I've spent a couple days on my latest project, and I believe that I have achieved a sufficient level of efficiency to post it here for review. The idea of the game is to mine out an "infinite" world ...
14
votes
0answers
323 views

Modularizing a Game Scene in Sprite Kit

I am trying to modularize the main SKScene of my strategy game. I am not sure that my approach is correct so I would love to get a review of the following code. ...
5
votes
1answer
1k views

Calculating delta in SpriteKit using Swift

I am attempting to learn swift by refactoring one of my old games and I need to rewrite my update method which calculates a delta time. This code works but is ugly. ...
6
votes
2answers
445 views

User Interface for Strategy Game

I've been working a strategy game for iOS for a little while, and each time I add functionality to the game model I'm finding myself building a lot of UI code to sync up with it. I believe that my ...