How to launch Sprite from above screen in Swift?

I'm programming a game for iOS in Xcode and I'm trying to launch a colorSprite from above the screen so it falls into view. However, I have also formed a border so that no sprites bounce outside view... let border = SKPhysicsBody(edgeLoopFrom: ...
more »

2017-05-15 21:05 (1) Answers

Swift effect, tilt D Pad controls

Working on an iOS game right now using swift, and am having trouble trying to get the effect i want. Basically, i have a Dpad for moving around, it's simply one sprite node that displays the image and then some transparent rectangles overtop to trig...
more »

2017-05-12 02:05 (0) Answers

Delete Nodes Spritekit when interact

I have a circle in the center of my view. Circles known as enemyBall come and collide with it. I want to detect these collisions and then remove the enemyBalls from the view. func generateEnemyBall(){ let enemyBall = SKSpriteNode() let rand...
more »

2017-05-11 20:05 (3) Answers

Pause Menu In SpriteKit - Swift 3

I have read some other questions asked about pause menus in swift but I cant seem to get it to work. I know that I have to use layers but I don't know what to do with the layers. So far I have let pauseLayer = SKNode() let gameLayer = SKNode() o...
more »

2017-05-10 21:05 (0) Answers

SpriteKit sktilemapnode vertical line glitch

I am making a 2d platformer and I decided to use multiple tilemapnodes as my backgrounds. Even with 1 tile map, I get these vertical or horizontal lines that appear and disappear when I'm moving the player around the screen. See image below: My ti...
more »

2017-05-10 02:05 (0) Answers

Use of an Audio Clip Causing Memory Leak

I have a sprite-kit game scene (SKScene) that uses audio clips from time to time. I don't want to create a new action (SKAction) every time I need to run a short audio clip since the sound could stutter. So I initialize an action variable with a fi...
more »

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

How to activate This Class to another

I have a question about using another class in my main GameplayScene. What I am trying to do is make the motions of the X-axis of the phone move the character left and right. Here is what I have in my MotionClass.swift import SpriteKit import CoreMo...
more »

2017-05-05 17:05 (1) Answers

Swift 3 Physicsbody Collisions doesn't work

This is my class for the Player My Player doesn't collide with the Gamefield they just go through each other. I dont want them to be on top of each other. I tried to google the solution but for me it seems that I did mostly all right. Please Help: ...
more »

2017-05-05 17:05 (1) Answers

SKAction Sequencing and Grouping Animations

I'm doing some death animations for a game, and wanted to ask for some help. I want my monster to disappear in a puff of smoke, but not before it animates a slash effect going across his body. I have 3 animations that I want to use: weaponSlash - a...
more »

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

Applying wind function to a ball

I have a simple game of throwing basketball to a basket, but I want to add a wind, which affects the ball. I have made a function: func setWind() { let multi = CGFloat(50) let rnd = CGFloat(arc4random_uniform(UInt32(10))) - 5 windLbl.t...
more »

2017-05-03 19:05 (0) Answers

Create a Login Page for SKSprite Game

I am in the process of creating a game (Swift) in xcode using a number of SKScene and Sprite objects. I want to create a Scene (settings scene) that captures the player's name, email, gender etc. How can I go about this? How can I capture input from ...
more »

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

In-game tutorial in sprite kit game using swift

I created a game and I want to teach the player how to play this game. So i'm planning to create a in-game tutorial where the gameplay will be paused and display some instructions to the players to teach them. I want this in-game tutorial to be run j...
more »

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

Switch between parents - SpriteKit

in my game I have two SKNodes called "Center" rotating. I have several objects as the child of Center(The SKNode). I did this so I could let these objects orbit around Center. Although at certain points I want to switch to other SKNodes - "Center2"....
more »

2017-04-27 22:04 (2) Answers

Sprite kit player and enemy collisions

i've been looking around trying to find out how to have my player and enemy collide. I have an attack button set up and need to have it so when the button is pressed the enemy in front of the player is removed from screen. How would i set up the coll...
more »

2017-04-25 18:04 (1) Answers

Node positioning issue in Swift 3

I'm just starting out looking into Swift 3 - never coded before so I'm completely new to it all. Been looking at a really basic Node tutorial and have the following code: class GameScene: SKScene { override func didMove(to view: SKView) { ...
more »

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