         logicEngine.setDelegate(self)
         gameState = logicEngine.state
 
+        
+        initObstacles()
+        initPlayers()
+        initGrid()
+        
+        physicsWorld.gravity = CGVector(dx: 0.0, dy: -4.0)
+        setupGestureRecognizers(view)
+    }
+    
+    private func initGrid() {
+        grid.position = CGPoint(x: 0, y: size.height/2)
+        addChild(grid)
+        renderIsoGrid()
+    }
+    
+    private func initObstacles() {
         let obstacleNodes = gameState.obstacles.map { createObstacle($0) }
         for node in obstacleNodes {
             obstacles[node.name!] = node
         }
-
+    }
+    
+    private func initPlayers() {
         myPlayer = createPlayer(gameState.myPlayer)
-        for i in 1...3 {
+        for i in 1...3 { // Replace when game state contains data of other players
             createPlayer(Player(playerNumber: i))
         }
-
-        physicsWorld.gravity = CGVector(dx: 0.0, dy: -4.0)
-        
-        grid.position = CGPoint(x: 0, y: size.height/2)
-        addChild(grid)
-        
-        setupGestureRecognizers(view)
-        renderIsoGrid()
     }
     
     private func renderIsoGrid() {

import SpriteKit

class GameScene: SKScene, LogicEngineDelegate {
    private let grid = SKSpriteNode()
    private let tileSize = (width: 32, height: 32)
    
    private let logicEngine = LogicEngine(playerNumber: 0)
    private var gameState: GameState!
    private var myPlayer: SKNode!
    private var obstacles = [String: SKNode]()

        
        for i in 0..<numRows {
            for j in 0..<numCols {
                let point = pointToIso(CGPoint(x: (j * tileSize.width / 2),
                                               y: (i * tileSize.height / 2)))
                placeTile(imageNamed: "iso_grid_tile", withPosition: point)
            }
        }
