SpriteKit

RSS for tag

Drawing shapes, particles, text, images, and video in two dimensions using SpriteKit.

SpriteKit Documentation

Posts under SpriteKit tag

101 Posts
Sort by:
Post marked as solved
1 Replies
217 Views
My project involves no camera passthrough and relies heavily on sprites, but I've been discouraged from using the aging (and possibly dying) SpriteKit or SceneKit as my rendering engine by Apple engineers (here) so I'm exploring other options. Is it possible to display 2D sprites fluidly using this framework in a non-AR context? Is it possible to create, say, a 2D platformer using just RealityKit?
Posted
by wmk.
Last updated
.
Post marked as solved
2 Replies
336 Views
I'm constructing a Swift Playground with UIKit that contains an SKScene. After creating the code I'm planning to use within an Xcode project, I tried to adapt it into my Playground. I encountered an issue while running the Playground - when a new SKSpriteNode is added to the Scene, the new and existing nodes jitter, freeze, and lag for a split-second, the FPS counter drops to around 49fps, then returns to smooth 60fps. No errors or warnings are spat, and the console is completely empty. The scene in the project didn't have this issue, and I can't recreate it on another project - even when I directly copy-paste the code from the Playground to the project. I've seen other posts with this question - and made a few myself elsewhere - and there's been no responses. I desperately need help for this as nothing I've tried is working and the deadline is in a few days! Thanks! The code that is in effect for this SKScene is below. class SimulatorController: UIViewController { override func loadView() { let view = SKView() let scene = GameScene(size: view.bounds.size) view.showsFPS = true view.showsNodeCount = true view.ignoresSiblingOrder = true scene.scaleMode = .resizeFill view.presentScene(scene) self.view = view } } class GameScene: SKScene { override func didMove(to view: SKView) { run(SKAction.repeatForever(SKAction.sequence([ SKAction.run(addNeutron), SKAction.wait(forDuration: 1) ]) )) } func random() -> CGFloat { return CGFloat(Float(arc4random()) / 0xFFFFFFFF) } func random(min: CGFloat, max: CGFloat) -> CGFloat { return random() * (max - min) + min } func addNeutron() { let neutron = SKSpriteNode(imageNamed: "neutron.heic") neutron.size = CGSize(width: 20, height: 20) neutron.physicsBody = SKPhysicsBody(rectangleOf: neutron.size) neutron.physicsBody?.isDynamic = true let actualX = random(min: 0, max: size.width) let actualY = random(min: 0, max: size.height) neutron.position = CGPoint(x: actualX, y: actualY) addChild(neutron) let actualDuration = random(min: CGFloat(2.0), max: CGFloat(4.0)) let actualX2 = random(min: 0, max: size.width) let actualY2 = random(min: 0, max: size.height) let actionMove = SKAction.move(to: CGPoint(x: actualX2, y: actualY2), duration: TimeInterval(actualDuration)) let actionMoveDone = SKAction.removeFromParent() neutron.run(SKAction.sequence([actionMove, actionMoveDone])) } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
431 Views
Hello! I'm using SpriteKit for my application, and when I add an SKSpriteNode into the scene it lags and the FPS drops from 60 to 45. To make sure this isn't a code issue, I tested this in an app instead of a playground and it worked fine. Will I get penalized for poor performance or is there a way to solve this issue?Thank you 🙂
Posted
by TheTrollz.
Last updated
.
Post marked as solved
1 Replies
196 Views
Hi, I am Sanjiv, a Highschool student who is trying to participate in wwdc student scholarship , and I have a doubt in swift I have two bool variables, one global and one local. Once the value of the global variable changes I want the value of the local variable also to change. I want this for navigation. I have a gameScene and once the level is completed it needs to go to the next navigation view. I have tried multiple methods but none worked. Any help will be appreciated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
263 Views
Hello, I am building game with SpriteKit. 2 or 3 days ago my code worked perfectly then some project files paths changed in my computer. So now my code is running on preview but it's not running on simulator. I got error message like this Thread 1: signal SIGABRT 2022-04-17 23:48:25.927505+0300 MultiplayerGame[58416:1308997] fopen failed for data file: errno = 2 (No such file or directory) 2022-04-17 23:48:25.927569+0300 MultiplayerGame[58416:1308997] Errors found! Invalidating cache... 2022-04-17 23:48:26.015933+0300 MultiplayerGame[58416:1309280] Execution of the command buffer was aborted due to an error during execution. The operation couldn’t be completed. (MTLCommandBufferErrorDomain error 9.) 2022-04-17 23:48:26.016392+0300 MultiplayerGame[58416:1309280] Execution of the command buffer was aborted due to an error during execution. The operation couldn’t be completed. (MTLCommandBufferErrorDomain error 9.) XPC_ERROR_CONNECTION_INTERRUPTED dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/mkg/Library/Developer/Xcode/DerivedData/MultiplayerGame-ghupaqvlksldiogzatxbetsvshfx/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMTLCapture.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/mkg/Library/Developer/Xcode/DerivedData/MultiplayerGame-ghupaqvlksldiogzatxbetsvshfx/Build/Products/Debug-iphonesimulator:/Users/mkg/Library/Developer/Xcode/DerivedData/MultiplayerGame-ghupaqvlksldiogzatxbetsvshfx/Build/Products/Debug-iphonesimulator/PackageFrameworks CoreSimulator 802.6 - Device: iPhone 12 Pro Max (50569CD6-26AA-45EF-BE07-3B5F9702915E) - Runtime: iOS 15.4 (19E240) - DeviceType: iPhone 12 Pro Max (lldb)
Posted
by mkg10.
Last updated
.
Post not yet marked as solved
1 Replies
197 Views
Hi, I just wanted to display a SpriteKit Scene in a SCNPlane. So I set the the SCNMaterial contents to my SKScene, but instead of getting the scene I'm getting a grey plane. This is my code by the way: var mainScene: SKScene {     let scene = Game()     scene.size = CGSize(width: 1024, height: 1024)     scene.scaleMode = .resizeFill     scene.backgroundColor = .purple     scene.view?.backgroundColor = .purple     scene.view?.allowsTransparency = false     return scene } func initMainScene() -> SceneView {     mainScene.view?.isPaused = false     let scene = SCNScene()     let mainSceneMaterial = SCNMaterial()     mainSceneMaterial.normal.contents = mainScene     mainSceneMaterial.isDoubleSided = true     let planeGeometry = SCNPlane(width: 1, height: 1)     planeGeometry.materials = [mainSceneMaterial]     let plane: SCNNode = SCNNode(geometry: planeGeometry)     let camera: SCNNode = SCNNode()     camera.name = "Camera"     camera.camera = SCNCamera()     camera.position = SCNVector3(x: 0.0, y: 0.0, z: 4.0)     let light: SCNNode = SCNNode()     light.light =  SCNLight()     light.light!.type = .omni     light.position = SCNVector3(x: 1.5, y: 1.5, z: 1.5)     scene.rootNode.addChildNode(camera)     scene.rootNode.addChildNode(light)     scene.rootNode.addChildNode(plane)     return SceneView(         scene: scene,         pointOfView: scene.rootNode.childNode(withName: "Camera", recursively: false),         options: []     ) } Here is the screenshot: Also, my SpriteKit scene has touchesBegan and touchesMoved functions implemented, will those events still work if I embed the scene in the SCNMaterial? Thanks very much 🙏
Posted
by ItsTheGuy.
Last updated
.
Post not yet marked as solved
2 Replies
196 Views
Would it be possible to work with thousands of physical bodies in SpriteKit?
Posted
by Alirezag.
Last updated
.
Post not yet marked as solved
3 Replies
360 Views
Working with a student who wants to build a game in SpriteKit as a Mac app, and I was wondering if there are any good tutorials out there for this? Secondary, is there a better way to do key controls for a macOS games in Swift? Using the KeyDown function with the key code has been more of an annoying process than I would like. Is there any way of simply doing if keyPressed == "D" {...}?
Posted Last updated
.
Post not yet marked as solved
0 Replies
117 Views
// // ContentView.swift // TestSprite1 // // Created by Alireza | Datance on 4/14/22. // import SwiftUI import SpriteKit class GameScene: SKScene {   override func didMove(to view: SKView) {     physicsBody = SKPhysicsBody(edgeLoopFrom: frame)   }   override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {      //with this we would only process single touch     // good question how to process multi touch      guard let touch = touches.first else { return }           let location = touch.location(in: self)     let box = SKSpriteNode(color: SKColor.red, size: CGSize(width: 50, height: 50))     box.position = location     box.physicsBody = SKPhysicsBody(rectangleOf: CGSize(width: 50, height: 50))     addChild(box)                 } } struct ContentView: View {   var scene: SKScene {     let scene = GameScene()     scene.size = CGSize(width: 300, height: 400)     scene.scaleMode = .fill     return scene      }       func initScene () {     // why doesn't it work     scene.removeAllActions()     scene.removeAllChildren()         }       var body: some View {     VStack {       Text("Hello, world!")         .padding()       Button("Reset") {         initScene()       }               SpriteView(scene: scene)         .frame(width: 300, height: 400)         .ignoresSafeArea()     }         } } struct ContentView_Previews: PreviewProvider {   static var previews: some View {     ContentView( )   } }
Posted
by Alirezag.
Last updated
.
Post not yet marked as solved
0 Replies
135 Views
I have a SpriteKit scene using UITouch to drag and drop. That works. I have also an SKCameranode and a pinchGesture so you can pinch to zoom in and out of the scene. That works too. Lastly, I set up a panGesture so that you can pan the scene when it is zoomed in. That also works, but it conflicts with the drag and drop. The drag and drop works when the scene first loads, but if you zoom in on the scene, you can no longer drag and drop because it just tries to pan, and even if you zoom back out to normal size, the drag and drop function remains messed up and will only partially move. I know there are instructions on how to allow simultaneous gestures or how to prefer one gesture over another, but only UIGestureRecognizer is mentioned in Apple's explanation of those. I didn't see anything about UITouch. Is there a way to make touches using UITouch and UIGestureRecognizers not conflict with each other?
Posted
by Spatula.
Last updated
.
Post not yet marked as solved
1 Replies
449 Views
I am using xcode 13.3 beta 3 to make a game in spritekit using swift. The game is working pretty good and i am very happy with it so far. There is a problem i am trying to figure out. The game is a block type game where you drag a block into the game area from a holding area and drop it in an open spot. When you first touch and hold the block or touch and move the block, a method moves the block a certain number of points above the touch area Y axis using SKAction.moveby. The block x axis matches the touch area. Then you move the block to an open are and drop it. If you do this very slow, there is no problem. But if you try to do it fast, you can see it do the SKAction.moveby first and complete, then the block quickly moves from where it finished the moveby animation to where you current touch position is it. This makes it feel very jerky and unnatural. Is there a way to make the block follow your fingers position AND animate using moveby at the same time? I feel that the problem is with the skaction.moveby because if you move your finger fast enough, you can be way above where the animation would normally finish and thats why you see the block jump to the touch. I wonder if there is a way to use the update() method to somehow change the blocks position without using moveby or move to. Thank you for any help you can provide me. I can also you show you my touchesBegin, moved and ended methods if that will help.
Posted Last updated
.
Post not yet marked as solved
4 Replies
638 Views
-[SKLabelNode _isEligibleForFocus]: unrecognized selector sent to instance 0x1164f040 ( 0 CoreFoundation 0x1a90ce68 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 786024 1 libobjc.A.dylib 0x23add390 objc_exception_throw + 56 2 CoreFoundation 0x1a9a04f8 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 1389816 3 UIKitCore 0x1e5b6394 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 11969428 4 CoreFoundation 0x1a860c14 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 80916 5 CoreFoundation 0x1a85efcc _CF_forwarding_prep_0 + 92 6 SpriteKit 0x3cb782f8 B5D8103E-85CD-33A3-BB6D-F318B027A10D + 287480 7 SpriteKit 0x3cbb224c B5D8103E-85CD-33A3-BB6D-F318B027A10D + 524876 8 SpriteKit 0x3cbb2128 B5D8103E-85CD-33A3-BB6D-F318B027A10D + 524584 9 SpriteKit 0x3cb781f8 B5D8103E-85CD-33A3-BB6D-F318B027A10D + 287224 10 SpriteKit 0x3cb96940 B5D8103E-85CD-33A3-BB6D-F318B027A10D + 411968 11 UIKitCore 0x1e15388c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7370892 12 UIKitCore 0x1e153b44 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7371588 13 UIKitCore 0x1e9474e8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 15709416 14 UIKitCore 0x1e15388c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7370892 15 UIKitCore 0x1e153b44 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7371588 16 UIKitCore 0x1e9474e8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 15709416 17 UIKitCore 0x1e15388c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7370892 18 UIKitCore 0x1e153b44 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7371588 19 UIKitCore 0x1e9474e8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 15709416 20 UIKitCore 0x1e15388c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7370892 21 UIKitCore 0x1e152684 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7366276 22 UIKitCore 0x1e151d74 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7363956 23 UIKitCore 0x1e154768 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7374696 24 UIKitCore 0x1e14a5a8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7333288 25 UIKitCore 0x1e121d30 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7167280 26 UIKitCore 0x1e121804 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7165956 27 UIKitCore 0x1e121744 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7165764 28 UIKitCore 0x1e122514 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7169300 29 UIKitCore 0x1e12263c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7169596 30 UIKitCore 0x1e12263c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7169596 31 UIKitCore 0x1e12263c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7169596 32 UIKitCore 0x1e12263c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7169596 33 UIKitCore 0x1e12236c C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7168876 34 UIKitCore 0x1e122c20 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7171104 35 UIKitCore 0x1e1669d4 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7449044 36 UIKitCore 0x1e1667cc C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7448524 37 UIKitCore 0x1e1666a8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7448232 38 UIKitCore 0x1e157ff8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7389176 39 UIKitCore 0x1e15bc28 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 7404584 40 UIKitCore 0x1dae83a4 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 639908 41 UIKitCore 0x1da52ac8 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 27336 42 UIKitCore 0x1da4f674 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 13940 43 UIKitCore 0x1da52d88 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 28040 44 UIKitCore 0x1da6a550 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 124240 45 CoreFoundation 0x1a85bf5c 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 61276 46 CoreFoundation 0x1a88570c 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 231180 47 CoreFoundation 0x1a8522cc 26D96C7E-9A5C-3F48-9DBA-7AC4B4E0F3FD + 21196 48 CoreFoundation 0x1a89a250 CFRunLoopRunSpecific + 572 49 GraphicsServices 0x3dee19a8 GSEventRunModal + 160 50 UIKitCore 0x1dbff4c4 C3A646A8-7F5C-3446-A1A5-D8692AB71AC3 + 1782980 51 UIKitCore 0x1db9a32c UIApplicationMain + 140 52 WatchKit 0x239bc8a0 WKExtensionMain + 776 53 dyld 0x051d91ec start + 472 )
Posted
by 32143.
Last updated
.
Post not yet marked as solved
1 Replies
232 Views
I’m currently working on a matching game and when the user touches the nodes (Fruit match cards) I want them to display different images when a user clicks the nodes (Fruit match cards). This is my current code:  import Foundation  import SpriteKit  class EasyScreen: SKScene {         override func didMove(to view: SKView) {          var background = SKSpriteNode(imageNamed: "Easy Screen Background")          let timerText = SKLabelNode(fontNamed: "Arial")      timerText.fontSize = 40     timerText.fontColor = SKColor.white      timerText.position = CGPoint(x: 20, y: 400)      timerText.zPosition = 1     var counter:Int = 120                timerText.run(SKAction.repeatForever(SKAction.sequence([SKAction.run {              counter-=1       timerText.text = " Time: (counter)"       print("(counter)")          if counter <= 0{            let newScene = TryAgainScreen(fileNamed: "Try Again Screen")       newScene?.scaleMode = .aspectFill       self.view?.presentScene(newScene)                }       },SKAction.wait(forDuration: 1)])))                 background.position = CGPoint(x: 0, y: 0)     background.size.width = self.size.width     background.size.height = self.size.height     background.anchorPoint = CGPoint(x: 0.5,y: 0.5)               let matchCardOne = SKSpriteNode(imageNamed: "Fruit Match Card")     let matchCardTwo = SKSpriteNode(imageNamed: "Fruit Match Card")     let matchCardThree = SKSpriteNode(imageNamed: "Fruit Match Card")     let matchCardFour = SKSpriteNode(imageNamed: "Fruit Match Card")                  matchCardOne.name = "FruitMatchCard1"     matchCardTwo.name = "FruitMatchCard2"     matchCardThree.name = "FruitMatchCard3"     matchCardFour.name = "FruitMatchCard4"          matchCardOne.size = CGSize(width: 150, height: 300)     matchCardTwo.size = CGSize(width: 150, height: 300)     matchCardThree.size = CGSize(width: 150, height: 300)     matchCardFour.size = CGSize(width: 150, height: 300)               matchCardOne.zPosition = 1     matchCardTwo.zPosition = 1     matchCardThree.zPosition = 1     matchCardFour.zPosition = 1               matchCardOne.anchorPoint = CGPoint(x: 0.5, y: 0.5)     matchCardTwo.anchorPoint = CGPoint(x: 0.5, y: 0.5)     matchCardThree.anchorPoint = CGPoint(x: 0.5, y: 0.5)     matchCardFour.anchorPoint = CGPoint(x: 0.5, y: 0.5)               matchCardOne.position = CGPoint(x: -125, y: 60)     matchCardTwo.position = CGPoint(x: -125, y: -260)     matchCardThree.position = CGPoint(x: 70, y: 60)     matchCardFour.position = CGPoint(x: 70 , y: -260)          addChild(background)     addChild(matchCardOne)     addChild(matchCardTwo)     addChild(matchCardThree)     addChild(matchCardFour)     addChild(timerText)        } override func touchesBegan(_ touches: Set, with event: UIEvent?) {         self.view?.isMultipleTouchEnabled = false      let touch = touches.first   let positionInScene = touch!.location(in: self)   let touchedCardOneNode = self.atPoint(positionInScene)      if let name = touchedCardOneNode.name {          if name == "FruitMatchCard1" {           let newTexture = SKTexture(imageNamed: "Apple")       FruitMatchCard1.init(texture: newTexture)          }      }      let touchTwo = touches.first     let positionInSceneTwo = touch!.location(in: self)     let touchedCardTwoNode = self.atPoint(positionInScene)           if let name = touchedCardTwoNode.name {               if name == "FruitMatchCard2" {                 FruitMatchCard2.init(imageNamed: "Banana")              }          }        let touchThree = touches.first       let positionInSceneThree = touch!.location(in: self)      let touchedCardThreeNode = self.atPoint(positionInScene)            if let name = touchedCardThreeNode.name {                if name == "FruitMatchCard3" {                            FruitMatchCard3.init(imageNamed: "Apple")                }            }        let touchFour = touches.first   let positionInSceneFour = touch!.location(in: self)   let touchedCardFourNode = self.atPoint(positionInScene)      if let name = touchedCardFourNode.name {         if name == "FruitMatchCard4" {                 FruitMatchCard4.init(imageNamed: "Banana")          }      }        } override func touchesEnded(_ touches: Set, with event: UIEvent?) {             } I’m trying to change the textures of the nodes in this part of the code. Inside the “if name == “FruitMatchCard” { } “ part of the code. However, when I launch the Xcode simulator the node’s textures aren't changing. Any advice on how I can do this? Thanks!
Posted Last updated
.
Post not yet marked as solved
0 Replies
315 Views
We noticed when using async await with SpriteKit run function. Self is retained until run action is completed which can cause memory leak.   Task {             try? await Task.sleep(nanoseconds: 2 * NSEC_PER_SEC)             await controller.startIntro()             print("intro done")         } If you deallocate controller, memory won't be released until await is not completed.  calling:  scene.removeAllActions() cause memory leak.  Here is project reproducing steps with possible workarounds:  https://github.com/maradic/SpriteKitConcurrencyBug Is this SpriteKit bug or am I doing something wrong?
Posted
by marinac.
Last updated
.
Post marked as solved
2 Replies
511 Views
Hey everyone,In one of my apps I've been working on where SKShapeNodes fall from the top to the bottom via gravity, if the player recieves a notification in iOS 9 (such as a text message), the game temporarily freezes for around 1 second and then resumes but the nodes have jumped ahead, as if the nodes are still falling but failing to display for that second. Has anyone else come across this? Is there a solution or is it just best to hold out hope for iOS 10? Unfortunately this issue makes the game near unplayable 😟Cheers
Posted Last updated
.
Post not yet marked as solved
0 Replies
251 Views
Im learning to use spritekit, first-project kind of newbie, and on various tutorials I've seen that there is a tab on the right column, on the bottom, with a menu that helps import visual assets quickly into a gamescene. Upon creating my first project I can't seem to find this tab nor a way to add it to my project; under the "Custom shader uniforms" my right-most column seems empty, unlike what I've seen on tutorials. Since this 'tab' doesn't seem to have a title I'm unsure of what I'm even looking for! This is how my new spritekit scene looks like: This is a screenshot from a tutorial where an asset importer kind of tab can be seen: Any help is very much appreciated!!!
Posted
by saraMkt.
Last updated
.
Post not yet marked as solved
2 Replies
249 Views
In my app using storyboard and spritekit developed in Xcode 12.5.1 uses segue connected button to bring up another storyboard which presents a scene and show a sprite. The segue sequence triggered by the use pressing the Play button and running the segue shows an upward transition and the scene with the sprite that when clicked animates that sprite. My problem is I was getting two events that are causing me issues. The first is that I was expecting a sidewards transition for the Show segue. and second that the scene only covers 2 thirds on the screen not all of it. Screenshots of. Xcode showing main storyboard and segue connections, simulator app Settings, app Game initial view and app Game with sprite animated. Anyone any hints for me for explanation of the first event and how to resolve the second which is spoiling my development time?
Posted Last updated
.