Sprite Kit is a 2D rendering engine from Apple for iOS and OS X games. It provides rendering and animation for sprites, basic sound playback support and physics simulation.

learn more… | top users | synonyms

0
votes
0answers
1 view

Should the Sprites in my Boids implementation be backed by model objects?

This question is about the proper way to architect an implementation of Craig Reynolds Boids algorithm. I have an Agent object like this: struct Agent: Equatable { let identifier = ...
0
votes
0answers
8 views

How can I make a realistic soccer ball that gets impulsed by finger touch in Swift?

So I got this ball ball = SKSpriteNode(imageNamed: "ball") ball.name = ballCategoryName ball.userInteractionEnabled = false ball.size = CGSizeMake(120, 120) ball.zPosition = 2 ...
0
votes
0answers
18 views

Size for Pixel art in economic simulator for iPhone [closed]

I'm trying to make a 2D economic simulator staged in medieval times. Basically you build a village and you have to manage it's economy. For now my target is the iPhone 6 in landscape mode, but since I'...
0
votes
0answers
34 views

Dynamically add Components to an Entity

In my game, I have an entity which is an empty robot, and some components which are parts for building that robot(arm, head, weapon, tool, etc) and each part consists of different types. What I want ...
0
votes
0answers
10 views

Issue moving only one child node

I am trying to make a game that has a ball which is a SKShapeNode that shoots projectiles (SKSpriteNode). The issue that I am having is that when I try to get the players to move, it moves all of the ...
0
votes
0answers
32 views

Draw straight line for aiming

If you played Angry Birds or any Pool game before you would be familiar with what I'm trying to do, basically what I want is: 1- Draw a line in touchesMoved so that the player can know in which ...
0
votes
0answers
8 views

make bigger touch space node using spritekit and objective c

I try to make simple game, but I have a problem, node is too small,for smaller iphone phones finger can't move it on ipad it can and on simulator too, so i know its not the code fault. Because I use ...
1
vote
0answers
38 views

How could I achieve an iOS high detailed level design for a platformer?

I'm seeing a lot of games that use a predefined and repeating set of tiles for their level (like FlappyBird or the Super Mario game series). I'm a graphics designer so I would like to create levels ...
0
votes
1answer
80 views

Isometric scene in SpriteKit

I tried play with spritekit in isometric grid. But i can't understand how to fix level. import SpriteKit import XCPlayground let view:SKView = SKView(frame: CGRectMake(0, 0, 1024, 768)) ...
0
votes
0answers
22 views

Fragment Shader Light Sim

In the game Clash Royale, when you have the ability to upgrade a card, the green part has a light sheen to it an this sheen animates from left to right. How can this be done with a shader? I'm quite ...
0
votes
1answer
43 views

What is an equivalent of Swift's UIScreen.mainScreen().bounds in Unity 2d?

Basically, I am from a Swift SpriteKit background where UIScreen.mainScreen().bounds is a CGRect which represents the screen and can be manipulated in various ways like getting the middle of the ...
3
votes
1answer
131 views

How to determine contact bodies when multiple bodies overlap and a third makes contact with both at the same time

I understand how the below DidBeginConact function works, but how do you detect which categories make contact when you have multiple colored bars (in the example code) or a friend category and enemy ...
0
votes
1answer
31 views

How can I increase the hit range of a node?

How can I set the radius or the hit range of a node initialized with a texture? Of course I can do that with increasing the size of it, but actually I want to do this without resizing the picture ...
1
vote
0answers
56 views

How do I simulate vehicle movement in a non-gravity environment (e.g., space)?

As a series of small experiments, I've began to tinker with game development, specifically using SpriteKit and Swift. I'm looking to simulate a body moving through a non-gravity environment, ...
0
votes
1answer
85 views

Unity equivalent to cocos2D (and Sprite Kit) Actions?

Does Unity have an equivalent to the Actions feature/functionality of cocos2D and Sprite Kit; if so, what is it? cocos2D Actions: http://python.cocos2d.org/doc/programming_guide/actions.html http://...
-1
votes
1answer
60 views

Fix buttons on screen

I've added buttons and SKCameraNode for my player. I got problem. When player moving left/right/jump all buttons dont follow for him. UPDATE class GameScene: SKScene, SKPhysicsContactDelegate { ...
0
votes
1answer
67 views

2D Soccer Goal Net

I want to make a 2D soccer game on iOS, I started with SpriteKit and got the ball physics working. Now, I could make the goal simple and static, but I'd love to make it make it elastic like a real ...
0
votes
1answer
61 views

How to reregister gamecontroller changedvalue handler upon game scene reload

I'm working on a tvOS game that uses the siri gamepad controller. Everything works fine the first time out. If the user loses the round I reload the same scene using presentScene. After reloading the ...
1
vote
0answers
109 views

What is Sprite Kit capable of? [closed]

I am messing around with Game Maker in my free time. I learned some Java at school but never really understood the object oriented principles. When I got to know Game Maker I was surprised that game ...
3
votes
1answer
126 views

Sprite orbiting on a point

I was wondering how to make a Sprite do an orbit on a determinated point in SpriteKit. I tried to set the anchorPoint of the Sprite orbiting with the center point but it doesn't work. Please can ...
0
votes
0answers
71 views

Endless sidescrolling skating spritekit game

I am developing an endless side scrolling game in spritekit. For parallax background scroll : - (void) update:(NSTimeInterval)currentTime { [self.children enumerateObjectsUsingBlock:^(SKNode * ...
0
votes
0answers
12 views

SpriteKit Obj-C – How to add a force on a node a certain distance according to screen size

I have an SKSpriteNode that I'm trying to throw up to a certain point on the screen. I've tried applying an impulse and/or force according to the screen size, but that has strange results. I've also ...
2
votes
1answer
115 views

Objective-C SpriteKit – How to make a circle of buttons

I have some code in a project already, but I'd like to change it up a bit. Currently, my code creates an empty node called _buttonLayer and then create some buttons to add to it. My buttons start from ...
3
votes
1answer
238 views

How to implement 'Fog of War' in SpriteKit or Cocos2D?

Take a look at the image below from the game Warcraft 2. There's a darkened area (like a fog) that represents the limits of the 'field of view' -- to the effect that you would not see any enemy ...
4
votes
2answers
163 views

How should I use Monte Carlo method to simulate some police cars that keep patroling in a tile based map?

I have a tile map (isometric) and I have some police cars that they patrol all the time on the map, there is some building and other cars in map too so they are considered as constraints in my ...
1
vote
1answer
335 views

spritekit sidescroller how to move hero through the level

I am trying to learn spritekit by working my way through developing a simple side scrolling game, but I cannot find a clear answer on how to move the hero through the level. The width of my ground ...
3
votes
1answer
110 views

How to calculate final force vector for the SKSpriteNode

I am creating space game which has an effect similar to black hole's gravitational effect. Wherever the spaceship is going, the black hole will attract it, summing up all the vectors together. I know ...
0
votes
0answers
183 views

What is the best set of formula to use pinch gesture to implement zoom in/out in SpriteKit?

SpriteKit coordinate system origin is at the middle of screen and the positive Y direction is upward, however gesture recognizers origin is at upper left of the screen while the Y axis increase by ...
2
votes
1answer
154 views

Collisions between sprites in SpriteKit

I'm making a game in XCode using SpriteKit. The game has a player and different types of projectiles that he has to avoid. When the player collides with the projectiles, the score changes and the ...
2
votes
1answer
306 views

Can I use physics in Isometric map based games?

I am trying to use physics in my game which is an isometric map based strategy game that the player deals with a city full of buildings, roads and people in it. I am writing the game with Swift and ...
0
votes
1answer
289 views

How should I set camera in Blender for example to render a sprite which can be used in an isometric map?

I am trying to render some 3D model in blender and use them as a texture sprite in a game which uses Apple’s SpriteKit. I have an isometric map with tiles size : 32 as width and 24 as height, Since I ...
8
votes
1answer
2k views

How do I create a simple RPG game server? [closed]

I'm working on a Sprite Kit game. I'd like to make it a true multiplayer game, by which I mean that each person joining the game has their own camera. I've seen tutorials on multiplayer games where ...
1
vote
1answer
41 views

Indicate key options in a keyboard-only game

I am creating a music-based app for one of the courses I teach at a high school, so it's not for sale in the app store, it's only for my students to use. I decided to make it keyboard only partially ...
0
votes
1answer
128 views

How to resize the child node fit inside SKSpriteNode when resizing?

I am creating a virtual gamepad for my game, It has one main SKSpriteNode with circle image and four child node(up, down, left, right) with image. When I am using default size for all it looks perfect ...
0
votes
2answers
142 views

Where should I save game object's attributes (hp, score) in Swift?

Scenario: I have a game with several game objects on screen. Each can have different score and hitpoints. When I use collision detection for cannonball vs. ship (example) I need to know which ship is ...
0
votes
1answer
73 views

Game Sprite Motion

I really like the effect that I see in this video of Mario Party 10 Jewel Drop (at 2:40). It occurs when the four green orbs join together. You'll see a four items with long trails move to the top ...
0
votes
1answer
259 views

Is it possible to detect contact with every frame change when using an animation in SpriteKit?

Is it possible to detect contact with every frame change when using an animation in SpriteKit? For example, if I have two nodes of a person walking, I want to detect contact with the ground each time ...
0
votes
1answer
104 views

How to choose a SKSpriteNode randomly?

I want to choose from 4 enemies using random and present it on scene. For that purpose I've made this: func enemyPicker() -> SKSpriteNode { var enemyArray = [mouse, robot, drone, block, bird] var ...
0
votes
1answer
763 views

How do you set multiple collision rules with Swift and SpriteKit?

So basically I've got 2 types of balls and 2 types of enemies. Green can delete red only, red can hit delete only. Here's what I have for the first collision test: func didBeginContact(contact: ...
1
vote
0answers
155 views

Orientation of SKNode in followPath Swift

I'm developing a game like price wheel where I need to touch the correct answer. For now I find replies where people says: Set yScale of SKNode to -1. Or Set xScale of SKSpriteNode to xScale ...
3
votes
1answer
91 views

An archery's arrow should be a node or particle?

I am using Sprite Kit to do game development. I would like like to design an archery with arrow. Should I use the arrow as one of the node? If so, it is a concern to have too many arrow on the screen, ...
2
votes
1answer
300 views

SpriteKit Game State Management

I've created a SpriteKit Mac OS X app and I am using a simple finite state machine to manage the game states. I've seen some solutions, especially for C++ games, where a GameState class and a ...
0
votes
1answer
383 views

Sprite Kit - keeping character level with the terrain 2d endless runner

I've been trying to figure this out exhaustively for the past few days and still haven't found an answer. I have an endless runner built using swift where the character is fixed and the terrain moves ...
0
votes
1answer
106 views

Trouble drawing repeating and scrolling screen elements from a 2d array for an endless runner in swift [closed]

I've been trying draw level segments for an iOS endless runner using 2d elements that repeat forever. I have a class that generates a random 2d array, then scene elements are drawn and animated to ...
0
votes
1answer
57 views

Easy SpriteKit question on creating a function

The following code is what I'm working on to animate characters in a SK scene class. I can run the code without building, no problem, but I can't build it and run it; I get one error message: Binary ...
3
votes
1answer
1k views

Spritekit water flowing [closed]

I'm wondering if there is a way in spritekit to implement water flowing through a path? like this water flow Right now I'm generating the path using UIBezierPath and PaintCode Any suggestion? ...
2
votes
2answers
245 views

How does a loop work in game engines? [duplicate]

Recently I started working on a game with the spritekit engine. My question is not about spritekit in specific though, but generally about game engines. When I write a loop and run it (eg while i &...
6
votes
2answers
849 views

Does SpriteKit follow the MVC pattern?

I am currently working on an iOS project called Old Frank that I have been trying to follow a MVC design pattern. The gist of it is. GameObjects(model) <- Scene(controller) -> Sprites "SpriteKit" ...
1
vote
1answer
193 views

CGVectorMake to move SKNode at a certain speed towards the middle of screen?

I am trying to launch my ball sprite towards the middle of the screen at the same speed every time I launch it. let vel: CGFloat = 1000 dx = size.width / 2 - ball.position.x dy = vel - size.height / ...