Questions tagged [swift]
Swift is a multi-paradigm, compiled programming language.
63 questions
0
votes
1
answer
71
views
Grouping "touching" nodes of the same color together
I am trying to make a very simple game that allows the user to tap on any "block" in the scene and "pop" it. If the block is blue and touching another blue block then both blocks ...
0
votes
0
answers
71
views
INSANE Slowdown when implementing MSAA
I am trying to implement MSAA in my very simple raytracer. However, when I do, my program gets and insane slowdown. I am working in Metal, and on the Metal HUD, I can see that my frametimes drop from ...
0
votes
2
answers
438
views
How to check multiple rings of tiles around a center tile on a 2D grid
In my game project I create the terrain programmatically by creating tiles on a 2D grid as the player moves around the game map. I have it working where I select the current tile and check all 8 ...
1
vote
1
answer
623
views
How can I prevent the camera going out of bounds?
I've been working on a Mario Bros clone for the first level, trying to learn how to make games with SpriteKit.
I'm trying to use an ...
2
votes
1
answer
218
views
A ball hits the corner slightly, where will it deflect?
I am currently making an iOS Game but I have a small problem. The game is simply a ball which you can control to avoid obstacles and find the food. When the ball hits, e.g. the top or the bottom of an ...
0
votes
0
answers
67
views
Advice on how to organise the levels in a game
I'm thinking of building a 2D platformer game similar to Super Mario Bros, but I'm in the planning process and realised I don't really have a good way of storing information about each level – where ...
1
vote
1
answer
799
views
Swift get the true date
I have a game and want to reward the user for going on every day. I want to be able to get the true date somehow. I do not want the device date, because the user could just change it and get free ...
0
votes
1
answer
156
views
Implementing score relative to total game time
How would one create score dependent on total time in game? I would like the score to count by 1000+ each second the game is running for. Later I am going to add some coins which will give my total ...
2
votes
1
answer
66
views
UnrealEngine4 "backwards compatilibility": Can I view a site that uses Unreal Engine4 on a very old laptop and still see in high definition?
Backwards compatible?
The project:
I want to render a high definition model on my personal website such that it'll be rendered in the highest definition possible on any device, from a 20-year-old ...
2
votes
1
answer
897
views
calculating the trajectory of an object in SpriteKit when an impulse is applied to it
I want to make a trajectory line of little balls of where the object is going to go after an impulse, sort of like what is in Angry Birds. I did some research and it seems that the physics in ...
2
votes
1
answer
2k
views
Get the up vector of the camera in ARKit
I'm trying to get the four vectors that make up the boundaries of the frustum in ARKit, and the solution I came up with is as follows:
Find the field of view angles of the camera
Then find the ...
0
votes
1
answer
1k
views
Don't know what to do with XML file and Spritesheet (Swift 3)
I'm new to spritesheets and game development in general. I have two files:
1) a .png spritesheet with tons of sprites and
2) a companion XML file with coordinates, anchor points, image names, and ...
2
votes
1
answer
680
views
How do I apply touches to images, using Swift? [closed]
I need code this game for iOS, using Swift; but I don't know how to apply touches to images, using Swift. My attempts thus far have failed; touch!.view != image.
<...
1
vote
0
answers
419
views
Swift Spritekit: Create realistic driving sprite
How would I go by creating a realistic driving experience?
I'm using iOS Swift 3 with SpriteKit using the functions applyForce to accelerate when I click the gas button and when braking I add ...
3
votes
1
answer
1k
views
How can I create the water-like blur effect in Chameleon Run using SpriteKit and Unity?
As the character in Chameleon Run runs, a water-like blur effect is created. I would really appreciate some guidelines on how I could create this effect in SpriteKit and Unity. Please see the image ...
2
votes
0
answers
396
views
Swift gamedev options for linux [closed]
I recently tried out Swift. I found it to be awesome. But I'm unable to find any libraries for game development as I'm on Linux. Everything seems to be made for MacOS & iOS development.
There ...
1
vote
0
answers
733
views
Fatal error: unexpectedly found nil while unwrapping an Optional value [closed]
I am trying to run this code but I keep on getting this error:
fatal error: unexpectedly found nil while unwrapping an Optional value
I don't understand why I'm getting it. Any hint?
...
1
vote
1
answer
571
views
SpriteKit and Swift or Objective-C [closed]
As a newbie to iOS programming, I'm wondering which of these would be more conducive to the type of game I want to program. I've been tasked to program an iOS game for my company. They asked me to do ...
5
votes
1
answer
4k
views
How do I pixelate a scene with SceneKit and Metal, in Swift?
I managed to get pixelation working by using the OpenGLES2 rendering API, and a CIFilter. But it was way too slow, so I want to use the Metal API and just have a very simple filter that pixelates ...
0
votes
1
answer
1k
views
CPU and RAM usage in OpenGL too high in Swift
My game is set up so the the display controls the game loop, usual in Cocoa. The callback function calls run() which is this. The thing is, the thread running the ...
1
vote
0
answers
569
views
Failed to pass uniform in Metal shader modifier
I'm trying to write a simple shader able to pass the color to be used for drawing in the fragment shader, through a uniform. I load the shader modifier and pass the uniform:
...
2
votes
1
answer
2k
views
Is it possible to use Metal and SceneKit at the same time?
All the tutorials that I've found online speak about using Metal alone, without any other supporting library. But I don't understand if it's possible to create a SceneKit game and then use a Metal ...
1
vote
0
answers
261
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, ...
-1
votes
1
answer
418
views
SceneKit – White layer covering my tube
I have a simple tube node in my scene that isn't displaying properly.
When I rotate it to face the camera, more than half of it is covered by some invisible sheet. When I rotate the tube enough, it ...
-1
votes
1
answer
634
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 {
<...