Skip to content

Instantly share code, notes, and snippets.

@gtsafas
Created July 25, 2019 21:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gtsafas/2862a4b55dd010b064b4038e1c7a05e9 to your computer and use it in GitHub Desktop.
Save gtsafas/2862a4b55dd010b064b4038e1c7a05e9 to your computer and use it in GitHub Desktop.
Swift
import SpriteKit
import GameplayKit
class GameScene: SKScene {
var char:SKSpriteNode?;
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
override init() {
super.init();
setup();
}
override init(size: CGSize) {
super.init(size: size);
setup()
}
func setup() {
self.char = SKSpriteNode(imageNamed: "zombie")
}
override func didMove(to view: SKView) {
view.scene?.addChild(self.char);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment