-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Vanessamae23/main
Added UI and GameScene to render components based on User
- Loading branch information
Showing
23 changed files
with
487 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+30.8 KB
(120%)
...proj/project.xcworkspace/xcuserdata/macbookpro.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
21 changes: 21 additions & 0 deletions
21
TowerForge/TowerForge/Assets.xcassets/melee.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "melee-frame.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
TowerForge/TowerForge/Assets.xcassets/soldier.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "soldier-frame.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+319 KB
TowerForge/TowerForge/Assets.xcassets/soldier.imageset/soldier-frame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
57 changes: 57 additions & 0 deletions
57
TowerForge/TowerForge/Controllers/GameViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
// | ||
// GameViewController.swift | ||
// TowerForge | ||
// | ||
// Created by Vanessa Mae on 14/03/24. | ||
// | ||
|
||
import UIKit | ||
import SpriteKit | ||
import GameplayKit | ||
|
||
class GameViewController: UIViewController { | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
showGameLevelScene(level: 1) // TODO : Change hardcoded level value | ||
} | ||
|
||
override var supportedInterfaceOrientations: UIInterfaceOrientationMask { | ||
if UIDevice.current.userInterfaceIdiom == .phone { | ||
return .allButUpsideDown | ||
} else { | ||
return .all | ||
} | ||
} | ||
|
||
override var prefersStatusBarHidden: Bool { | ||
true | ||
} | ||
} | ||
|
||
extension GameViewController: SceneManagerDelegate { | ||
func showMenuScene() { | ||
let menuScene = MenuScene() | ||
menuScene.sceneManagerDelegate = self | ||
showScene(scene: menuScene) | ||
} | ||
func showLevelScene() { | ||
// TODO : to implement after Keith is done | ||
} | ||
func showGameLevelScene(level: Int) { | ||
if let gameScene = SKScene(fileNamed: "GameScene") as? GameScene { | ||
// Present the scene | ||
gameScene.sceneManagerDelegate = self | ||
showScene(scene: gameScene) | ||
} | ||
} | ||
func showScene(scene: SKScene) { | ||
if let view = self.view as? SKView { | ||
scene.scaleMode = .aspectFill | ||
view.presentScene(scene) | ||
view.ignoresSiblingOrder = true // to render nodes more efficiently | ||
view.showsFPS = true | ||
view.showsNodeCount = true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// TeamController.swift | ||
// TowerForge | ||
// | ||
// Created by Vanessa Mae on 20/03/24. | ||
// | ||
|
||
import Foundation | ||
|
||
protocol TeamController { | ||
func spawn(position: CGPoint) | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.