This file contains hidden or 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
| import Foundation | |
| import SwiftUI | |
| public struct MyFonts { | |
| public static func registerFonts() { | |
| registerFont(bundle: Bundle.main , fontName: "YOUR-FONT-HERE", fontExtension: ".ttf") //change according to your ext. | |
| } | |
| fileprivate static func registerFont(bundle: Bundle, fontName: String, fontExtension: String) { |
This file contains hidden or 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
| class WPHealthState: GKState { | |
| weak var game: WPGame? | |
| var entity: WPEntity | |
| init(withGame: WPGame, entity: WPEntity) { | |
| self.game = withGame | |
| self.entity = entity | |
| super.init() | |
| } |
This file contains hidden or 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
| class WPHealthComponent: GKComponent { | |
| var healthStateMachine: GKStateMachine | |
| /* | |
| ....... | |
| */ | |
| init(/* .... */ ){ | |
| /* | |
| ...... | |
| */ | |
| let defend = WPDefendState(withGame: game, entity: char) |
This file contains hidden or 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
| class WPHealthComponent: GKComponent { | |
| var healthStateMachine: GKStateMachine | |
| var game: WPGame | |
| var char: WPEntity | |
| var maxHearts: Int | |
| var heartCounter: Int { | |
| //...... | |
| } | |
| init(withGame: WPGame, characterEnt: WPEntity, maxHearts: Int){ |