sprite-kit

SpriteKit RGBA444_COMPRESSED doubles the size on screen

非 Y 不嫁゛ 提交于 2019-12-10 13:27:17
问题 I am running a SpriteKit game on iPhone4, iOS7.1 When I select the regular RGBA888 texture atlas format it looks good, however, when I try to use RGBA444_COMPRESSED, all atlas textures are double the size as if the display is not retina. Any ideas? 来源: https://stackoverflow.com/questions/32467883/spritekit-rgba444-compressed-doubles-the-size-on-screen

Convert Spritekit Game to Android?

馋奶兔 提交于 2019-12-10 12:36:17
问题 Are there any new options for converting a spritekit game to android? It seems the only options are to recode everything in Java or to use Cocos2D, LibGDX, etc. 回答1: Unfortunately ... no :{ And the cross-platform SpriteBuilder with the Apportable service that let you convert a Swift Cocos project to Android is no longer available (they got bought out by Google I believe). SpriteBuilder is still available on GitHub but it's not active afaik and is abandoned. So... what to do? I would focus on

Update to Xcode 7.3 and get: unexpectedly found nil while unwrapping an Optional value [duplicate]

对着背影说爱祢 提交于 2019-12-10 12:33:28
问题 This question already has answers here : What does “Fatal error: Unexpectedly found nil while unwrapping an Optional value” mean? (11 answers) Closed 3 years ago . The following code works fine with Xcode 7.2.1. After I upgraded to 7.3 I get a crash with: "unexpectedly found nil while unwrapping an Optional value" var backgroundMusic: SKAudioNode! func playBackgroundMusic(name: String) { var delay = 0.0 if backgroundMusic != nil { backgroundMusic.removeFromParent() } else { delay = 0.1 }

Changing Project Name textures render wrong : Cant reverse

老子叫甜甜 提交于 2019-12-10 12:08:45
问题 I changed the name of the app as it appears on the device under its icon by first changing the project name as suggested here. Suddenly on the simulator: the textures were not rendering correctly or could could not be found ( a large x appeared where the Sprtite Halo should of been) They were significantly freezes during run time The textures that did render were allot smaller After panicking a bit I undid the change and everything was back to normal. I then changed the name by changing the

How to create more SKScene in addition to GameScene

不打扰是莪最后的温柔 提交于 2019-12-10 11:59:35
问题 I tried to create a new subclass of SKScene "MainScene" like the one apple created the GameScene. I want to create more scene in addition to my "GameScene" but its not working. Below is my subclass code. MainScene : import SpriteKit #if !os(iOS) import AppKit #endif class MainScene : SKScene { override func didMoveToView(view: SKView) { backgroundColor = UIColor.blueColor() } } MainSceneViewController : import UIKit import SpriteKit class MainViewController: UIViewController { override func

What is happening to my sprite when using init(rect:inTexture:)?

China☆狼群 提交于 2019-12-10 11:43:47
问题 I'm writing an isometric game using SpriteKit and swift, and I'm having trouble with sprites for my sheep. They have a basic AI that randomly moves them around, but when it draws I get two big black horizontal lines instead of a sheep. I'm using init(rect:inTexture:) to take the first sub-image of my sprite sheet. I'm only doing one sheep to test my code. Here's my code: // // Animal.swift // Anointed // // Created by Jacob Jackson on 4/26/15. // Copyright (c) 2015 ThinkMac Innovations. All

Game Center leaderboard shows one result

牧云@^-^@ 提交于 2019-12-10 11:36:09
问题 I've sent scores to the leaderboard with different test accounts but when I try to see the leaderboard I can only see the score from the account that I'm logged in. I used this code to send the scores : - (void)reportScore:(int64_t)score forLeaderboardID:(NSString*)identifier { GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: @"GHS"]; scoreReporter.value = score; scoreReporter.context = 0; [GKScore reportScores:@[scoreReporter] withCompletionHandler:^(NSError *error) {

Pause NSTimer on home-button-press and start them again once the app is in foreground

左心房为你撑大大i 提交于 2019-12-10 11:26:06
问题 I've been searching for a solution to pause my SpriteKit game when the user "tabs down" the game. So far I found a solution where you use SKAction 's instead of NSTimer 's, this works as long as the time between actions stays the same. However, my NSTimer 's changes in speed. So I need to find another solution. I have a bunch of NSTimer 's located in GameScene -> didMoveToView NSTimer.scheduledTimerWithTimeInterval(0.2, target: self, selector: Selector("SpawnBullets"), userInfo: nil, repeats:

AVAudioSession reactivation issue

Deadly 提交于 2019-12-10 10:52:44
问题 I am getting the following error: [0x19bf89310] AVAudioSession.mm:646: -[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session. I have read through this post: iOS8 AVAudioSession setActive error however the solution there did not solve my problem. which is: small application (game) audio background music handled in AudioHelper.swift additional 'blip' sounds played with