File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change
1
+ import os
1
2
import SpriteKit
2
3
#if os(iOS)
3
4
import UIKit
@@ -62,7 +63,7 @@ class GameScene: SKScene {
62
63
63
64
class func newGameScene( boardSize: Int = 3 ) -> GameScene {
64
65
guard let scene = SKScene ( fileNamed: " GameScene " ) as? GameScene else {
65
- print ( " Failed to load GameScene.sks " )
66
+ os_log ( " Failed to load GameScene.sks " )
66
67
abort ( )
67
68
}
68
69
scene. boardSize = boardSize
@@ -207,15 +208,15 @@ class GameScene: SKScene {
207
208
}
208
209
209
210
if let winningPattern = winningPatterns. first ( where: { ( currentPlayer == . x ? xBoard : oBoard) & $0 == $0 } ) {
210
- print ( " Player \( currentPlayer. rawValue) wins! " )
211
+ os_log ( " Player \( self . currentPlayer. rawValue) wins! " )
211
212
gameState = . won // Update the game state to won
212
213
drawWinningLine ( for: winningPattern)
213
214
let delayAction = SKAction . wait ( forDuration: 5.0 )
214
215
run ( delayAction) {
215
216
self . resetBoard ( )
216
217
}
217
218
} else if checkDraw ( ) {
218
- print ( " It's a draw! " )
219
+ os_log ( " It's a draw! " )
219
220
gameState = . draw // Update the game state to draw
220
221
let delayAction = SKAction . wait ( forDuration: 5.0 )
221
222
run ( delayAction) {
You can’t perform that action at this time.
0 commit comments