I have an idea for a game that does not require any SpriteKit features, such as (physics, collision, or action). This is a simple strategy game, itโs kind of like (Plague Inc, or Democracy) of you guys familiar with these games, so I decided that I could make it easy for myself and just create it in the usual way with the luxury of using Storyboard viewControllers and an object instead to do all this in code. But there is one feature of SpriteKit that will be very important for my game (or any game, for that matter), which is not built in regular Xcode projects, which are the "Update" method, which you know to track ratings and other values, therefore I implemented something close to it and it works great:
override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. var finish = NSTimer.scheduledTimerWithTimeInterval(1, target: self, selector: "check", userInfo: nil, repeats: true) } func check() { if score == 10 { println("Win!") } }
This works fine, but I'm not sure if this is the best practice or how much such a method will affect application performance, especially if I have more than one method that works all the time.
ios swift sprite-kit
Abdou023
source share