-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameViewController2.swift
54 lines (43 loc) · 1.39 KB
/
GameViewController2.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// GameViewController.swift
// Blocky
//
// Created by ERYK NIEWIELSKI on 4/28/19.
// Copyright © 2019 Jan Niewielski. All rights reserved.
//
import UIKit
import SpriteKit
import GameplayKit
class GameViewController2: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
if let skView2 = self.view as! SKView? {
if let scene = GameScene2(fileNamed:"GameScene2") {
// Configure the view.
scene.scaleMode = .aspectFit
skView2.showsFPS = true
skView2.showsNodeCount = true
/* Sprite Kit applies additional optimizations to improve rendering performance */
skView2.ignoresSiblingOrder = true
skView2.presentScene(scene)
}
}
}
override var shouldAutorotate: Bool {
return true
}
override var supportedInterfaceOrientations: UIInterfaceOrientationMask {
if UIDevice.current.userInterfaceIdiom == .phone {
return .allButUpsideDown
} else {
return .all
}
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Release any cached data, images, etc that aren't in use.
}
override var prefersStatusBarHidden: Bool {
return true
}
}