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

1
vote
1answer
22 views

atan2 : inversed result? (angle 180 is on the right side, angle 0 on the left side)

the result of the angle between my touch and the middle,bottom of the screen gives me 180 when the touch is on the right side of the screen, and 0 when it is on the left. I don't understand why... ...
1
vote
1answer
25 views

How to figure out a vector based on 2 points that add up to a certain value

I am writing a game in which I am representing a velocity with a vector. I have a starting point and a point that I want the object to move towards at a certain speed. (I need the resulting vector's x ...
0
votes
2answers
79 views

How to move dashes towards target?

Would you know how to create a dash line that moves towards the direction of the target, and if it collides with a wall, goes to the opposite angle? I have seen atan2 but I am not sure what it does, ...
0
votes
0answers
33 views

Switching bezierpath to follow SpriteKit swift

I am trying to make it so that a SKShapeNode follows a UIBezierPath. Then when the screen is tapped it switches to another UIBezierPath to follow. I have this functionality working except that when ...
1
vote
0answers
29 views

Making a card game [closed]

I'm making a card game, for mainly knowledge reasons. My tendency to learn so far has been to create and struggle through to have the knowledge at the end. However, I've never made a game before. My ...
3
votes
3answers
195 views

How to approach 360 degree snake without having it “slide”

There's a great question here that helps me a little bit in what I want to do, and it explains it quite well: How To Approach 360 Degree Snake Basically, I want to have a smooth 360-degrees Snake ...
0
votes
0answers
31 views

moving a character in sprite kit

So I've created a game in which a number of tiles are created from a txt file to create a level for the player to navigate through, but I'm having trouble moving the player. func ...
0
votes
1answer
88 views

Hexagonal buttons

I'm trying to create a map of touchable hexagons and the playing area would be like in Catan game. I would like to use Sprite Kit to do the job but is it cabable of doing that? Process goes like ...
0
votes
0answers
53 views

SpriteKit: Is applyImpulse not working correctly?

I am writing a free throwing system and because of this, I created a ball using following code. self.ball.position = CGPointMake(posX, posY) self.ball.fillColor = SKColor.blueColor() ...
0
votes
1answer
66 views

Developing game progress screen [duplicate]

I'm developing an application for iPhone with a screen where the user will track his progress. Something like so, as seen in the Two Dots game: Currently I plan on creating this using constraints ...
0
votes
1answer
70 views

How to randomize the ball direction?

I've started trying a few things with Sprite Kit for Game Development. I was creating a brick breaking game. So I've run into a issue on how to randomize the initial starting direction of the ball. I ...
0
votes
0answers
69 views

iOS8 + SpriteKit. Does a Node Moved Via Pan Gesture Have Velocity in the Physics Simulation?

I have some SKSpriteNodes arranged in a 2D grid. Each has a physics body including mass and charge. I attach a pan gesture to the SKView and a corresponding pan handler to the SKScene. When I pan I ...
0
votes
1answer
124 views

Can someone provide a practical example of decoupling game world updates from frame redraws in iOS?

Please bear with me as I've been spending some time lately trying to get a better grasp of some game dev fundamentals. My specific issue is a direct result of trying to apply what I've read about ...
0
votes
0answers
39 views

Using Tile Maps with cocos2d - how do I handle a large amount of images?

I am building a game where the users (players) can build their own town. There they can build houses, add furniture to the houses etc etc. Basically similar to The Sims. I am using the Tiled Map ...
0
votes
1answer
47 views

Showing keyboard on SKScene and performing action on a sprite node based on key tapped

I am trying to learn SpriteKit and play with some simple sample apps. Currently I am trying to achieve below things: Show keyboard over SKScene If user taps 'A', perform some action on a sprite ...
4
votes
2answers
781 views

How to implement color changing fragment shader?

I have a background of a given size and filled with a given color. I want to change it with an animation effect, starting from the center and spread out until it extends the whole background. The new ...
1
vote
1answer
93 views

Game Center Leaderboard not dismissing

I was implementing Game Center into my app and all was going well except for the leaderboard done button not dismissing the leaderboard even with gameCenterControllerDidFinish added in. I call up the ...
0
votes
0answers
83 views

sprite kit xcode CGPoint

Hi I am a newbie in this sprite kit xcode. So I am planning to place three cards on the view which I add them to the background. However I wanted to combine two of the cards and replace the first ...
2
votes
1answer
332 views

SpriteKit - How to jump to specific position?

I'm would like to achieve something like Object A will jump to position A in parabolic way. For example: I am able to make the object jump but i do not know how to calculate to make the object jump ...
1
vote
0answers
190 views

UI rich Strategy/RPG UI - 2D Game Engine or UI Toolkit? [closed]

I'm on the fence regarding the graphics engine of my current game and hope for some advice. This is an UI heavy strategy/rpg. Although the game is played on a (simple) 2D map, it is largely turn ...
0
votes
1answer
428 views

Swinging a sword in Xcode with Sprite Kit

I'm working on making an RPG in Xcode, and I'm having a major gameplay issue when it comes to having my character swing his sword in a way that is realistic and gameplay compatible. Right now, when ...
1
vote
1answer
222 views

How should I structure my code to add enemies?

So I am currently making a 1942-style game in Sprite Kit. I've reached the point where I am finished implementing pretty much everything (movement, shooting (also recognizing a hit and exploding an ...
1
vote
2answers
457 views

How to detect collision on specific part of the sprite node

I have a spike and a ball is falling down, when the ball touches the top point of the spike, I want to make the ball invisible, and when it touches on the other part i.e on the sides I don't want to ...
2
votes
1answer
813 views

iOS Sprite Kit - Blend Mode Effect

This question builds upon the following question: How can I achieve a good fire effect with alpha blending and particles? I want to achieve the visual effect of using SKBlendModeAdd on a black layer, ...
0
votes
0answers
105 views

SpriteKit - Make a sprite move similar t another sprite

I'm making a type of a platformer ( think super mario but in a top-down view style ) game and i want my main character to move with the platform it has contact with. So i used this: ...
0
votes
1answer
151 views

How do I procedurally generate level like in Dino Run, or Tiny Wings?

I'm looking to create a game like Dino Run, where I will need to create large slopes for a level, procedurally generated. How do I go about this? Do I have to make certain predefined pieces of level ...
6
votes
2answers
577 views

How can I make a character stand on slopes?

First of all, note that I want to understand the principle, so I would prefer explanations in plain english (but of course I have nothing against some code to complement these explanations). I am ...
0
votes
1answer
554 views

How to get the complete width of SKSpriteNode which has many child nodes

I have a Sprite node with many 6 child nodes. Each are placed one after another in X-axis. I want to know the complete with of the Sksprite node. SKSpriteNode *array = [SKSpriteNode node]; [array ...
4
votes
3answers
303 views

Approaches for a clickable map of nations (such as a Risk game) with Spritekit

I would like to create a political map where each country is clickable by tapping but I'm not sure the best way to determine which nation was selected. Imagine Risk where each country can be ...
2
votes
2answers
215 views

Sprite Kit - containsPoint for SKPhysicsBody?

I have a ball bouncing around the screen. I can pick it up and drag it onto a "bucket". When my touches finish, I use the containsPoint function to check and see if I have dropped the ball onto the ...
0
votes
0answers
14 views

SpriteKit Random Movement/Action [duplicate]

So basically i want a sprite to start from a random position and head to a random direction then take a random turn halfway through using CGPathAddCurveToPoint. The part i fail in is how to make it ...
0
votes
0answers
263 views

SpriteKit Random Action/Movement

So basically i want a sprite to start from a random position and head to a random direction then take a random turn halfway through using CGPathAddCurveToPoint. The part i fail in is how to make it ...
0
votes
0answers
127 views

create cgpathref(s) from image?

I have been searching for a way to to take my paths (in blue below) and get a CGPathRef from them, there would be 3/6 paths created per tile. I heard something about using an Alpha but I was unsure ...
0
votes
0answers
34 views

How to calculate positions and randoms in scene. SpriteKit [duplicate]

So here is a code : static inline CGFloat randomInRange(CGFloat low, CGFloat high) { CGFloat value = arc4random_uniform(UINT32_MAX) / (CGFloat)UINT32_MAX; return value * (high - low) +low; } ...
0
votes
1answer
154 views

Mobile: Physics and movement actions

I've been using spritekit for a while for a few small games. One thing I've noticed is that spritekit is the first game framework I've used that allows me to apply move actions to physics bodies. ...
2
votes
1answer
621 views

What units does Sprite Kit use for physics?

I'm developing a simple ball game in Sprite Kit. I need to predict the ball's trajectory, so I went back to my physics book for the equations for acceleration, time, speed and space. The problem is ...