diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 4982277..3cfaa82 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -11,19 +11,26 @@ 110360D9244B101A008610AF /* GameScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110360D8244B101A008610AF /* GameScene.swift */; }; 110360DB244B101A008610AF /* GameViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110360DA244B101A008610AF /* GameViewController.swift */; }; 110360DE244B101A008610AF /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 110360DC244B101A008610AF /* Main.storyboard */; }; - 110360E0244B101B008610AF /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 110360DF244B101B008610AF /* Assets.xcassets */; }; + 110360E0244B101B008610AF /* GoldWarsAssets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 110360DF244B101B008610AF /* GoldWarsAssets.xcassets */; }; 110360E3244B101B008610AF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 110360E1244B101B008610AF /* LaunchScreen.storyboard */; }; 110360EE244B101B008610AF /* GoldWarsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 110360ED244B101B008610AF /* GoldWarsTests.swift */; }; 11036113244B3E30008610AF /* MenuScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11036112244B3E30008610AF /* MenuScene.swift */; }; 116060F7245C57D2004E5A36 /* EntityManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 116060F6245C57D2004E5A36 /* EntityManager.swift */; }; + 20F1990724A4FAC1004B7A30 /* new_round.wav in Resources */ = {isa = PBXBuildFile; fileRef = 20F1990424A4FAC1004B7A30 /* new_round.wav */; }; + 20F1990824A4FAC1004B7A30 /* use_boost.wav in Resources */ = {isa = PBXBuildFile; fileRef = 20F1990524A4FAC1004B7A30 /* use_boost.wav */; }; + 20F1990924A4FAC1004B7A30 /* attack_base.wav in Resources */ = {isa = PBXBuildFile; fileRef = 20F1990624A4FAC1004B7A30 /* attack_base.wav */; }; 3E67854024728368007B9DE4 /* CElements.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E67853F24728368007B9DE4 /* CElements.swift */; }; 3E6785422472CBEC007B9DE4 /* Way.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6785412472CBEC007B9DE4 /* Way.swift */; }; - 3E6785442472CC27007B9DE4 /* DefaultWayComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3E6785432472CC27007B9DE4 /* DefaultWayComponent.swift */; }; 3EAD889524801B6A0048A10A /* RoundTimer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EAD889424801B6A0048A10A /* RoundTimer.swift */; }; 3EBD242E245D9332003CECE7 /* Team.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3EBD242D245D9332003CECE7 /* Team.swift */; }; - 3F745DF0246F48FC00CE7375 /* PlayerMoveType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F745DEF246F48FC00CE7375 /* PlayerMoveType.swift */; }; + 3F37551824A5490B00F9E331 /* SnapshotModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F37551724A5490B00F9E331 /* SnapshotModel.swift */; }; + 3F37551A24A5497300F9E331 /* RoundDataModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F37551924A5497300F9E331 /* RoundDataModel.swift */; }; + 3F37551C24A5498C00F9E331 /* NotificationModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F37551B24A5498C00F9E331 /* NotificationModel.swift */; }; + 3F37551E24A54A1100F9E331 /* HeartbeatModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F37551D24A54A1100F9E331 /* HeartbeatModel.swift */; }; 3F79FFE02486F7CD003F79C3 /* Explosion.sks in Resources */ = {isa = PBXBuildFile; fileRef = 3F79FFDF2486F7CD003F79C3 /* Explosion.sks */; }; 3FE19DB5246C7A22004827AB /* RoundCalculatorService.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */; }; + 3FF5DA5D24A546B600ED668F /* ModalType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FF5DA5C24A546B600ED668F /* ModalType.swift */; }; + 8B9CA5F1249A3C2E00561704 /* SkillButtonNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B9CA5F0249A3C2E00561704 /* SkillButtonNode.swift */; }; 8BB6FF402472B8F000162BBD /* SingeClickButtonNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */; }; 9E0E459724796262009817A6 /* GameCenterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E0E459624796262009817A6 /* GameCenterManager.swift */; }; 9E11FF79245CD81100EED3BE /* Fire.sks in Resources */ = {isa = PBXBuildFile; fileRef = 9E11FF77245CD81100EED3BE /* Fire.sks */; }; @@ -32,20 +39,22 @@ 9E174C86245DD91500209FF0 /* ButtonComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E174C85245DD91500209FF0 /* ButtonComponent.swift */; }; 9E174C88245DF1FF00209FF0 /* BackgroundComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E174C87245DF1FF00209FF0 /* BackgroundComponent.swift */; }; 9E174C8A245E1A0A00209FF0 /* Background.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E174C89245E1A0A00209FF0 /* Background.swift */; }; + 9E61EAC4249BAC9100334DDE /* LoserFire.sks in Resources */ = {isa = PBXBuildFile; fileRef = 9E61EAC2249BAC9100334DDE /* LoserFire.sks */; }; + 9E61EAC7249BB61A00334DDE /* SpinningLogo3DNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E61EAC6249BB61A00334DDE /* SpinningLogo3DNode.swift */; }; 9E78ACB6245C9A5300526FF7 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9E78ACB5245C9A5300526FF7 /* GameKit.framework */; }; 9E78ACB8245CB75B00526FF7 /* TeamComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */; }; 9E78ACBA245CBDAF00526FF7 /* HUD.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9E78ACB9245CBDAF00526FF7 /* HUD.swift */; }; 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */; }; 9EA3ABEB245C6DFA006BC61D /* BaseNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */; }; 9EC239E1246878A900952F74 /* MultiplayerNetwork.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC239E0246878A900952F74 /* MultiplayerNetwork.swift */; }; - 9EC2FBA72476B1EC00ABF11F /* PlayerInfoComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC2FBA62476B1EC00ABF11F /* PlayerInfoComponent.swift */; }; 9EC7E48B2461FBF700396BCD /* SliderNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC7E48A2461FBF700396BCD /* SliderNode.swift */; }; 9EC86B9F245C88A300796EF3 /* Modal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC86B9E245C88A300796EF3 /* Modal.swift */; }; 9EEDE02D246FCD770096C735 /* SpinningLogoEntity.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */; }; - 9EEDE02F246FCD800096C735 /* SpinningLogoComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */; }; AB21D7D5246C748A00B09CBA /* MapFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB21D7D4246C748A00B09CBA /* MapFactory.swift */; }; + AB671B252494ECF0003FBE8D /* EloHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = AB671B242494ECF0003FBE8D /* EloHelper.swift */; }; ABA03DA0244BD54F00A66916 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA03D9F244BD54F00A66916 /* Base.swift */; }; ABC0C3732481509300387B8F /* MapUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABC0C3722481509300387B8F /* MapUtils.swift */; }; + AE0C8E2F249BCC2A00996360 /* RulesScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE0C8E2E249BCC2A00996360 /* RulesScene.swift */; }; C04783EE2468583F004961FB /* intro-music.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C04783ED2468583F004961FB /* intro-music.mp3 */; }; C04783F024685995004961FB /* SettingsScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04783EF24685995004961FB /* SettingsScene.swift */; }; C05BB9C4247D890C00411249 /* SliderComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C05BB9C3247D890C00411249 /* SliderComponent.swift */; }; @@ -72,7 +81,7 @@ 110360D8244B101A008610AF /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; }; 110360DA244B101A008610AF /* GameViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameViewController.swift; sourceTree = ""; }; 110360DD244B101A008610AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 110360DF244B101B008610AF /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 110360DF244B101B008610AF /* GoldWarsAssets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = GoldWarsAssets.xcassets; sourceTree = ""; }; 110360E2244B101B008610AF /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 110360E4244B101B008610AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 110360E9244B101B008610AF /* GoldWarsTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = GoldWarsTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -80,14 +89,21 @@ 110360EF244B101B008610AF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 11036112244B3E30008610AF /* MenuScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuScene.swift; sourceTree = ""; }; 116060F6245C57D2004E5A36 /* EntityManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EntityManager.swift; sourceTree = ""; }; + 20F1990424A4FAC1004B7A30 /* new_round.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = new_round.wav; sourceTree = ""; }; + 20F1990524A4FAC1004B7A30 /* use_boost.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = use_boost.wav; sourceTree = ""; }; + 20F1990624A4FAC1004B7A30 /* attack_base.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = attack_base.wav; sourceTree = ""; }; 3E67853F24728368007B9DE4 /* CElements.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CElements.swift; sourceTree = ""; }; 3E6785412472CBEC007B9DE4 /* Way.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Way.swift; sourceTree = ""; }; - 3E6785432472CC27007B9DE4 /* DefaultWayComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultWayComponent.swift; sourceTree = ""; }; 3EAD889424801B6A0048A10A /* RoundTimer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundTimer.swift; sourceTree = ""; }; 3EBD242D245D9332003CECE7 /* Team.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Team.swift; sourceTree = ""; }; - 3F745DEF246F48FC00CE7375 /* PlayerMoveType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerMoveType.swift; sourceTree = ""; }; + 3F37551724A5490B00F9E331 /* SnapshotModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SnapshotModel.swift; sourceTree = ""; }; + 3F37551924A5497300F9E331 /* RoundDataModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundDataModel.swift; sourceTree = ""; }; + 3F37551B24A5498C00F9E331 /* NotificationModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationModel.swift; sourceTree = ""; }; + 3F37551D24A54A1100F9E331 /* HeartbeatModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartbeatModel.swift; sourceTree = ""; }; 3F79FFDF2486F7CD003F79C3 /* Explosion.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Explosion.sks; sourceTree = ""; }; 3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoundCalculatorService.swift; sourceTree = ""; }; + 3FF5DA5C24A546B600ED668F /* ModalType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalType.swift; sourceTree = ""; }; + 8B9CA5F0249A3C2E00561704 /* SkillButtonNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SkillButtonNode.swift; sourceTree = ""; }; 8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingeClickButtonNode.swift; sourceTree = ""; }; 9E0E459624796262009817A6 /* GameCenterManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCenterManager.swift; sourceTree = ""; }; 9E11FF77245CD81100EED3BE /* Fire.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = Fire.sks; sourceTree = ""; }; @@ -96,21 +112,23 @@ 9E174C85245DD91500209FF0 /* ButtonComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonComponent.swift; sourceTree = ""; }; 9E174C87245DF1FF00209FF0 /* BackgroundComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundComponent.swift; sourceTree = ""; }; 9E174C89245E1A0A00209FF0 /* Background.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Background.swift; sourceTree = ""; }; + 9E61EAC2249BAC9100334DDE /* LoserFire.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = LoserFire.sks; sourceTree = ""; }; + 9E61EAC6249BB61A00334DDE /* SpinningLogo3DNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SpinningLogo3DNode.swift; sourceTree = ""; }; 9E78ACB5245C9A5300526FF7 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; }; 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TeamComponent.swift; sourceTree = ""; }; 9E78ACB9245CBDAF00526FF7 /* HUD.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HUD.swift; sourceTree = ""; }; 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultBaseComponent.swift; sourceTree = ""; wrapsLines = 1; }; 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BaseNode.swift; sourceTree = ""; }; 9EC239E0246878A900952F74 /* MultiplayerNetwork.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiplayerNetwork.swift; sourceTree = ""; }; - 9EC2FBA62476B1EC00ABF11F /* PlayerInfoComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerInfoComponent.swift; sourceTree = ""; }; 9EC7E48A2461FBF700396BCD /* SliderNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SliderNode.swift; sourceTree = ""; }; 9EC86B9E245C88A300796EF3 /* Modal.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Modal.swift; sourceTree = ""; }; 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GoldWars.entitlements; sourceTree = ""; }; 9EEDE02C246FCD770096C735 /* SpinningLogoEntity.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoEntity.swift; sourceTree = ""; }; - 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SpinningLogoComponent.swift; sourceTree = ""; }; AB21D7D4246C748A00B09CBA /* MapFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapFactory.swift; sourceTree = ""; }; + AB671B242494ECF0003FBE8D /* EloHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EloHelper.swift; sourceTree = ""; }; ABA03D9F244BD54F00A66916 /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = ""; }; ABC0C3722481509300387B8F /* MapUtils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapUtils.swift; sourceTree = ""; }; + AE0C8E2E249BCC2A00996360 /* RulesScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RulesScene.swift; sourceTree = ""; }; C04783ED2468583F004961FB /* intro-music.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "intro-music.mp3"; sourceTree = ""; }; C04783EF24685995004961FB /* SettingsScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsScene.swift; sourceTree = ""; }; C05BB9C3247D890C00411249 /* SliderComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderComponent.swift; sourceTree = ""; }; @@ -162,26 +180,19 @@ 110360D1244B101A008610AF /* GoldWars */ = { isa = PBXGroup; children = ( - C04783ED2468583F004961FB /* intro-music.mp3 */, - 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */, - 9E11FF74245CD79100EED3BE /* Partikels */, - 116060F5245C5709004E5A36 /* Entities */, - AB1D759E245DD2EA00671525 /* Map */, + 3F003F3924A5589E00B5ACEA /* Assets */, 116060F4245C56EA004E5A36 /* Components */, + 116060F5245C5709004E5A36 /* Entities */, 9EC86BA2245C89B200796EF3 /* Enums */, + AB1D759E245DD2EA00671525 /* Map */, + 3F37551624A548D900F9E331 /* Models */, 9EC86BA4245C8A1E00796EF3 /* Scenes */, + 3FF5DA5B24A5464E00ED668F /* Services */, 9EC86BA3245C89F400796EF3 /* Storyboards */, 110360D2244B101A008610AF /* AppDelegate.swift */, - C05FAED52468559D0006AF2E /* SoundManager.swift */, 110360DA244B101A008610AF /* GameViewController.swift */, - 110360DF244B101B008610AF /* Assets.xcassets */, - 9EC239E0246878A900952F74 /* MultiplayerNetwork.swift */, - C099579B246C5E5C0016AA22 /* DataService.swift */, 110360E4244B101B008610AF /* Info.plist */, - 3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */, - 9E0E459624796262009817A6 /* GameCenterManager.swift */, - C04783EF24685995004961FB /* SettingsScene.swift */, - 3EAD889424801B6A0048A10A /* RoundTimer.swift */, + 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */, ); path = GoldWars; sourceTree = ""; @@ -198,19 +209,12 @@ 116060F4245C56EA004E5A36 /* Components */ = { isa = PBXGroup; children = ( + 3F37551F24A54A8200F9E331 /* Nodes */, 9E174C87245DF1FF00209FF0 /* BackgroundComponent.swift */, - 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */, 9E174C85245DD91500209FF0 /* ButtonComponent.swift */, - 9E174C81245DD81D00209FF0 /* ButtonNode.swift */, 9EA3ABE8245C6DAA006BC61D /* DefaultBaseComponent.swift */, - 3E6785432472CC27007B9DE4 /* DefaultWayComponent.swift */, C064E9A9246C114C0022B228 /* LabelComponent.swift */, - C064E9A7246C0EA50022B228 /* LabelNode.swift */, - 9EC2FBA62476B1EC00ABF11F /* PlayerInfoComponent.swift */, - 8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */, C05BB9C3247D890C00411249 /* SliderComponent.swift */, - 9EC7E48A2461FBF700396BCD /* SliderNode.swift */, - 9EEDE02E246FCD800096C735 /* SpinningLogoComponent.swift */, 9E78ACB7245CB75B00526FF7 /* TeamComponent.swift */, ); path = Components; @@ -232,11 +236,72 @@ path = Entities; sourceTree = ""; }; + 3F003F3924A5589E00B5ACEA /* Assets */ = { + isa = PBXGroup; + children = ( + 3F003F3A24A5590100B5ACEA /* Music */, + 9E11FF74245CD79100EED3BE /* Partikels */, + 110360DF244B101B008610AF /* GoldWarsAssets.xcassets */, + ); + path = Assets; + sourceTree = ""; + }; + 3F003F3A24A5590100B5ACEA /* Music */ = { + isa = PBXGroup; + children = ( + C04783ED2468583F004961FB /* intro-music.mp3 */, + 20F1990624A4FAC1004B7A30 /* attack_base.wav */, + 20F1990424A4FAC1004B7A30 /* new_round.wav */, + 20F1990524A4FAC1004B7A30 /* use_boost.wav */, + ); + path = Music; + sourceTree = ""; + }; + 3F37551624A548D900F9E331 /* Models */ = { + isa = PBXGroup; + children = ( + 3F37551724A5490B00F9E331 /* SnapshotModel.swift */, + 3F37551924A5497300F9E331 /* RoundDataModel.swift */, + 3F37551B24A5498C00F9E331 /* NotificationModel.swift */, + 3F37551D24A54A1100F9E331 /* HeartbeatModel.swift */, + ); + path = Models; + sourceTree = ""; + }; + 3F37551F24A54A8200F9E331 /* Nodes */ = { + isa = PBXGroup; + children = ( + 9EA3ABEA245C6DFA006BC61D /* BaseNode.swift */, + 9E174C81245DD81D00209FF0 /* ButtonNode.swift */, + C064E9A7246C0EA50022B228 /* LabelNode.swift */, + 8BB6FF3F2472B8F000162BBD /* SingeClickButtonNode.swift */, + 8B9CA5F0249A3C2E00561704 /* SkillButtonNode.swift */, + 9EC7E48A2461FBF700396BCD /* SliderNode.swift */, + 9E61EAC6249BB61A00334DDE /* SpinningLogo3DNode.swift */, + ); + path = Nodes; + sourceTree = ""; + }; + 3FF5DA5B24A5464E00ED668F /* Services */ = { + isa = PBXGroup; + children = ( + 9E0E459624796262009817A6 /* GameCenterManager.swift */, + C05FAED52468559D0006AF2E /* SoundManager.swift */, + C099579B246C5E5C0016AA22 /* DataService.swift */, + AB671B242494ECF0003FBE8D /* EloHelper.swift */, + 9EC239E0246878A900952F74 /* MultiplayerNetwork.swift */, + 3FE19DB4246C7A22004827AB /* RoundCalculatorService.swift */, + 3EAD889424801B6A0048A10A /* RoundTimer.swift */, + ); + path = Services; + sourceTree = ""; + }; 9E11FF74245CD79100EED3BE /* Partikels */ = { isa = PBXGroup; children = ( 3F79FFDF2486F7CD003F79C3 /* Explosion.sks */, 9E11FF77245CD81100EED3BE /* Fire.sks */, + 9E61EAC2249BAC9100334DDE /* LoserFire.sks */, ); path = Partikels; sourceTree = ""; @@ -253,7 +318,7 @@ isa = PBXGroup; children = ( 3EBD242D245D9332003CECE7 /* Team.swift */, - 3F745DEF246F48FC00CE7375 /* PlayerMoveType.swift */, + 3FF5DA5C24A546B600ED668F /* ModalType.swift */, ); path = Enums; sourceTree = ""; @@ -272,6 +337,8 @@ children = ( 11036112244B3E30008610AF /* MenuScene.swift */, 110360D8244B101A008610AF /* GameScene.swift */, + C04783EF24685995004961FB /* SettingsScene.swift */, + AE0C8E2E249BCC2A00996360 /* RulesScene.swift */, ); path = Scenes; sourceTree = ""; @@ -368,9 +435,13 @@ buildActionMask = 2147483647; files = ( 110360DE244B101A008610AF /* Main.storyboard in Resources */, + 20F1990924A4FAC1004B7A30 /* attack_base.wav in Resources */, 9E11FF79245CD81100EED3BE /* Fire.sks in Resources */, - 110360E0244B101B008610AF /* Assets.xcassets in Resources */, + 20F1990724A4FAC1004B7A30 /* new_round.wav in Resources */, + 110360E0244B101B008610AF /* GoldWarsAssets.xcassets in Resources */, 110360E3244B101B008610AF /* LaunchScreen.storyboard in Resources */, + 9E61EAC4249BAC9100334DDE /* LoserFire.sks in Resources */, + 20F1990824A4FAC1004B7A30 /* use_boost.wav in Resources */, C04783EE2468583F004961FB /* intro-music.mp3 in Resources */, 3F79FFE02486F7CD003F79C3 /* Explosion.sks in Resources */, ); @@ -390,7 +461,9 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 3F37551A24A5497300F9E331 /* RoundDataModel.swift in Sources */, 9E78ACB8245CB75B00526FF7 /* TeamComponent.swift in Sources */, + 3FF5DA5D24A546B600ED668F /* ModalType.swift in Sources */, 9E0E459724796262009817A6 /* GameCenterManager.swift in Sources */, 3FE19DB5246C7A22004827AB /* RoundCalculatorService.swift in Sources */, 9EC239E1246878A900952F74 /* MultiplayerNetwork.swift in Sources */, @@ -403,31 +476,34 @@ 3EBD242E245D9332003CECE7 /* Team.swift in Sources */, 9E174C88245DF1FF00209FF0 /* BackgroundComponent.swift in Sources */, 9E78ACBA245CBDAF00526FF7 /* HUD.swift in Sources */, - 9EC2FBA72476B1EC00ABF11F /* PlayerInfoComponent.swift in Sources */, 9EEDE02D246FCD770096C735 /* SpinningLogoEntity.swift in Sources */, 9E174C86245DD91500209FF0 /* ButtonComponent.swift in Sources */, + AB671B252494ECF0003FBE8D /* EloHelper.swift in Sources */, 11036113244B3E30008610AF /* MenuScene.swift in Sources */, + 3F37551824A5490B00F9E331 /* SnapshotModel.swift in Sources */, C099579C246C5E5C0016AA22 /* DataService.swift in Sources */, + 3F37551E24A54A1100F9E331 /* HeartbeatModel.swift in Sources */, AB21D7D5246C748A00B09CBA /* MapFactory.swift in Sources */, 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */, 9E174C8A245E1A0A00209FF0 /* Background.swift in Sources */, 8BB6FF402472B8F000162BBD /* SingeClickButtonNode.swift in Sources */, C064E9A8246C0EA50022B228 /* LabelNode.swift in Sources */, - 3F745DF0246F48FC00CE7375 /* PlayerMoveType.swift in Sources */, + 8B9CA5F1249A3C2E00561704 /* SkillButtonNode.swift in Sources */, 3EAD889524801B6A0048A10A /* RoundTimer.swift in Sources */, + AE0C8E2F249BCC2A00996360 /* RulesScene.swift in Sources */, 3E67854024728368007B9DE4 /* CElements.swift in Sources */, ABA03DA0244BD54F00A66916 /* Base.swift in Sources */, C064E9AC246C151F0022B228 /* Label.swift in Sources */, ABC0C3732481509300387B8F /* MapUtils.swift in Sources */, 9E174C82245DD81D00209FF0 /* ButtonNode.swift in Sources */, 9EC7E48B2461FBF700396BCD /* SliderNode.swift in Sources */, - 9EEDE02F246FCD800096C735 /* SpinningLogoComponent.swift in Sources */, + 9E61EAC7249BB61A00334DDE /* SpinningLogo3DNode.swift in Sources */, 9E174C84245DD8CE00209FF0 /* Button.swift in Sources */, 110360DB244B101A008610AF /* GameViewController.swift in Sources */, - 3E6785442472CC27007B9DE4 /* DefaultWayComponent.swift in Sources */, C05BB9C4247D890C00411249 /* SliderComponent.swift in Sources */, 110360D3244B101A008610AF /* AppDelegate.swift in Sources */, 9EC86B9F245C88A300796EF3 /* Modal.swift in Sources */, + 3F37551C24A5498C00F9E331 /* NotificationModel.swift in Sources */, C05FAED62468559D0006AF2E /* SoundManager.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -591,14 +667,14 @@ CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = DDKFQG46BQ; INFOPLIST_FILE = GoldWars/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -614,14 +690,14 @@ CODE_SIGN_ENTITLEMENTS = GoldWars/GoldWars.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 4; + CURRENT_PROJECT_VERSION = 1; DEVELOPMENT_TEAM = DDKFQG46BQ; INFOPLIST_FILE = GoldWars/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 1.0; + MARKETING_VERSION = 1.2; PRODUCT_BUNDLE_IDENTIFIER = de.hft.stuttgart.ip2.goldwars; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; diff --git a/GoldWars/GoldWars/AppDelegate.swift b/GoldWars/GoldWars/AppDelegate.swift index 17e9b6c..4a72312 100644 --- a/GoldWars/GoldWars/AppDelegate.swift +++ b/GoldWars/GoldWars/AppDelegate.swift @@ -7,35 +7,45 @@ // import UIKit +import os @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? + let LOG = OSLog.init(subsystem: "AppDelegate", category: "AppDelegate") func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization after application launch. + os_log("application", log: LOG, type: .info) return true } func applicationWillResignActive(_ application: UIApplication) { // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + os_log("applicationWillResignActive", log: LOG, type: .debug) + } func applicationDidEnterBackground(_ application: UIApplication) { // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + os_log("applicationDidEnterBackground", log: LOG, type: .debug) + NotificationCenter.default.post(name: Notification.Name(rawValue: "pauseGame"), object: nil) + MultiplayerNetwork.sharedInstance.sendNotificationToPlayer(name: "pauseGame") } func applicationWillEnterForeground(_ application: UIApplication) { // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + os_log("applicationWillEnterForeground", log: LOG, type: .debug) } func applicationDidBecomeActive(_ application: UIApplication) { // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + os_log("applicationDidBecomeActive", log: LOG, type: .debug) + NotificationCenter.default.post(name: Notification.Name(rawValue: "resumeGame"), object: nil) + MultiplayerNetwork.sharedInstance.sendNotificationToPlayer(name: "resumeGame") } - - } diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/README.txt b/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/README.txt deleted file mode 100644 index 8177749..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/README.txt +++ /dev/null @@ -1,23 +0,0 @@ - -The different image sizes are used for: - -App Store: logo.png -iPad Pro - App Icon: logo_167.png -iPad, iPad Mini - App Icon: logo_152.png -iPad (all) - Spotlight: logo_80.png -iPad (all) - Settings: logo_58.png -iPad (all) - Notifications: logo_40.png - - -Color Codes: - -Coin: - Main: #ae841a - Edges: #daa520 (goldenrod) - -Background flow: - From: #a9003c - To: #2f0011 - - -The logo.svg file is a vectorized version of the coin without the background. \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo.svg b/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo.svg deleted file mode 100644 index e383582..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png deleted file mode 100644 index 1137158..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png deleted file mode 100644 index 0bc9d0f..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png deleted file mode 100644 index 064e40c..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-1.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-1.png deleted file mode 100644 index efa12ed..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-1.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-2.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-2.png deleted file mode 100644 index efa12ed..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base-2.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base.png deleted file mode 100644 index efa12ed..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Base.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-1.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-1.png new file mode 100644 index 0000000..b64e89c Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-1.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-2.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-2.png new file mode 100644 index 0000000..b64e89c Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture-2.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture.png b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture.png new file mode 100644 index 0000000..b64e89c Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/BaseTexture.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/yellow_boxCheckmark.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/yellow_boxCheckmark.png deleted file mode 100644 index 72fe388..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/yellow_boxCheckmark.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/yellow_boxCross.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/yellow_boxCross.png deleted file mode 100644 index be0df40..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/yellow_boxCross.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/Contents.json deleted file mode 100644 index baedfb5..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "yellow_checkmark.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/yellow_checkmark.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/yellow_checkmark.png deleted file mode 100644 index 95b43cc..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_checkmark.imageset/yellow_checkmark.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/yellow_circle.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/yellow_circle.png deleted file mode 100644 index 1459858..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/yellow_circle.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/yellow_cross.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/yellow_cross.png deleted file mode 100644 index cdd77e0..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/yellow_cross.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/yellow_panel.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/yellow_panel.png deleted file mode 100644 index a377f8c..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/yellow_panel.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/Contents.json deleted file mode 100644 index 3d22dba..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "yellow_sliderDown.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/yellow_sliderDown.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/yellow_sliderDown.png deleted file mode 100644 index 5b8f9d6..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderDown.imageset/yellow_sliderDown.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/Contents.json deleted file mode 100644 index 71fa343..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "yellow_sliderLeft.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/yellow_sliderLeft.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/yellow_sliderLeft.png deleted file mode 100644 index 9ec9498..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderLeft.imageset/yellow_sliderLeft.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/Contents.json deleted file mode 100644 index d65ee13..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "yellow_sliderRight.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/yellow_sliderRight.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/yellow_sliderRight.png deleted file mode 100644 index 452ae60..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderRight.imageset/yellow_sliderRight.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/Contents.json deleted file mode 100644 index 8ec95ef..0000000 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/Contents.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "yellow_sliderUp.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "scale" : "2x" - }, - { - "idiom" : "universal", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/yellow_sliderUp.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/yellow_sliderUp.png deleted file mode 100644 index 951d291..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_sliderUp.imageset/yellow_sliderUp.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/yellow_tick.png b/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/yellow_tick.png deleted file mode 100644 index 6589596..0000000 Binary files a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/yellow_tick.png and /dev/null differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json similarity index 73% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/Contents.json rename to GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json index 8860d58..7b1399e 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_tick.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "exitButton.png", "idiom" : "universal", - "filename" : "yellow_tick.png", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png new file mode 100644 index 0000000..7d180b7 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/exitButton.imageset/exitButton.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/Contents.json similarity index 73% rename from GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Contents.json rename to GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/Contents.json index a4fdd66..6b9729c 100644 --- a/GoldWars/GoldWars/Assets.xcassets/BaseTexture.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/Contents.json @@ -1,17 +1,15 @@ { "images" : [ { - "filename" : "Base.png", + "filename" : "finish_button 2.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Base-1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Base-2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png new file mode 100644 index 0000000..00c4273 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/finish_button.imageset/finish_button 2.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/gold_button_3.imageset/gold_button_4.png b/GoldWars/GoldWars/Assets.xcassets/gold_button_3.imageset/gold_button_4.png new file mode 100644 index 0000000..bce5294 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/gold_button_3.imageset/gold_button_4.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/Contents.json new file mode 100644 index 0000000..935a821 --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "gold_button_4.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/gold_button_4.png b/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/gold_button_4.png new file mode 100644 index 0000000..f225057 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/gold_button_4.imageset/gold_button_4.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json new file mode 100644 index 0000000..bdb389d --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "roundInfoTexture.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "roundInfoTexture-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "roundInfoTexture-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-1.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture-2.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png new file mode 100644 index 0000000..49b79a3 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/roundInfoTexture.imageset/roundInfoTexture.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/Contents.json similarity index 55% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/Contents.json index 609d5d4..50b16cd 100644 --- a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/Contents.json @@ -2,107 +2,107 @@ "images" : [ { "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" + "scale" : "2x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" + "scale" : "3x", + "size" : "20x20" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" + "scale" : "2x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" + "scale" : "3x", + "size" : "29x29" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" + "scale" : "2x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" + "scale" : "3x", + "size" : "40x40" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" + "scale" : "2x", + "size" : "60x60" }, { "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" + "scale" : "3x", + "size" : "60x60" }, { - "idiom" : "ipad", - "size" : "20x20", "filename" : "logo_20.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "20x20" }, { - "idiom" : "ipad", - "size" : "20x20", "filename" : "logo_40.png", - "scale" : "2x" + "idiom" : "ipad", + "scale" : "2x", + "size" : "20x20" }, { - "idiom" : "ipad", - "size" : "29x29", "filename" : "logo_29.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "29x29" }, { - "idiom" : "ipad", - "size" : "29x29", "filename" : "logo_58.png", - "scale" : "2x" + "idiom" : "ipad", + "scale" : "2x", + "size" : "29x29" }, { - "idiom" : "ipad", - "size" : "40x40", "filename" : "logo_40.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "40x40" }, { - "idiom" : "ipad", - "size" : "40x40", "filename" : "logo_80.png", - "scale" : "2x" + "idiom" : "ipad", + "scale" : "2x", + "size" : "40x40" }, { - "idiom" : "ipad", - "size" : "76x76", "filename" : "logo_76.png", - "scale" : "1x" + "idiom" : "ipad", + "scale" : "1x", + "size" : "76x76" }, { - "idiom" : "ipad", - "size" : "76x76", "filename" : "logo_152.png", - "scale" : "2x" - }, - { "idiom" : "ipad", - "size" : "83.5x83.5", - "filename" : "logo_167.png", - "scale" : "2x" + "scale" : "2x", + "size" : "76x76" + }, + { + "filename" : "logo_167.png", + "idiom" : "ipad", + "scale" : "2x", + "size" : "83.5x83.5" }, { - "idiom" : "ios-marketing", - "size" : "1024x1024", "filename" : "logo.png", - "scale" : "1x" + "idiom" : "ios-marketing", + "scale" : "1x", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } } diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_152.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_152.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_152.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_152.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_167.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_167.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_167.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_167.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_20.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_20.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_20.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_20.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_29.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_29.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_29.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_29.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_40.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_40.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_40.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_40.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_58.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_58.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_58.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_58.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_76.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_76.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_76.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_76.png diff --git a/GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_80.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_80.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/AppIcon.appiconset/logo_80.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/AppIcon.appiconset/logo_80.png diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-1.png new file mode 100644 index 0000000..ba69d8c Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-2.png new file mode 100644 index 0000000..ba69d8c Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture.png new file mode 100644 index 0000000..ba69d8c Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/BaseTexture.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/Contents.json similarity index 58% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/Contents.json index 987af42..b8c21ef 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCheckmark.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture.imageset/Contents.json @@ -1,21 +1,23 @@ { "images" : [ { + "filename" : "BaseTexture.png", "idiom" : "universal", - "filename" : "yellow_boxCheckmark.png", "scale" : "1x" }, { + "filename" : "BaseTexture-1.png", "idiom" : "universal", "scale" : "2x" }, { + "filename" : "BaseTexture-2.png", "idiom" : "universal", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2-1.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2-1.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2-1.png diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2-2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2-2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2-2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Base_2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Base_2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/BaseTexture_2.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/BaseTexture_2.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground-1.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground-1.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground-1.png diff --git a/GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground-2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground-2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground-2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/ModalBackground.imageset/ModalBackground.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/ModalBackground.imageset/ModalBackground.png diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/Contents.json new file mode 100644 index 0000000..f5dfbc3 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "goldLettering.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "goldLettering-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "goldLettering-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-1.png new file mode 100644 index 0000000..65d1c27 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-2.png new file mode 100644 index 0000000..65d1c27 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering.png new file mode 100644 index 0000000..65d1c27 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldLettering.imageset/goldLettering.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/Contents.json new file mode 100644 index 0000000..7ce2a7a --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "goldWarsName.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "goldWarsName-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "goldWarsName-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-1.png new file mode 100644 index 0000000..a1a563b Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-2.png new file mode 100644 index 0000000..a1a563b Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName.png new file mode 100644 index 0000000..a1a563b Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/goldWarsLettering.imageset/goldWarsName.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background-1.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background-1.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background-1.png diff --git a/GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background-2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background-2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background-2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/logo_no_background.imageset/logo_no_background.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/logo_no_background.imageset/logo_no_background.png diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/Contents.json new file mode 100644 index 0000000..76499f1 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "warsLettering.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "warsLettering-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "warsLettering-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-1.png new file mode 100644 index 0000000..7e82460 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-2.png new file mode 100644 index 0000000..7e82460 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering.png new file mode 100644 index 0000000..7e82460 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/warsLettering.imageset/warsLettering.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/Contents.json similarity index 69% rename from GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/Contents.json index 1029a8b..136177b 100644 --- a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/Contents.json @@ -1,17 +1,17 @@ { "images" : [ { - "filename" : "Backgorund.png", + "filename" : "winner.png", "idiom" : "universal", "scale" : "1x" }, { - "filename" : "Background@2x.png", + "filename" : "winner-1.png", "idiom" : "universal", "scale" : "2x" }, { - "filename" : "Background@3x.png", + "filename" : "winner-2.png", "idiom" : "universal", "scale" : "3x" } diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-1.png new file mode 100644 index 0000000..b993caf Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-2.png new file mode 100644 index 0000000..b993caf Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner.png new file mode 100644 index 0000000..b993caf Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/GW/winner.imageset/winner.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/Contents.json similarity index 73% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/Contents.json index 4520ecc..fc47f62 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_cross.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "atk_button.png", "idiom" : "universal", - "filename" : "yellow_cross.png", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/atk_button.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/atk_button.png new file mode 100644 index 0000000..7b685da Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/atk_button.imageset/atk_button.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/Contents.json similarity index 73% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/Contents.json index 904e5f4..f6ac2bb 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_panel.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "def_button.png", "idiom" : "universal", - "filename" : "yellow_panel.png", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/def_button.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/def_button.png new file mode 100644 index 0000000..b6fc30b Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/def_button.imageset/def_button.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/Contents.json new file mode 100644 index 0000000..9f41e34 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "spy_button.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/spy_button.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/spy_button.png new file mode 100644 index 0000000..975c77a Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/HUD/spy_button.imageset/spy_button.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Contents.json new file mode 100644 index 0000000..bdb8e88 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "Credits.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Credits.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Credits.png new file mode 100644 index 0000000..64c5fa9 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/Credits.imageset/Credits.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/Contents.json new file mode 100644 index 0000000..afaa7cd --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "RulesBasen.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/RulesBasen.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/RulesBasen.png new file mode 100644 index 0000000..d21ff99 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBasen.imageset/RulesBasen.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/Contents.json new file mode 100644 index 0000000..0f25890 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "RulesBoost.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/RulesBoost.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/RulesBoost.png new file mode 100644 index 0000000..b639e2e Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesBoost.imageset/RulesBoost.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/Contents.json similarity index 72% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/Contents.json index a595e6a..6043187 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxCross.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "RulesEinheiten.png", "idiom" : "universal", - "filename" : "yellow_boxCross.png", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/RulesEinheiten.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/RulesEinheiten.png new file mode 100644 index 0000000..b5fe893 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesEinheiten.imageset/RulesEinheiten.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/Contents.json similarity index 73% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/Contents.json index a6b8d3f..1c8c4fb 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_circle.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { + "filename" : "RulesErfolge.png", "idiom" : "universal", - "filename" : "yellow_circle.png", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/RulesErfolge.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/RulesErfolge.png new file mode 100644 index 0000000..dcdf897 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesErfolge.imageset/RulesErfolge.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/Contents.json new file mode 100644 index 0000000..e280c74 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "RulesSpiel.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/RulesSpiel.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/RulesSpiel.png new file mode 100644 index 0000000..1485e4a Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpiel.imageset/RulesSpiel.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/Contents.json new file mode 100644 index 0000000..9b2c235 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "RulesSpielende.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/RulesSpielende.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/RulesSpielende.png new file mode 100644 index 0000000..cf1bdad Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/Rules/RulesSpielende.imageset/RulesSpielende.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground-1.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground-1.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground-1.png diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground-2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground-2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground-2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/SkyBackground.imageset/SkyBackground.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/Contents.json diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/Contents.json new file mode 100644 index 0000000..7b1399e --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "exitButton.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/exitButton.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/exitButton.png new file mode 100644 index 0000000..90599f4 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/exitButton.imageset/exitButton.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/Contents.json new file mode 100644 index 0000000..6b9729c --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "finish_button 2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/finish_button 2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/finish_button 2.png new file mode 100644 index 0000000..095b179 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/finish_button.imageset/finish_button 2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/Contents.json new file mode 100644 index 0000000..c76b227 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "filename" : "gold_button00.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "gold_button00-1.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "gold_button00-2.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-1.png new file mode 100644 index 0000000..4ed798d Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-1.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-2.png new file mode 100644 index 0000000..4ed798d Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00-2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00.png new file mode 100644 index 0000000..4ed798d Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button.imageset/gold_button00.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/Contents.json new file mode 100644 index 0000000..2c00476 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "gold_button_2.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/gold_button_2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/gold_button_2.png new file mode 100644 index 0000000..14a4705 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_2.imageset/gold_button_2.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/Contents.json new file mode 100644 index 0000000..935a821 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "gold_button_4.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/gold_button_4.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/gold_button_4.png new file mode 100644 index 0000000..90c4251 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/gold_button_3.imageset/gold_button_4.png differ diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/Contents.json new file mode 100644 index 0000000..79eca12 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "questionmark.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/questionmark.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/questionmark.png new file mode 100644 index 0000000..a38dc5c Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/questionmark.imageset/questionmark.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/red_cross.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/red_cross.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/red_cross.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/red_cross.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/red_cross.imageset/red_cross.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/red_cross.imageset/red_cross.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/red_cross.imageset/red_cross.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/red_cross.imageset/red_cross.png diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/Contents.json new file mode 100644 index 0000000..9d20530 --- /dev/null +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "roundInfoTexture.png", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/roundInfoTexture.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/roundInfoTexture.png new file mode 100644 index 0000000..38536a9 Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfoTexture.imageset/roundInfoTexture.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture-1.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture-1.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture-1.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture-1.png diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture-2.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture-2.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture-2.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture-2.png diff --git a/GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/roundInfo_texture.imageset/roundInfo_texture.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/roundInfo_texture.imageset/roundInfo_texture.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/yellow_boxTick.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/yellow_boxTick.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/yellow_boxTick.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_boxTick.imageset/yellow_boxTick.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json similarity index 85% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json index 21140b0..130c74e 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { - "idiom" : "universal", "filename" : "yellow_button00.png", + "idiom" : "universal", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/yellow_button00.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/yellow_button00.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/yellow_button00.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button00.imageset/yellow_button00.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json similarity index 85% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json index 0895953..a14762e 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { - "idiom" : "universal", "filename" : "yellow_button01.png", + "idiom" : "universal", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/yellow_button01.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/yellow_button01.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/yellow_button01.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button01.imageset/yellow_button01.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json similarity index 85% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json index 457c9fb..62b81c2 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { - "idiom" : "universal", "filename" : "yellow_button02.png", + "idiom" : "universal", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/yellow_button02.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/yellow_button02.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/yellow_button02.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button02.imageset/yellow_button02.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json similarity index 85% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json index 6aa93af..9b97bc8 100644 --- a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json +++ b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/Contents.json @@ -1,8 +1,8 @@ { "images" : [ { - "idiom" : "universal", "filename" : "yellow_button03.png", + "idiom" : "universal", "scale" : "1x" }, { @@ -15,7 +15,7 @@ } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/yellow_button03.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/yellow_button03.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/yellow_button03.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button03.imageset/yellow_button03.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/yellow_button04.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/yellow_button04.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/yellow_button04.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button04.imageset/yellow_button04.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/yellow_button05.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/yellow_button05.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/yellow_button05.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button05.imageset/yellow_button05.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/yellow_button06.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/yellow_button06.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/yellow_button06.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button06.imageset/yellow_button06.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/yellow_button07.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/yellow_button07.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/yellow_button07.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button07.imageset/yellow_button07.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/yellow_button08.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/yellow_button08.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/yellow_button08.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button08.imageset/yellow_button08.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/yellow_button09.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/yellow_button09.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/yellow_button09.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button09.imageset/yellow_button09.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/yellow_button10.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/yellow_button10.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/yellow_button10.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button10.imageset/yellow_button10.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/yellow_button11.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/yellow_button11.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/yellow_button11.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button11.imageset/yellow_button11.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/yellow_button12.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/yellow_button12.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/yellow_button12.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button12.imageset/yellow_button12.png diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/yellow_button13.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/yellow_button13.png similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/yellow_button13.png rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/UITexture.spriteatlas/yellow_button13.imageset/yellow_button13.png diff --git a/GoldWars/GoldWars/Assets.xcassets/spark.imageset/Contents.json b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/spark.imageset/Contents.json similarity index 100% rename from GoldWars/GoldWars/Assets.xcassets/spark.imageset/Contents.json rename to GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/spark.imageset/Contents.json diff --git a/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/spark.imageset/spark.png b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/spark.imageset/spark.png new file mode 100644 index 0000000..acb709e Binary files /dev/null and b/GoldWars/GoldWars/Assets/GoldWarsAssets.xcassets/spark.imageset/spark.png differ diff --git a/GoldWars/GoldWars/Assets/Music/attack_base.wav b/GoldWars/GoldWars/Assets/Music/attack_base.wav new file mode 100644 index 0000000..55893c3 Binary files /dev/null and b/GoldWars/GoldWars/Assets/Music/attack_base.wav differ diff --git a/GoldWars/GoldWars/intro-music.mp3 b/GoldWars/GoldWars/Assets/Music/intro-music.mp3 similarity index 100% rename from GoldWars/GoldWars/intro-music.mp3 rename to GoldWars/GoldWars/Assets/Music/intro-music.mp3 diff --git a/GoldWars/GoldWars/Assets/Music/new_round.wav b/GoldWars/GoldWars/Assets/Music/new_round.wav new file mode 100644 index 0000000..dd149f3 Binary files /dev/null and b/GoldWars/GoldWars/Assets/Music/new_round.wav differ diff --git a/GoldWars/GoldWars/Assets/Music/use_boost.wav b/GoldWars/GoldWars/Assets/Music/use_boost.wav new file mode 100644 index 0000000..d65acaf Binary files /dev/null and b/GoldWars/GoldWars/Assets/Music/use_boost.wav differ diff --git a/GoldWars/GoldWars/Partikels/Explosion.sks b/GoldWars/GoldWars/Assets/Partikels/Explosion.sks similarity index 91% rename from GoldWars/GoldWars/Partikels/Explosion.sks rename to GoldWars/GoldWars/Assets/Partikels/Explosion.sks index 179dbe7..05170cb 100644 Binary files a/GoldWars/GoldWars/Partikels/Explosion.sks and b/GoldWars/GoldWars/Assets/Partikels/Explosion.sks differ diff --git a/GoldWars/GoldWars/Partikels/Fire.sks b/GoldWars/GoldWars/Assets/Partikels/Fire.sks similarity index 98% rename from GoldWars/GoldWars/Partikels/Fire.sks rename to GoldWars/GoldWars/Assets/Partikels/Fire.sks index 1f31d2e..6c1db2a 100644 Binary files a/GoldWars/GoldWars/Partikels/Fire.sks and b/GoldWars/GoldWars/Assets/Partikels/Fire.sks differ diff --git a/GoldWars/GoldWars/Assets/Partikels/LoserFire.sks b/GoldWars/GoldWars/Assets/Partikels/LoserFire.sks new file mode 100644 index 0000000..bd7ef75 Binary files /dev/null and b/GoldWars/GoldWars/Assets/Partikels/LoserFire.sks differ diff --git a/GoldWars/GoldWars/Components/AttackActionComponent.swift b/GoldWars/GoldWars/Components/AttackActionComponent.swift deleted file mode 100644 index ba46e1a..0000000 --- a/GoldWars/GoldWars/Components/AttackActionComponent.swift +++ /dev/null @@ -1,27 +0,0 @@ -// -// AttackActionComponent.swift -// GoldWars -// -// Created by Niko Jochim on 03.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import GameplayKit - -class AttackActionComponent: GKComponent { - - - init(unitCount: Int, adjacencyList: Array, position: CGPoint) { - super.init() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - - - func action() { - // Not implemented yet - } - -} diff --git a/GoldWars/GoldWars/Components/BackgroundComponent.swift b/GoldWars/GoldWars/Components/BackgroundComponent.swift index f74d5dd..2c52aae 100644 --- a/GoldWars/GoldWars/Components/BackgroundComponent.swift +++ b/GoldWars/GoldWars/Components/BackgroundComponent.swift @@ -9,11 +9,11 @@ import GameplayKit class BackgroundComponent: GKComponent{ - + var nodes = [SKSpriteNode]() let size: CGSize static var isMovingBackgroundEnabled = true - + init(size: CGSize) { self.size = size for i in 0...2 { @@ -25,9 +25,9 @@ class BackgroundComponent: GKComponent{ nodes.append(sky) } super.init() - } - - func update(){ + } + + func update() { if BackgroundComponent.isMovingBackgroundEnabled { for node in nodes{ node.position.x -= 2 @@ -37,9 +37,8 @@ class BackgroundComponent: GKComponent{ } } } - + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - } diff --git a/GoldWars/GoldWars/Components/BaseNode.swift b/GoldWars/GoldWars/Components/BaseNode.swift deleted file mode 100644 index 00da238..0000000 --- a/GoldWars/GoldWars/Components/BaseNode.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// BaseNode.swift -// GoldWars -// -// Created by Niko Jochim on 01.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import SpriteKit - -class BaseNode: SKSpriteNode{ - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - // TODO: PopUp Einheiten + Close PopUp - self.run( - SKAction.sequence( - [ - SKAction.resize(byWidth: 20, height: 20, duration: 0.5), - SKAction.resize(byWidth: -20, height: -20, duration: 0.5) - ] - ) - ) - } - - override func touchesMoved(_ touches: Set, with event: UIEvent?) { - // TODO: zeige Angirff Effect - } - - override func touchesEnded(_ touches: Set, with event: UIEvent?) { - // TODO: Open Slider PopUp - } - - -} diff --git a/GoldWars/GoldWars/Components/ButtonComponent.swift b/GoldWars/GoldWars/Components/ButtonComponent.swift index 0597f40..ecba6bd 100644 --- a/GoldWars/GoldWars/Components/ButtonComponent.swift +++ b/GoldWars/GoldWars/Components/ButtonComponent.swift @@ -9,10 +9,10 @@ import GameplayKit class ButtonComponent: GKComponent { - + var buttonNode: ButtonNode - - init(textureName: String, text: String, position: CGPoint, isEnabled:Bool, onButtonPress: @escaping () -> ()) { + + init(textureName: String, text: String, position: CGPoint, isEnabled:Bool, onButtonPress: @escaping () -> ()){ buttonNode = ButtonNode(textureName: textureName, text: text, isEnabled: isEnabled, diff --git a/GoldWars/GoldWars/Components/DefaultBaseComponent.swift b/GoldWars/GoldWars/Components/DefaultBaseComponent.swift index 9d7df44..3ed1874 100644 --- a/GoldWars/GoldWars/Components/DefaultBaseComponent.swift +++ b/GoldWars/GoldWars/Components/DefaultBaseComponent.swift @@ -11,21 +11,13 @@ import SpriteKit import GameKit class DefaultBaseComponent: GKComponent { + var spriteNode: BaseNode - var labelNode : SKLabelNode init(texture: SKTexture, position: CGPoint) { spriteNode = BaseNode(texture: texture, size: CGSize(width: 100, height: 100)) spriteNode.position = position spriteNode.zPosition = 2 - labelNode = SKLabelNode(text: "") - labelNode.fontColor = SKColor.black - labelNode.horizontalAlignmentMode = .left - labelNode.verticalAlignmentMode = .center - labelNode.fontName = "AvenirNext-Bold" - labelNode.fontSize = 15 - labelNode.position = CGPoint(x: position.x + 30 , y: position.y - 50 ) - labelNode.zPosition = spriteNode.zPosition - 1 super.init() } diff --git a/GoldWars/GoldWars/Components/DefaultWayComponent.swift b/GoldWars/GoldWars/Components/DefaultWayComponent.swift deleted file mode 100644 index 045ac04..0000000 --- a/GoldWars/GoldWars/Components/DefaultWayComponent.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// DefaultWayComponent.swift -// GoldWars -// -// Created by Jakob Haag on 18.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import Foundation -import GameplayKit -import SpriteKit - -class DefaultWayComponent: GKComponent { - var shapeNode: SKShapeNode - - init(pathToDraw: CGMutablePath) { - self.shapeNode = SKShapeNode() - shapeNode.path = pathToDraw - shapeNode.strokeColor = UIColor(red: 0.852, green: 0.649, blue: 0.123, alpha: 1) - shapeNode.lineWidth = 10 - shapeNode.zPosition = 0 - super.init() - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} diff --git a/GoldWars/GoldWars/Components/LabelComponent.swift b/GoldWars/GoldWars/Components/LabelComponent.swift index aa57816..96ba377 100644 --- a/GoldWars/GoldWars/Components/LabelComponent.swift +++ b/GoldWars/GoldWars/Components/LabelComponent.swift @@ -9,6 +9,7 @@ import GameplayKit class LabelComponent: GKComponent { + var labelNode: LabelNode init(fontnamed: String?, name: String, text: String, fontSize: CGFloat, fontColor: UIColor, position: CGPoint, horizontalAlignmentMode: SKLabelHorizontalAlignmentMode, vertikalAligmentMode: SKLabelVerticalAlignmentMode, isAnimationEnabled: Bool, isAnimationInfinite: Bool) { diff --git a/GoldWars/GoldWars/Components/Nodes/BaseNode.swift b/GoldWars/GoldWars/Components/Nodes/BaseNode.swift new file mode 100644 index 0000000..1744920 --- /dev/null +++ b/GoldWars/GoldWars/Components/Nodes/BaseNode.swift @@ -0,0 +1,23 @@ +// +// BaseNode.swift +// GoldWars +// +// Created by Niko Jochim on 01.05.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import SpriteKit + +class BaseNode: SKSpriteNode{ + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + self.run( + SKAction.sequence( + [ + SKAction.resize(byWidth: 20, height: 20, duration: 0.5), + SKAction.resize(byWidth: -20, height: -20, duration: 0.5) + ] + ) + ) + } +} diff --git a/GoldWars/GoldWars/Components/ButtonNode.swift b/GoldWars/GoldWars/Components/Nodes/ButtonNode.swift similarity index 56% rename from GoldWars/GoldWars/Components/ButtonNode.swift rename to GoldWars/GoldWars/Components/Nodes/ButtonNode.swift index b98164a..493ca58 100644 --- a/GoldWars/GoldWars/Components/ButtonNode.swift +++ b/GoldWars/GoldWars/Components/Nodes/ButtonNode.swift @@ -9,8 +9,8 @@ import SpriteKit class ButtonNode: SKSpriteNode { - - var isEnabled: Bool{ + + var isEnabled: Bool { didSet{ if isEnabled { self.alpha = 1 @@ -18,20 +18,18 @@ class ButtonNode: SKSpriteNode { } else { self.alpha = 0.3 self.childNode(withName: "label")?.alpha = 0.3 - } + } } } - + var label: SKLabelNode var onButtonPress: () -> () - + init(textureName: String, text: String, isEnabled: Bool, position: CGPoint, onButtonPress: @escaping () -> ()) { self.onButtonPress = onButtonPress self.isEnabled = isEnabled let texture = SKTexture(imageNamed: textureName) - super.init(texture: texture, color: SKColor.white, size: texture.size()) - self.position = position - - let label = SKLabelNode(fontNamed: "Courier-Bold") + + label = SKLabelNode(fontNamed: "Courier-Bold") label.fontSize = 30 label.fontColor = SKColor.black label.zPosition = 1 @@ -39,28 +37,34 @@ class ButtonNode: SKSpriteNode { label.text = text label.name = "label" + super.init(texture: texture, color: SKColor.white, size: texture.size()) + self.position = position + self.addChild(label) isUserInteractionEnabled = true - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - if isEnabled { - let action = SKAction.sequence( - [ - SKAction.scale(by: (3/4), duration: 0.3), - SKAction.scale(by: (4/3), duration: 0.3), - ] - ) - - self.childNode(withName: "label")?.run(action) - self.run(action) - onButtonPress() } - } - - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } - + + func setTexture(textureName: String) { + super.texture = SKTexture(imageNamed: textureName) + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + if isEnabled { + let action = SKAction.sequence( + [ + SKAction.scale(by: (3/4), duration: 0.3), + SKAction.scale(by: (4/3), duration: 0.3), + ] + ) + + self.childNode(withName: "label")?.run(action) + self.run(action) + onButtonPress() + } + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } + } diff --git a/GoldWars/GoldWars/Components/LabelNode.swift b/GoldWars/GoldWars/Components/Nodes/LabelNode.swift similarity index 99% rename from GoldWars/GoldWars/Components/LabelNode.swift rename to GoldWars/GoldWars/Components/Nodes/LabelNode.swift index 669a0b5..7f7c138 100644 --- a/GoldWars/GoldWars/Components/LabelNode.swift +++ b/GoldWars/GoldWars/Components/Nodes/LabelNode.swift @@ -9,6 +9,7 @@ import SpriteKit class LabelNode: SKNode { + let colt = SKLabelNode() var labels = [SKLabelNode]() var text = "" { diff --git a/GoldWars/GoldWars/Components/SingeClickButtonNode.swift b/GoldWars/GoldWars/Components/Nodes/SingeClickButtonNode.swift similarity index 98% rename from GoldWars/GoldWars/Components/SingeClickButtonNode.swift rename to GoldWars/GoldWars/Components/Nodes/SingeClickButtonNode.swift index 8b10a71..f48025c 100644 --- a/GoldWars/GoldWars/Components/SingeClickButtonNode.swift +++ b/GoldWars/GoldWars/Components/Nodes/SingeClickButtonNode.swift @@ -14,5 +14,4 @@ class SingeClickButtonNode: ButtonNode { super.touchesBegan(touches, with: event) self.isEnabled = false } - } diff --git a/GoldWars/GoldWars/Components/Nodes/SkillButtonNode.swift b/GoldWars/GoldWars/Components/Nodes/SkillButtonNode.swift new file mode 100644 index 0000000..05ada6d --- /dev/null +++ b/GoldWars/GoldWars/Components/Nodes/SkillButtonNode.swift @@ -0,0 +1,55 @@ +// +// SkillButtonNode.swift +// GoldWars +// +// Created by Simon Kellner on 17.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import SpriteKit + +class SkillButtonNode: ButtonNode { + + var cooldownCounter = 0 + var hasCooled: Bool = false + let cooldown: Int + let displayText: String + + init(textureName: String, text: String, isEnabled: Bool, cooldown: Int, position: CGPoint, onButtonPress: @escaping () -> ()) { + self.cooldown = cooldown + self.displayText = text + super.init(textureName: textureName, text: text, isEnabled: isEnabled, position: position, onButtonPress: onButtonPress) + self.size = CGSize(width: 100, height: 100) + self.label.fontSize = 25 + } + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + super.isEnabled = false + self.cooldownCounter = self.cooldown + self.hasCooled = true + } + + func decreaseCooldown() { + if self.cooldownCounter <= 1 { + super.isEnabled = true + super.label.text = self.displayText + let newRoundAction = SKAction.sequence([ + SKAction.scale(by: 1.5, duration: 1), + SKAction.scale(by: 1/1.5, duration: 1), + ]) + if hasCooled { + self.run(newRoundAction) + self.hasCooled = false + } + } else { + super.isEnabled = false + self.cooldownCounter -= 1 + super.label.text = self.cooldownCounter.description + } + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} diff --git a/GoldWars/GoldWars/Components/Nodes/SliderNode.swift b/GoldWars/GoldWars/Components/Nodes/SliderNode.swift new file mode 100644 index 0000000..4fe6bf2 --- /dev/null +++ b/GoldWars/GoldWars/Components/Nodes/SliderNode.swift @@ -0,0 +1,77 @@ +// +// SliderNode.swift +// GoldWars +// +// Created by Niko Jochim on 05.05.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import SpriteKit + +class SliderNode: SKNode { + + var sliderLine: SKShapeNode + var hiddenKnob: SliderKnob + var silderKnob: SKSpriteNode + var width: CGFloat + + var getValue: CGFloat{ + get{ + silderKnob.position = hiddenKnob.position + return ((hiddenKnob.position.x.rounded() - hiddenKnob.min) / width) + } + } + + init(width: CGFloat, position: CGPoint) { + self.width = width + sliderLine = SKShapeNode(rectOf: CGSize(width: width, height: 8)) + sliderLine.position = position + sliderLine.fillColor = SKColor.white + sliderLine.zPosition = 4 + + hiddenKnob = SliderKnob(circleOfRadius: 58) + hiddenKnob.min = position.x - width / 2 + hiddenKnob.max = position.x + width / 2 + hiddenKnob.fillColor = SKColor.red + hiddenKnob.alpha = 0.001 + hiddenKnob.zPosition = sliderLine.zPosition + 1 + hiddenKnob.position = CGPoint(x: sliderLine.position.x, y: sliderLine.position.y + 1) + + silderKnob = SKSpriteNode(texture: SKTexture(imageNamed: "yellow_boxTick")) + silderKnob.position = hiddenKnob.position + silderKnob.zPosition = hiddenKnob.zPosition - 1 + silderKnob.size = CGSize(width: 50, height: 50) + + super.init() + self.name = "slider" + } + + required init?(coder aDecoder: NSCoder) { + fatalError("init(coder:) has not been implemented") + } +} + +class SliderKnob: SKShapeNode { + var min = CGFloat() + var max = CGFloat() + + override func touchesMoved(_ touches: Set, with event: UIEvent?) { + + for touch in touches { + let touchLocation = touch.location(in: self.scene!) + + if self.position.x >= min - 1 && self.position.x <= max + 1 { + self.position.x = touchLocation.x + } + + if self.position.x <= min { + self.position.x = min + } + if self.position.x >= max { + self.position.x = max + + } + } + } +} + diff --git a/GoldWars/GoldWars/Components/SpinningLogoComponent.swift b/GoldWars/GoldWars/Components/Nodes/SpinningLogo3DNode.swift similarity index 76% rename from GoldWars/GoldWars/Components/SpinningLogoComponent.swift rename to GoldWars/GoldWars/Components/Nodes/SpinningLogo3DNode.swift index ab01672..d9af88f 100644 --- a/GoldWars/GoldWars/Components/SpinningLogoComponent.swift +++ b/GoldWars/GoldWars/Components/Nodes/SpinningLogo3DNode.swift @@ -1,20 +1,19 @@ // -// SpinningLogoComponent.swift +// SpinningLogo3DNode.swift // GoldWars // -// Created by Niko Jochim on 15.05.20. +// Created by Niko Jochim on 18.06.20. // Copyright © 2020 SP2. All rights reserved. // import Foundation +import SpriteKit import GameKit -class SpinningLogoComponent: GKComponent{ +class SpinningLogo3DNode: SK3DNode { - var node : SK3DNode - - init(position: CGPoint) { - + init() { + super.init(viewportSize: CGSize(width: 250, height: 250)) let scnScene: SCNScene = { let scnScene = SCNScene() let cylinder = SCNCylinder(radius: 250, height: 50) @@ -31,15 +30,12 @@ class SpinningLogoComponent: GKComponent{ scnScene.rootNode.addChildNode(cylinderNode) return scnScene }() - - self.node = SK3DNode(viewportSize: CGSize(width: 250, height: 250)) - node.scnScene = scnScene - node.position = position - super.init() + self.scnScene = scnScene + self.position = position } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - } + diff --git a/GoldWars/GoldWars/Components/PlayerInfoComponent.swift b/GoldWars/GoldWars/Components/PlayerInfoComponent.swift deleted file mode 100644 index 6b57cda..0000000 --- a/GoldWars/GoldWars/Components/PlayerInfoComponent.swift +++ /dev/null @@ -1,12 +0,0 @@ -// -// PlayerInfoComponent.swift -// GoldWars -// -// Created by Niko Jochim on 21.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import Foundation -import GameplayKit -import GameKit - diff --git a/GoldWars/GoldWars/Components/SkillComponent.swift b/GoldWars/GoldWars/Components/SkillComponent.swift deleted file mode 100644 index 001aa2a..0000000 --- a/GoldWars/GoldWars/Components/SkillComponent.swift +++ /dev/null @@ -1,25 +0,0 @@ -// -// SkillComponent.swift -// GoldWars -// -// Created by Marcel Schwarz on 24.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import Foundation -import GameKit -import GameplayKit - -class SkillComponent: GKComponent { - var skillButtonNode: SingeClickButtonNode - - init(textureName: String, text: String, position: CGPoint, isEnabled: Bool, onButtonPress: @escaping () -> ()) { - skillButtonNode = SingeClickButtonNode(textureName: textureName, text: text, isEnabled: isEnabled, position: position, onButtonPress: onButtonPress) - super.init() - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} - diff --git a/GoldWars/GoldWars/Components/SliderComponent.swift b/GoldWars/GoldWars/Components/SliderComponent.swift index e681e70..6c718c8 100644 --- a/GoldWars/GoldWars/Components/SliderComponent.swift +++ b/GoldWars/GoldWars/Components/SliderComponent.swift @@ -10,15 +10,15 @@ import GameplayKit class SliderComponent: GKComponent { - + var sliderNode: SliderNode - + init(width: CGFloat, position: CGPoint) { sliderNode = SliderNode(width: width, position: position) sliderNode.zPosition = 5 super.init() } - + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } diff --git a/GoldWars/GoldWars/Components/SliderNode.swift b/GoldWars/GoldWars/Components/SliderNode.swift deleted file mode 100644 index 2ae988e..0000000 --- a/GoldWars/GoldWars/Components/SliderNode.swift +++ /dev/null @@ -1,67 +0,0 @@ -// -// SliderNode.swift -// GoldWars -// -// Created by Niko Jochim on 05.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import SpriteKit - - -class SliderNode :SKNode { - - var sliderLine :SKShapeNode - var sliderKnob :SliderKnob - var width: CGFloat - - var getValue: CGFloat{ - get{ - return ((sliderKnob.position.x.rounded() - sliderKnob.min) / width) - } - } - - init(width: CGFloat, position: CGPoint) { - self.width = width - sliderLine = SKShapeNode(rectOf: CGSize(width: width, height: 8)) - sliderLine.position = position - sliderLine.fillColor = SKColor.white - sliderLine.zPosition = 4 - sliderKnob = SliderKnob(circleOfRadius: 20) - sliderKnob.min = position.x - width / 2 - sliderKnob.max = position.x + width / 2 - sliderKnob.fillColor = SKColor.red - sliderKnob.zPosition = sliderLine.zPosition + 1 - sliderKnob.position = CGPoint(x: sliderLine.position.x, y: sliderLine.position.y + 1) - super.init() - - } - - required init?(coder aDecoder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} - -class SliderKnob: SKShapeNode { - var min = CGFloat() - var max = CGFloat() - - override func touchesMoved(_ touches: Set, with event: UIEvent?) { - - for touch in touches { - let touchLocation = touch.location(in: self.scene!) - - if self.position.x >= min - 1 && self.position.x <= max + 1{ - self.position.x = touchLocation.x - } - - if(self.position.x <= min){ - self.position.x = min - } - if(self.position.x >= max){ - self.position.x = max - } - } - } -} - diff --git a/GoldWars/GoldWars/Components/TeamComponent.swift b/GoldWars/GoldWars/Components/TeamComponent.swift index 87562af..314d77b 100644 --- a/GoldWars/GoldWars/Components/TeamComponent.swift +++ b/GoldWars/GoldWars/Components/TeamComponent.swift @@ -14,7 +14,8 @@ class TeamComponent: GKComponent { var team: Team var player: GKPlayer let fire: SKEmitterNode - + var unitcountLabel : SKLabelNode + init(team: Team, player: GKPlayer, position: CGPoint) { fire = SKEmitterNode(fileNamed: "Fire")! fire.zPosition = 1 @@ -25,6 +26,15 @@ class TeamComponent: GKComponent { self.team = team self.player = player + + unitcountLabel = SKLabelNode(text: "") + unitcountLabel.fontColor = SKColor.black + unitcountLabel.horizontalAlignmentMode = .left + unitcountLabel.verticalAlignmentMode = .center + unitcountLabel.fontName = "AvenirNext-Bold" + unitcountLabel.fontSize = 15 + unitcountLabel.position = CGPoint(x: position.x + 30 , y: position.y - 50 ) + unitcountLabel.zPosition = 3 super.init() fire.particleColor = getColor(by: team) } @@ -37,8 +47,6 @@ class TeamComponent: GKComponent { switch team { case .team1: return SKColor.red case .team2: return SKColor.purple - case .team3: return SKColor.green - case .team4: return SKColor.gray } } diff --git a/GoldWars/GoldWars/Components/TimerComponent.swift b/GoldWars/GoldWars/Components/TimerComponent.swift deleted file mode 100644 index e69de29..0000000 diff --git a/GoldWars/GoldWars/Entities/Background.swift b/GoldWars/GoldWars/Entities/Background.swift index 6cc1b74..b3e447b 100644 --- a/GoldWars/GoldWars/Entities/Background.swift +++ b/GoldWars/GoldWars/Entities/Background.swift @@ -9,16 +9,16 @@ import GameplayKit class Background: GKEntity { - + init(size: CGSize) { super.init() addComponent(BackgroundComponent(size: size)) } - + override func update(deltaTime seconds: TimeInterval) { - component(ofType: BackgroundComponent.self)?.update() + component(ofType: BackgroundComponent.self)?.update() } - + required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } diff --git a/GoldWars/GoldWars/Entities/Base.swift b/GoldWars/GoldWars/Entities/Base.swift index e01ba62..072eb62 100644 --- a/GoldWars/GoldWars/Entities/Base.swift +++ b/GoldWars/GoldWars/Entities/Base.swift @@ -10,7 +10,7 @@ import SpriteKit import GameplayKit import GameKit -class Base: GKEntity{ +class Base: GKEntity { static var BASE_ID_COUNT: Int = 0 var unitCount: Int var hasAttackBoost = false @@ -38,22 +38,28 @@ class Base: GKEntity{ self.unitCount = 500 } if ownershipPlayer == GKLocalPlayer.local { - self.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(unitCount)" + self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(unitCount)" } } - func doPlayerMoveTypeToBase(base: Base, playerMoveType: PlayerMoveType, units: Int) -> [GKEntity]{ + func doPlayerMoveTypeToBase(base: Base, units: Int) -> [GKEntity]{ if base.ownershipPlayer != GKLocalPlayer.local { base.changeOwnership = true } - base.ownershipPlayer = self.ownershipPlayer self.unitCount -= units base.unitCount += units - self.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(self.unitCount)" - base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)" + self.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(self.unitCount)" + + if base.component(ofType: TeamComponent.self)?.unitcountLabel.text != "" { + if base.ownershipPlayer != self.ownershipPlayer { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(abs(base.unitCount - units * 2))" + } else { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)" + } + } DataService.sharedInstance.addMove(playerMove: PlayerMove(fromBase: self.baseID, toBase: base.baseID, - unitCount: units * playerMoveType.rawValue) + unitCount: units) ) return [self, base] } @@ -61,5 +67,4 @@ class Base: GKEntity{ required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } - } diff --git a/GoldWars/GoldWars/Entities/Button.swift b/GoldWars/GoldWars/Entities/Button.swift index cbc4b34..53eba03 100644 --- a/GoldWars/GoldWars/Entities/Button.swift +++ b/GoldWars/GoldWars/Entities/Button.swift @@ -8,11 +8,11 @@ import GameKit -class Button: GKEntity{ +class Button: GKEntity { let name: String var isEnabled = true - + init(name: String, textureName: String, text: String, position: CGPoint, onButtonPress: @escaping () -> ()) { self.name = name super.init() diff --git a/GoldWars/GoldWars/Entities/EntityManager.swift b/GoldWars/GoldWars/Entities/EntityManager.swift index 6987fb9..2c410d8 100644 --- a/GoldWars/GoldWars/Entities/EntityManager.swift +++ b/GoldWars/GoldWars/Entities/EntityManager.swift @@ -15,6 +15,7 @@ class EntityManager { static let gameEMInstance = EntityManager() static let menuEMInstance = EntityManager() static let settingsEMInstance = EntityManager() + static let rulesEMInstance = EntityManager() var entities = Set() var scene: SKScene @@ -25,11 +26,10 @@ class EntityManager { scene = SKScene.init() } - func setScene(scene: SKScene){ + func setScene(scene: SKScene) { self.scene = scene } - func add(_ entity: GKEntity) { entities.insert(entity) @@ -48,6 +48,7 @@ class EntityManager { scene.addChild(hudEntitiy.hostUnitsLabel) scene.addChild(hudEntitiy.peerLabel) scene.addChild(hudEntitiy.peerUnitsLabel) + scene.addChild(hudEntitiy.leaveGame) scene.addChild(hudEntitiy.defSkill) scene.addChild(hudEntitiy.atkSkill) scene.addChild(hudEntitiy.spySkill) @@ -57,15 +58,28 @@ class EntityManager { scene.addChild(hudEntitiy.currentRoundLabel) scene.addChild(hudEntitiy.roundsLabel) scene.addChild(hudEntitiy.roundLabel) + scene.addChild(hudEntitiy.blockWholeScreenPane) + } + + if let spinningLogoEntity = entity as? SpinningLogoEntity { + scene.addChild(spinningLogoEntity.spinningLogoNode) + scene.addChild(spinningLogoEntity.goldLetteringNode) + scene.addChild(spinningLogoEntity.warsLetteringNode) + } + + if let wayEntity = entity as? Way { + scene.addChild(wayEntity.localWayComponent) } if let spriteNode = entity.component(ofType: DefaultBaseComponent.self) { - scene.addChild(spriteNode.labelNode) scene.addChild(spriteNode.spriteNode) } - if let fire = entity.component(ofType: TeamComponent.self)?.fire{ - scene.addChild(fire) + + if let spriteNode = entity.component(ofType: TeamComponent.self) { + scene.addChild(spriteNode.unitcountLabel) + scene.addChild(spriteNode.fire) } + if let buttonNode = entity.component(ofType: ButtonComponent.self)?.buttonNode { scene.addChild(buttonNode) } @@ -75,18 +89,13 @@ class EntityManager { } } if let sliderNode = entity.component(ofType: SliderComponent.self)?.sliderNode { - scene.addChild(sliderNode.sliderKnob) + scene.addChild(sliderNode.hiddenKnob) scene.addChild(sliderNode.sliderLine) + scene.addChild(sliderNode.silderKnob) } if let labelNode = entity.component(ofType: LabelComponent.self)?.labelNode { scene.addChild(labelNode) } - if let node = entity.component(ofType: SpinningLogoComponent.self)?.node { - scene.addChild(node) - } - if let wayNode = entity.component(ofType: DefaultWayComponent.self)?.shapeNode { - scene.addChild(wayNode) - } } func remove(_ entity: GKEntity) { @@ -94,8 +103,9 @@ class EntityManager { spriteNode.removeFromParent() } if let sliderNode = entity.component(ofType: SliderComponent.self)?.sliderNode { - sliderNode.sliderKnob.removeFromParent() + sliderNode.hiddenKnob.removeFromParent() sliderNode.sliderLine.removeFromParent() + sliderNode.silderKnob.removeFromParent() } if let modalButton = entity.component(ofType: ButtonComponent.self) { modalButton.buttonNode.removeFromParent() @@ -103,7 +113,7 @@ class EntityManager { entities.remove(entity) } - func update(_ entities: [GKEntity]){ + func update(_ entities: [GKEntity]) { for entity in entities { self.entities.update(with: entity) let base = (entity as! Base) @@ -118,9 +128,11 @@ class EntityManager { position: (base.component(ofType: DefaultBaseComponent.self)?.spriteNode.position)! ) ) - if let fire = entity.component(ofType: TeamComponent.self)?.fire{ - scene.addChild(fire) + if let spriteNode = entity.component(ofType: TeamComponent.self) { + scene.addChild(spriteNode.unitcountLabel) + scene.addChild(spriteNode.fire) } + SoundManager.sharedInstance.playSoundEffect(pathToFile: "attack_base",fileExtension: "wav",volumeLevel: -3.0) } GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.capture.fifty.bases", increasePercentComplete: 2) } @@ -139,33 +151,21 @@ class EntityManager { if snapBase.ownership != nil { getOwnerBySnapBase = GameCenterManager.sharedInstance.getGKPlayerByUsername(displayName: snapBase.ownership!) } else { - entity.removeComponent(ofType: TeamComponent.self) + if entity.component(ofType: TeamComponent.self) != nil { + runExplosion(base: base) + entity.component(ofType: TeamComponent.self)!.fire.removeFromParent() + entity.component(ofType: TeamComponent.self)!.unitcountLabel.removeFromParent() + entity.removeComponent(ofType: TeamComponent.self) + } base.ownershipPlayer = nil } if getOwnerBySnapBase != nil { if base.ownershipPlayer != getOwnerBySnapBase { - //TODO: Outsource following with a AnimationManager - let explosion = SKEmitterNode(fileNamed: "Explosion")! - scene.addChild(explosion) - explosion.zPosition = 2 - explosion.position = base.position - explosion.name = "explosion" - explosion.particleColorSequence = nil - explosion.particleColorBlendFactor = 1.0 - let wait = SKAction.wait(forDuration: 1) - let removeParticle = SKAction.removeFromParent() - let sequence = SKAction.sequence([wait, removeParticle]) - explosion.run(sequence) + runExplosion(base: base) } - - if getOwnerBySnapBase == GKLocalPlayer.local { - base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)" - } else { - base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "" - } base.ownershipPlayer = getOwnerBySnapBase - if (entity.component(ofType: TeamComponent.self) != nil) { + if entity.component(ofType: TeamComponent.self) != nil { entity.component(ofType: TeamComponent.self)!.change(to: getTeamByPlayer(playerName: snapBase.ownership!), to: getOwnerBySnapBase!) } else { entity.addComponent(TeamComponent( @@ -174,18 +174,37 @@ class EntityManager { position: (entity.component(ofType: DefaultBaseComponent.self)?.spriteNode.position)! ) ) - if let fire = entity.component(ofType: TeamComponent.self)?.fire{ - scene.addChild(fire) + if let spriteNode = entity.component(ofType: TeamComponent.self) { + scene.addChild(spriteNode.unitcountLabel) + scene.addChild(spriteNode.fire) } } + + if getOwnerBySnapBase == GKLocalPlayer.local { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)" + } else { + base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "" + } } } - getHUD()!.updateUnitSum() - } - func getSnapshotBaseById(baseId: Int, snapshotModel: SnapshotModel) -> BaseEntityModel{ + func runExplosion(base: Base) { + let explosion = SKEmitterNode(fileNamed: "Explosion")! + scene.addChild(explosion) + explosion.zPosition = 2 + explosion.position = base.position + explosion.name = "explosion" + explosion.particleColorSequence = nil + explosion.particleColorBlendFactor = 1.0 + let wait = SKAction.wait(forDuration: 1) + let removeParticle = SKAction.removeFromParent() + let sequence = SKAction.sequence([wait, removeParticle]) + explosion.run(sequence) + } + + func getSnapshotBaseById(baseId: Int, snapshotModel: SnapshotModel) -> BaseEntityModel { return snapshotModel.baseEntites.filter { $0.baseId == baseId }[0] } @@ -218,9 +237,9 @@ class EntityManager { } func getOpponentBases(for team: Team) -> Set { - if(team == .team1){ + if team == .team1 { return getBasesByTeam(for: .team2) - }else { + } else { return getBasesByTeam(for: .team1) } } @@ -250,7 +269,7 @@ class EntityManager { return entities.filter { $0 is Base && ($0 as! Base).component(ofType: TeamComponent.self)?.player.displayName == GKLocalPlayer.local.displayName }[0].component(ofType: TeamComponent.self)!.team } - func getBasebyID(id: Int) -> Base?{ + func getBasebyID(id: Int) -> Base? { for entity in entities { if entity is Base && (entity as! Base).baseID == id { return (entity as! Base) @@ -260,7 +279,7 @@ class EntityManager { } func getBackground() -> GKEntity? { - return entities.filter{$0 is Background}[0] + return entities.filter{$0 is Background}.first } func getBaseNodeByTeam(for team: Team) -> SKSpriteNode? { @@ -271,8 +290,13 @@ class EntityManager { return entities.filter{$0 is Button && ($0 as! Button).name == buttonName }[0] as! Button } + func changeSettingsButtonText(buttonName: String, text: String) { + let button = entities.filter{$0 is Button && ($0 as! Button).name == buttonName }[0] as! Button + button.component(ofType: ButtonComponent.self)?.buttonNode.label.text = text + } + func getHUD() -> HUD? { - return entities.filter{$0 is HUD}[0] as? HUD + return entities.filter{$0 is HUD}.first as? HUD } func getSnapshotModel() -> SnapshotModel { @@ -291,7 +315,6 @@ class EntityManager { ) ) } - return SnapshotModel(baseEntites: snapBase) } @@ -317,7 +340,7 @@ class EntityManager { if let slider = modal.component(ofType: SliderComponent.self) { slider.sliderNode.removeFromParent() - slider.sliderNode.sliderKnob.removeFromParent() + slider.sliderNode.hiddenKnob.removeFromParent() slider.sliderNode.sliderLine.removeFromParent() } @@ -325,18 +348,20 @@ class EntityManager { button.buttonNode.removeFromParent() } self.remove(modal) - - for child in scene.children { - if(child.name != "fire"){ - child.alpha = 1 - } - } - isModal = false } }) } + func exitToMenu() { + GameCenterManager.sharedInstance.reset() + EntityManager.gameEMInstance.getTimer()?.stopTimer() + RoundCalculatorService.sharedInstance.currentRound = 1 + EntityManager.gameEMInstance.scene.view?.presentScene(EntityManager.menuEMInstance.scene) + EntityManager.gameEMInstance.entities.removeAll() + EntityManager.gameEMInstance.scene.removeFromParent() + } + func getTimer() -> RoundTimer? { return getHUD()?.roundTimer } diff --git a/GoldWars/GoldWars/Entities/HUD.swift b/GoldWars/GoldWars/Entities/HUD.swift index ed34eb6..4645762 100644 --- a/GoldWars/GoldWars/Entities/HUD.swift +++ b/GoldWars/GoldWars/Entities/HUD.swift @@ -12,17 +12,17 @@ import GameKit class HUD: GKEntity { var entityManager = EntityManager.gameEMInstance - var hostLabel:SKLabelNode - var hostUnitsLabel:SKLabelNode + var hostLabel: SKLabelNode + var hostUnitsLabel: SKLabelNode - var peerLabel:SKLabelNode - var peerUnitsLabel:SKLabelNode - var host: GKPlayer? - var peer: GKPlayer? + var peerLabel: SKLabelNode + var peerUnitsLabel: SKLabelNode - var spySkill: SingeClickButtonNode - var defSkill: SingeClickButtonNode - var atkSkill: SingeClickButtonNode + var leaveGame: ButtonNode + + var spySkill: SkillButtonNode + var defSkill: SkillButtonNode + var atkSkill: SkillButtonNode var roundTimerLabel: SKLabelNode let roundTimer: RoundTimer @@ -33,76 +33,92 @@ class HUD: GKEntity { var roundLabel: SKLabelNode var finishButton: ButtonNode + var blockWholeScreenPane: SKSpriteNode init(size: CGSize) { - host = GameCenterManager.sharedInstance.hostingPlayer - peer = GameCenterManager.sharedInstance.peerPlayer - hostLabel = SKLabelNode(text: host?.displayName) + hostLabel = SKLabelNode(text: GameCenterManager.sharedInstance.hostingPlayer?.displayName) + hostLabel.name = "hostLabel" hostUnitsLabel = SKLabelNode(text: "500" ) - peerLabel = SKLabelNode(text: peer?.displayName) + peerLabel = SKLabelNode(text: GameCenterManager.sharedInstance.peerPlayer?.displayName) + peerLabel.name = "peerLabel" peerUnitsLabel = SKLabelNode(text: "500") roundTimerLabel = SKLabelNode(text: "") roundTimerLabel.fontColor = UIColor.black roundTimerLabel.fontSize = CGFloat(45) roundTimerLabel.position = CGPoint(x: size.width * 0.5, y: size.height * 0.9) + roundTimerLabel.zPosition = 900 roundTimerLabel.horizontalAlignmentMode = .center self.roundTimer = RoundTimer() - - spySkill = SingeClickButtonNode( - textureName: "yellow_circle", - text: "Spy", + + finishButton = SingeClickButtonNode( + textureName: "finish_button", + text: "", isEnabled: true, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.75, y: EntityManager.gameEMInstance.scene.size.height * 0.1), - onButtonPress: { - EntityManager.gameEMInstance.getOpponentBases(for: EntityManager.gameEMInstance.getTeam()).forEach({base in base.component(ofType: DefaultBaseComponent.self)?.labelNode.text = "\(base.unitCount)"}) - GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) - GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.spy.ten", increasePercentComplete: 10) - } + position: CGPoint( + x: EntityManager.gameEMInstance.scene.size.width * 0.95 , + y: EntityManager.gameEMInstance.scene.size.height * 0.1), + onButtonPress: { } ) - defSkill = SingeClickButtonNode( - textureName: "yellow_circle", + leaveGame = ButtonNode(textureName: "exitButton", text: "" , isEnabled: true, position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.05, y: EntityManager.gameEMInstance.scene.size.height * 0.11), onButtonPress: { + EntityManager.gameEMInstance.add(Modal(modaltype: .QuitGame, base: nil, anchorPoint: CGPoint(x: EntityManager.gameEMInstance.scene.size.width / 2 , y: EntityManager.gameEMInstance.scene.size.height / 2), gameScene: EntityManager.gameEMInstance.scene, currentDraggedBase: nil, touchLocation: nil, collisionBase: nil)) + }) + leaveGame.size = CGSize(width: 120, height: 120); + + defSkill = SkillButtonNode( + textureName: "def_button", text: "Def", isEnabled: true, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.85, y: EntityManager.gameEMInstance.scene.size.height * 0.1), + cooldown: 4, + position: CGPoint(x: finishButton.position.x - 85, y: finishButton.position.y), onButtonPress: { DataService.sharedInstance.localRoundData.hasDefenceBoost = true GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.def.ten", increasePercentComplete: 10) + SoundManager.sharedInstance.playSoundEffect(pathToFile: "use_boost",fileExtension: "wav",volumeLevel: 0.0) } ) - atkSkill = SingeClickButtonNode( - textureName: "yellow_circle", + spySkill = SkillButtonNode( + textureName: "spy_button", + text: "Spy", + isEnabled: true, + cooldown: 3, + position: CGPoint(x: defSkill.position.x - 85, y: defSkill.position.y), + onButtonPress: { + EntityManager.gameEMInstance.getOpponentBases(for: EntityManager.gameEMInstance.getTeam()).forEach({base in base.component(ofType: TeamComponent.self)?.unitcountLabel.text = "\(base.unitCount)"}) + GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) + GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.spy.ten", increasePercentComplete: 10) + SoundManager.sharedInstance.playSoundEffect(pathToFile: "use_boost",fileExtension: "wav",volumeLevel: 0.0) + } + ) + atkSkill = SkillButtonNode( + textureName: "atk_button", text: "Atk", isEnabled: true, - position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.95, y: EntityManager.gameEMInstance.scene.size.height * 0.1), + cooldown: 4, + position: CGPoint(x: spySkill.position.x - 85, y: spySkill.position.y), onButtonPress: { DataService.sharedInstance.localRoundData.hasAttackBoost = true GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100) GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.atk.ten", increasePercentComplete: 10) + SoundManager.sharedInstance.playSoundEffect(pathToFile: "use_boost",fileExtension: "wav",volumeLevel: 0.0) } ) - - finishButton = SingeClickButtonNode( - textureName: "yellow_button04", - text: "Done", - isEnabled: true, - position: CGPoint( - x: EntityManager.gameEMInstance.scene.size.width * 0.15, - y: EntityManager.gameEMInstance.scene.size.height * 0.06), - onButtonPress: { } - ) - finishButton.size = CGSize(width: 80, height: 40) + finishButton.size = CGSize(width: 100, height: 100) finishButton.zPosition = 2 - backgroundRoundCounter = SKSpriteNode(texture: SKTexture(imageNamed: "roundInfo_texture")) + backgroundRoundCounter = SKSpriteNode(texture: SKTexture(imageNamed: "roundInfoTexture")) currentRoundLabel = SKLabelNode(fontNamed: "Courier-Bold") roundsLabel = SKLabelNode(fontNamed: "Courier-Bold") roundLabel = SKLabelNode(fontNamed: "Courier-Bold") + + blockWholeScreenPane = SKSpriteNode(color: UIColor.init(red: 0, green: 0, blue: 0, alpha: 0), size: size) + blockWholeScreenPane.position = CGPoint(x: size.width * 0.5, y: size.height * 0.5) + blockWholeScreenPane.zPosition = 899 + blockWholeScreenPane.isHidden = true super.init() initRoundInfo(size: size) - finishButton.onButtonPress = { [unowned self] in self.finishRound() } @@ -114,14 +130,13 @@ class HUD: GKEntity { hostUnitsLabel.position = CGPoint(x: size.width * 0.05, y: size.height * 0.9) peerUnitsLabel.position = CGPoint(x: size.width * 0.95, y: size.height * 0.9) setColor(labelNodes: [hostLabel,hostUnitsLabel,peerLabel,peerUnitsLabel]) - roundTimer.initTimer() startWithDuration() } func updateUnitSum(){ - hostUnitsLabel.text = "\(entityManager.getUnitSum(by: host!))" - peerUnitsLabel.text = "\(entityManager.getUnitSum(by: peer!))" + hostUnitsLabel.text = "\(entityManager.getUnitSum(by: GameCenterManager.sharedInstance.hostingPlayer!))" + peerUnitsLabel.text = "\(entityManager.getUnitSum(by: GameCenterManager.sharedInstance.peerPlayer!))" } func setColor(labelNodes: [SKLabelNode]) -> Void { @@ -134,38 +149,40 @@ class HUD: GKEntity { fatalError("init(coder:) has not been implemented") } - func startWithDuration(){ + func startWithDuration() { roundTimer.startTimer() finishButton.isEnabled = true - self.roundTimer.roundEnded = "Syncing" + self.roundTimer.roundEnded = "Berechnung" RoundCalculatorService.sharedInstance.isCalculating = false + blockWholeScreenPane.isHidden = true } func finishRound() -> () { + self.blockWholeScreenPane.isHidden = false self.roundTimer.timeLeft = 1; - self.roundTimer.roundEnded = "Waiting for other player..." + self.roundTimer.roundEnded = "Warte auf Gegner..." } func initRoundInfo(size: CGSize) -> () { backgroundRoundCounter.zPosition = 2 - backgroundRoundCounter.position = CGPoint(x: Double(size.width) * 0.06, y: Double(size.height) * 0.08) - + backgroundRoundCounter.position = CGPoint(x: leaveGame.position.x + 63, y: leaveGame.position.y) + backgroundRoundCounter.size = CGSize(width: 120, height: 120) currentRoundLabel.text = "\(RoundCalculatorService.sharedInstance.currentRound)" currentRoundLabel.fontSize = 50 currentRoundLabel.fontColor = SKColor.black currentRoundLabel.verticalAlignmentMode = .center - currentRoundLabel.position = CGPoint(x: backgroundRoundCounter.position.x, y: backgroundRoundCounter.position.y - 5) + currentRoundLabel.position = CGPoint(x: backgroundRoundCounter.position.x, y: backgroundRoundCounter.position.y - 4) currentRoundLabel.zPosition = backgroundRoundCounter.zPosition + 1 roundsLabel.zPosition = backgroundRoundCounter.zPosition + 1 - roundsLabel.text = "of \(RoundCalculatorService.sharedInstance.MAX_ROUNDS)" + roundsLabel.text = "von \(RoundCalculatorService.sharedInstance.MAX_ROUNDS)" roundsLabel.fontColor = SKColor.black roundsLabel.verticalAlignmentMode = .center roundsLabel.fontSize = 12 roundsLabel.position = CGPoint(x: currentRoundLabel.position.x, y: currentRoundLabel.position.y - 25) roundLabel.zPosition = backgroundRoundCounter.zPosition + 1 - roundLabel.text = "Round" + roundLabel.text = "Runde" roundLabel.fontColor = SKColor.black roundLabel.verticalAlignmentMode = .center roundLabel.fontSize = 12 @@ -175,9 +192,17 @@ class HUD: GKEntity { func setCurrentRound(round: Int) -> Void { currentRoundLabel.text = "\(round)" let newRoundAction = SKAction.sequence([ - SKAction.scale(by: 2, duration: 1), - SKAction.scale(by: 0.5, duration: 1), - ]) + SKAction.scale(by: 2, duration: 1), + SKAction.scale(by: 0.5, duration: 1), + ]) currentRoundLabel.run(newRoundAction) + SoundManager.sharedInstance.playSoundEffect(pathToFile: "new_round", fileExtension: "wav", volumeLevel: 0.0) + self.decreaseSkillRoundCooldownCounter() + } + + func decreaseSkillRoundCooldownCounter() { + self.spySkill.decreaseCooldown() + self.atkSkill.decreaseCooldown() + self.defSkill.decreaseCooldown() } } diff --git a/GoldWars/GoldWars/Entities/Modal.swift b/GoldWars/GoldWars/Entities/Modal.swift index 9e9a0d4..e0b73b1 100644 --- a/GoldWars/GoldWars/Entities/Modal.swift +++ b/GoldWars/GoldWars/Entities/Modal.swift @@ -8,13 +8,7 @@ import GameplayKit -enum ModalType: String{ - case BaseDetails - case BaseAttack - case BaseMoveOwnUnits -} - -class Modal: GKEntity{ +class Modal: GKEntity { var entityManager = EntityManager.gameEMInstance var unitCount: Int @@ -24,9 +18,14 @@ class Modal: GKEntity{ var body: SKLabelNode var footer: SKLabelNode var overlay: SKSpriteNode + var type: ModalType - init(modaltype: ModalType, base: Base, anchorPoint: CGPoint, gameScene: GameScene, currentDraggedBase: Base?, touchLocation: CGPoint, collisionBase: Base?) { - unitCount = base.unitCount + init(modaltype: ModalType, base: Base?, anchorPoint: CGPoint, gameScene: SKScene, currentDraggedBase: Base?, touchLocation: CGPoint?, collisionBase: Base?) { + self.type = modaltype + unitCount = 0 + if base != nil { + unitCount = base!.unitCount + } let texture = SKTexture(imageNamed:"ModalBackground") background = SKSpriteNode(texture: texture, size: texture.size()) @@ -45,33 +44,38 @@ class Modal: GKEntity{ overlay.zPosition = 3 switch modaltype { - case .BaseDetails: - header = SKLabelNode(text: "Information") - body = SKLabelNode(text: "Diese Basis enthält \(base.unitCount) Einheiten") - footer = SKLabelNode() - case .BaseAttack: - header = SKLabelNode(text: "Angriff") - body = SKLabelNode(text: "Schicke \(unitCount / 2)\nEinheiten") - footer = SKLabelNode() - case .BaseMoveOwnUnits: - header = SKLabelNode(text: "Formation") - body = SKLabelNode(text: "Sende \(unitCount / 2)\nEinheiten") - footer = SKLabelNode() + case .BaseAttack: + header = SKLabelNode(text: "Angriff") + body = SKLabelNode(text: "\(unitCount / 2) Einheiten") + footer = SKLabelNode() + case .BaseMoveOwnUnits: + header = SKLabelNode(text: "Formation") + body = SKLabelNode(text: "\(unitCount / 2) Einheiten") + footer = SKLabelNode() + case .PauseGame: + header = SKLabelNode(text: "Pause") + body = SKLabelNode(text: "Warte auf Gegner...") + footer = SKLabelNode() + closeButton.zPosition = -1 + case .QuitGame: + header = SKLabelNode(text: "Spiel verlassen") + body = SKLabelNode(text: "Sicher verlassen?") + footer = SKLabelNode() } self.header.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y + 90) self.header.fontName = "HelveticaNeue-Bold" self.header.fontSize = 40 self.header.zPosition = 5 - - self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 20) + + self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y + 15) self.body.numberOfLines = 2 self.body.preferredMaxLayoutWidth = 390 self.body.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.center self.body.fontName = "HelveticaNeue-Bold" self.body.fontSize = 40 self.body.zPosition = 5 - + self.footer.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 40) self.footer.fontName = "HelveticaNeue-Bold" self.footer.fontSize = 40 @@ -79,18 +83,23 @@ class Modal: GKEntity{ super.init() - switch modaltype{ - case .BaseDetails: - addComponent(ButtonComponent(textureName: "yellow_button04", text: "Zurück", position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 105), isEnabled: true, onButtonPress: { - EntityManager.gameEMInstance.removeModal() - })) - case .BaseAttack, .BaseMoveOwnUnits: - let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden" - addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 50))) - addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 105), isEnabled: true, onButtonPress: { - self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation, gameScene: gameScene, collisionBase: collisionBase) - EntityManager.gameEMInstance.removeModal() - })) + switch modaltype { + case .BaseAttack, .BaseMoveOwnUnits: + let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden" + addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 15))) + addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 95), isEnabled: true, onButtonPress: { + self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation!, gameScene: gameScene, collisionBase: collisionBase) + EntityManager.gameEMInstance.removeModal() + })) + case .QuitGame: + addComponent(ButtonComponent(textureName: "yellow_button04", text: "Verlassen", position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 95), isEnabled: true, onButtonPress: { + EntityManager.gameEMInstance.removeModal() + GameCenterManager.sharedInstance.sendStateToPeers(state: State(state: 6)) + GameCenterManager.sharedInstance.opponentQuit = false + GameCenterManager.sharedInstance.quitGame = true + })) + case .PauseGame: + break } } @@ -98,7 +107,7 @@ class Modal: GKEntity{ fatalError("init(coder:) has not been implemented") } - func removeModalEntities(gameScene: SKScene){ + func removeModalEntities(gameScene: SKScene) { for entity in entityManager.entities { if entityManager.isModal && entity.isMember(of: Modal.self) { entityManager.remove(entity) @@ -106,11 +115,11 @@ class Modal: GKEntity{ } } - func sendUnits(currentDraggedBase: Base?, touchLocation: CGPoint, gameScene: GameScene, collisionBase: Base?){ + func sendUnits(currentDraggedBase: Base?, touchLocation: CGPoint, gameScene: SKScene, collisionBase: Base?) { for base in currentDraggedBase!.adjacencyList { - if base == collisionBase { + if base == collisionBase { RoundCalculatorService.sharedInstance.increaseMoveCounter(ownBase: currentDraggedBase?.ownershipPlayer == base.ownershipPlayer) - entityManager.update((currentDraggedBase?.doPlayerMoveTypeToBase(base: base, playerMoveType: PlayerMoveType.AtkMove, units: Int(GameScene.sendUnits)))!) + entityManager.update((currentDraggedBase?.doPlayerMoveTypeToBase(base: base, units: Int(GameScene.sendUnits)))!) GameScene.sendUnits = 0 } } diff --git a/GoldWars/GoldWars/Entities/SpinningLogoEntity.swift b/GoldWars/GoldWars/Entities/SpinningLogoEntity.swift index 0e84923..bcd9e2f 100644 --- a/GoldWars/GoldWars/Entities/SpinningLogoEntity.swift +++ b/GoldWars/GoldWars/Entities/SpinningLogoEntity.swift @@ -11,9 +11,25 @@ import GameplayKit class SpinningLogoEntity: GKEntity { - init(position: CGPoint) { + let spinningLogoNode: SpinningLogo3DNode + let goldLetteringNode: SKSpriteNode + let warsLetteringNode: SKSpriteNode + + init(sceneSize size: CGSize) { + goldLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "goldLettering")) + goldLetteringNode.position = CGPoint(x: size.width / 2 , y: size.height * 0.83) + goldLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6) + + warsLetteringNode = SKSpriteNode(texture: SKTexture(imageNamed: "warsLettering")) + warsLetteringNode.position = CGPoint(x: size.width / 2, y: size.height * 0.17) + warsLetteringNode.size = CGSize(width: size.width / 2.02, height: size.height / 3.6) + + spinningLogoNode = SpinningLogo3DNode() + spinningLogoNode.viewportSize = CGSize(width: size.width / 5.12 * 0.69, height: size.height / 3.84 * 0.69) + spinningLogoNode.zPosition = goldLetteringNode.zPosition - 1 + spinningLogoNode.position = CGPoint(x: size.width * 0.455, y: size.height * 0.83) + super.init() - self.addComponent(SpinningLogoComponent(position: position)) } required init?(coder: NSCoder) { diff --git a/GoldWars/GoldWars/Entities/Way.swift b/GoldWars/GoldWars/Entities/Way.swift index 6a64eb6..1b89d72 100644 --- a/GoldWars/GoldWars/Entities/Way.swift +++ b/GoldWars/GoldWars/Entities/Way.swift @@ -11,20 +11,53 @@ import SpriteKit import GameplayKit class Way: GKEntity { - + + var localWayComponent: SKShapeNode + required init(fromBase: Base, toBase: Base) { - super.init() + + let fromBaseX = fromBase.position.x + let fromBaseY = fromBase.position.y + let toBaseX = toBase.position.x + let toBaseY = toBase.position.y + + let xControll1 = Way.computeX(x1: fromBaseX, x2: toBaseX, y1: fromBaseY, y2: toBaseY, factor: 2/5) + let yControll1 = Way.computeY(x1: fromBaseX, x2: toBaseX, y1: fromBaseY, y2: toBaseY, factor: 2/5) + let xControll2 = Way.computeX(x1: fromBaseX, x2: toBaseX, y1: fromBaseY, y2: toBaseY, factor: 3/5) + let yControll2 = Way.computeY(x1: fromBaseX, x2: toBaseX, y1: fromBaseY, y2: toBaseY, factor: 3/5) let pathToDraw = CGMutablePath() pathToDraw.move(to: fromBase.position) - pathToDraw.addLine(to: toBase.position) + pathToDraw.addCurve( + to: toBase.position, + control1: CGPoint(x: xControll1, y: yControll1), + control2: CGPoint(x: xControll2, y: yControll2) + ) - - addComponent(DefaultWayComponent(pathToDraw: pathToDraw)) + self.localWayComponent = SKShapeNode() + self.localWayComponent.path = pathToDraw + self.localWayComponent.strokeColor = UIColor(red: 0.852, green: 0.649, blue: 0.123, alpha: 1) + self.localWayComponent.lineWidth = 10 + self.localWayComponent.zPosition = 0 + self.localWayComponent.name = "way" + super.init() } required init?(coder: NSCoder) { fatalError("init(coder:) has not been implemented") } + + static var wayDelta: CGFloat = 5 + + static func computeX(x1: CGFloat, x2: CGFloat, y1: CGFloat, y2: CGFloat, factor: CGFloat) -> CGFloat { + let mix:CGFloat = Bool.random() ? -1/wayDelta : 1/wayDelta + let x = x1 + factor * (x2 - x1) + mix * -(y2-y1) + return x + } + + static func computeY(x1: CGFloat, x2: CGFloat, y1: CGFloat, y2: CGFloat, factor: CGFloat) -> CGFloat { + let mix:CGFloat = Bool.random() ? -1/wayDelta : 1/wayDelta + let y = y1 + factor * (y2 - y1) + mix * (x2-x1) + return y + } } - diff --git a/GoldWars/GoldWars/Enums/ModalType.swift b/GoldWars/GoldWars/Enums/ModalType.swift new file mode 100644 index 0000000..58a69f6 --- /dev/null +++ b/GoldWars/GoldWars/Enums/ModalType.swift @@ -0,0 +1,14 @@ +// +// ModalType.swift +// GoldWars +// +// Created by Aldin Duraki on 25.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +enum ModalType: String { + case BaseAttack + case BaseMoveOwnUnits + case PauseGame + case QuitGame +} diff --git a/GoldWars/GoldWars/Enums/PlayerMoveType.swift b/GoldWars/GoldWars/Enums/PlayerMoveType.swift deleted file mode 100644 index 2f1bdd6..0000000 --- a/GoldWars/GoldWars/Enums/PlayerMoveType.swift +++ /dev/null @@ -1,13 +0,0 @@ -// -// PlayerMoveType.swift -// GoldWars -// -// Created by Aldin Duraki on 16.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -enum PlayerMoveType: Int, Codable{ - case AtkMove = 1 - case TxnMove = -1 -} - diff --git a/GoldWars/GoldWars/Enums/Team.swift b/GoldWars/GoldWars/Enums/Team.swift index 15115fa..0ca3a21 100644 --- a/GoldWars/GoldWars/Enums/Team.swift +++ b/GoldWars/GoldWars/Enums/Team.swift @@ -9,8 +9,6 @@ enum Team: Int { case team1 = 1 case team2 = 2 - case team3 = 3 - case team4 = 4 - static let allValues = [team1, team2,team3,team4] + static let allValues = [team1, team2] } diff --git a/GoldWars/GoldWars/GameViewController.swift b/GoldWars/GoldWars/GameViewController.swift index a3b45f5..3ab5d6e 100644 --- a/GoldWars/GoldWars/GameViewController.swift +++ b/GoldWars/GoldWars/GameViewController.swift @@ -11,7 +11,8 @@ import SpriteKit import GameplayKit class GameViewController: UIViewController { - + var currentScene: SKView? + override func viewDidLoad() { super.viewDidLoad() @@ -25,9 +26,8 @@ class GameViewController: UIViewController { view.showsNodeCount = true } GameCenterManager.sharedInstance.viewController = self - - } + override var shouldAutorotate: Bool { return true } @@ -43,4 +43,5 @@ class GameViewController: UIViewController { override var prefersStatusBarHidden: Bool { return true } + } diff --git a/GoldWars/GoldWars/Map/CElements.swift b/GoldWars/GoldWars/Map/CElements.swift index 1e158be..588d328 100644 --- a/GoldWars/GoldWars/Map/CElements.swift +++ b/GoldWars/GoldWars/Map/CElements.swift @@ -183,24 +183,25 @@ class CElement3: CenterElementProtocol { var id: Int = 3 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.maxY + y: frame.maxY - delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.minY + y: frame.minY + delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.minY + y: frame.minY + delta ) ) self.bases.append(centerBase) @@ -260,24 +261,25 @@ class CElement4: CenterElementProtocol { var id: Int = 4 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.maxY + y: frame.maxY - delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.minY + y: frame.minY + delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.minY + y: frame.minY + delta ) ) self.bases.append(centerBase) @@ -337,24 +339,25 @@ class CElement5: CenterElementProtocol { var id: Int = 5 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.minY + y: frame.minY + delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.maxY + y: frame.maxY - delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.maxY + y: frame.maxY - delta ) ) self.bases.append(centerBase) @@ -414,24 +417,25 @@ class CElement6: CenterElementProtocol { var id: Int = 6 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.minY + y: frame.minY + delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.maxY + y: frame.maxY - delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.maxY + y: frame.maxY - delta ) ) self.bases.append(centerBase) @@ -766,24 +770,25 @@ class CElement11: CenterElementProtocol { var id: Int = 11 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.maxY + y: frame.maxY - delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.minY + y: frame.minY + delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.minY + y: frame.minY + delta ) ) self.bases.append(centerBase) @@ -843,24 +848,25 @@ class CElement12: CenterElementProtocol { var id: Int = 12 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.maxY + y: frame.maxY - delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.minY + y: frame.minY + delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.minY + y: frame.minY + delta ) ) self.bases.append(centerBase) @@ -920,24 +926,25 @@ class CElement13: CenterElementProtocol { var id: Int = 13 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.minY + y: frame.minY + delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.maxY + y: frame.maxY - delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.maxY + y: frame.maxY - delta ) ) self.bases.append(centerBase) @@ -997,24 +1004,25 @@ class CElement14: CenterElementProtocol { var id: Int = 14 required init(frame: CGRect) { + let delta = (frame.maxY - frame.minY) * 0.15 self.centerBase = Base( position: CGPoint( x: frame.midX, - y: frame.minY + y: frame.minY + delta ) ) self.leftBase = Base( position: CGPoint( x: frame.minX, - y: frame.maxY + y: frame.maxY - delta ) ) self.rightBase = Base( position: CGPoint( x: frame.maxX, - y: frame.maxY + y: frame.maxY - delta ) ) self.bases.append(centerBase) diff --git a/GoldWars/GoldWars/Map/MapFactory.swift b/GoldWars/GoldWars/Map/MapFactory.swift index 9b8da1c..f2e1d0d 100644 --- a/GoldWars/GoldWars/Map/MapFactory.swift +++ b/GoldWars/GoldWars/Map/MapFactory.swift @@ -229,7 +229,6 @@ class MapFactory { ways.append(Way(fromBase: p2StartBases["bot"]!, toBase: bottomRight.getRightConnection()!)) } - // Add all bases to the scene entityManager.add(basePlayerOne) p1StartBases.forEach({(key, base) in entityManager.add(base)}) diff --git a/GoldWars/GoldWars/Map/MapUtils.swift b/GoldWars/GoldWars/Map/MapUtils.swift index 732c93a..9dfc3fb 100644 --- a/GoldWars/GoldWars/Map/MapUtils.swift +++ b/GoldWars/GoldWars/Map/MapUtils.swift @@ -46,7 +46,6 @@ struct MapGenerationModel: Codable { bottomRightId: Int.random(in: 0...noOfCElements) ) } - } class CenterElementProvider { diff --git a/GoldWars/GoldWars/Models/HeartbeatModel.swift b/GoldWars/GoldWars/Models/HeartbeatModel.swift new file mode 100644 index 0000000..81f918c --- /dev/null +++ b/GoldWars/GoldWars/Models/HeartbeatModel.swift @@ -0,0 +1,13 @@ +// +// HeartbeatModel.swift +// GoldWars +// +// Created by student on 25.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import Foundation + +struct Heartbeat: Codable { + var date: Date +} diff --git a/GoldWars/GoldWars/Models/NotificationModel.swift b/GoldWars/GoldWars/Models/NotificationModel.swift new file mode 100644 index 0000000..bee4cb9 --- /dev/null +++ b/GoldWars/GoldWars/Models/NotificationModel.swift @@ -0,0 +1,16 @@ +// +// NotificationModel.swift +// GoldWars +// +// Created by Aldin Duraki on 25.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +struct NotificationModel: Codable { + let name: String + + init(name: String) { + self.name = name + } +} + diff --git a/GoldWars/GoldWars/Models/RoundDataModel.swift b/GoldWars/GoldWars/Models/RoundDataModel.swift new file mode 100644 index 0000000..cbe6a2c --- /dev/null +++ b/GoldWars/GoldWars/Models/RoundDataModel.swift @@ -0,0 +1,25 @@ +// +// RoundDataModel.swift +// GoldWars +// +// Created by Aldin Duraki on 25.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +struct LocalRoundData: Codable { + var localPlayerMoves: [PlayerMove] + var hasAttackBoost: Bool + var hasDefenceBoost: Bool + + init() { + localPlayerMoves = [] + hasAttackBoost = false + hasDefenceBoost = false + } +} + +struct PlayerMove: Codable { + let fromBase: Int + let toBase: Int + var unitCount: Int +} diff --git a/GoldWars/GoldWars/Models/SnapshotModel.swift b/GoldWars/GoldWars/Models/SnapshotModel.swift new file mode 100644 index 0000000..797f3d1 --- /dev/null +++ b/GoldWars/GoldWars/Models/SnapshotModel.swift @@ -0,0 +1,27 @@ +// +// SnapshotModel.swift +// GoldWars +// +// Created by Aldin Duraki on 25.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +class SnapshotModel: Codable { + var baseEntites: [BaseEntityModel] + + init(baseEntites: [BaseEntityModel]) { + self.baseEntites = baseEntites + } +} + +class BaseEntityModel: Codable { + let baseId: Int + var unitCount: Int + var ownership: String? + + init(baseId: Int, unitCount: Int, ownership: String?, hasAttackBoost: Bool, hasDefenceBoost: Bool) { + self.baseId = baseId + self.unitCount = unitCount + self.ownership = ownership + } +} diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index d8ad5bb..fed9b10 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -10,14 +10,14 @@ import SpriteKit import GameplayKit import GameKit -class GameScene: SKScene{ +class GameScene: SKScene { var entityManager = EntityManager.gameEMInstance - - var isMoveTouch = false - var currentDraggedBase : Base? - static var sendUnits: CGFloat = 0 + static var sendUnits: Int = 0 + var currentDraggedBase: Base? var collisionBase: Base? + var gameEndEffects = false + var isMoveTouch = false override func sceneDidLoad() { entityManager.setScene(scene: self) @@ -25,8 +25,13 @@ class GameScene: SKScene{ entityManager.add(Background(size: self.size)) if CommandLine.arguments.contains("--no-matchmaking") { _ = MapFactory(scene: self, entityManager: entityManager).load() - return } + return + } + + override func didMove(to view: SKView) { + NotificationCenter.default.addObserver(self, selector: #selector(pauseGame), name: Notification.Name("pauseGame"), object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(resumeGame), name: Notification.Name("resumeGame"), object: nil) } override func touchesEnded(_ touches: Set, with event: UIEvent?) { @@ -45,12 +50,11 @@ class GameScene: SKScene{ entityManager.getBasesByPlayer(for: GKLocalPlayer.local).forEach({base in moveFireAndBase(base: base, touchLocation: base.position) }) - } - else { + } else { for entity in entityManager.entities { - let spriteNode = entity.component(ofType: DefaultBaseComponent.self)?.spriteNode - //FIXME: this is confusing - addBaseDetails(touchLocation: touchLocation, spriteNode: spriteNode, touches: touches, event: event, entity: entity) + if atPoint(touchLocation) == entity.component(ofType: DefaultBaseComponent.self)?.spriteNode { + entity.component(ofType: DefaultBaseComponent.self)?.spriteNode.touchesBegan(touches, with: event) + } } } } @@ -73,28 +77,19 @@ class GameScene: SKScene{ override func update(_ currentTime: TimeInterval) { entityManager.getBackground()?.update(deltaTime: currentTime) - } - - func addBaseDetails(touchLocation: CGPoint, spriteNode: SKNode?, touches: Set, event: UIEvent?, entity: GKEntity){ - if atPoint(touchLocation) == spriteNode && !entityManager.isModal { - spriteNode?.touchesBegan(touches, with: event) - if let baseEntity = entity as? Base { - if baseEntity.ownershipPlayer == GKLocalPlayer.local { - entityManager.add(Modal(modaltype: .BaseDetails, - base: entity as! Base, - anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), - gameScene: self, - currentDraggedBase: currentDraggedBase, touchLocation: touchLocation, collisionBase: collisionBase)) - } - } + if GameCenterManager.sharedInstance.gameEnded && !gameEndEffects { + gameEnd() + } + if GameCenterManager.sharedInstance.quitGame { + gameQuit() } } - func addAttackDetails(touchLocation: CGPoint){ + + func addAttackDetails(touchLocation: CGPoint) { for base in currentDraggedBase!.adjacencyList { if atPoint(touchLocation) == base.component(ofType: DefaultBaseComponent.self)?.spriteNode { collisionBase = base - // TODO: change interaction based on collision instead of touchlocation if currentDraggedBase!.unitCount > 1 { if !checkIfMoveIsAble() { return @@ -108,29 +103,177 @@ class GameScene: SKScene{ touchLocation: touchLocation, collisionBase: collisionBase) ) - GameScene.sendUnits = CGFloat(currentDraggedBase!.unitCount / 2) + GameScene.sendUnits = Int(currentDraggedBase!.unitCount / 2) } } } } - func checkSlider(){ + func checkSlider() { for e in entityManager.entities{ if let modal = e as? Modal { - GameScene.sendUnits = ((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up) - - //TODO: refactor this quick and dirty fix - if GameScene.sendUnits == 0 { - GameScene.sendUnits = 1 - } else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount { - GameScene.sendUnits -= 1 + if modal.type == ModalType.BaseAttack || modal.type == ModalType.BaseMoveOwnUnits { + GameScene.sendUnits = Int(((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up)) + if GameScene.sendUnits == 0 { + GameScene.sendUnits = 1 + } else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount { + GameScene.sendUnits -= 1 + } + modal.body.text = "\(GameScene.sendUnits) Einheiten " } - modal.body.text = "Schicke \(GameScene.sendUnits) Einheiten " } } } - func checkBases(bases: Set, touchLocation: CGPoint){ + func gameEnd() { + entityManager.getHUD()?.blockWholeScreenPane.isHidden = true + gameEndEffects = true + GameCenterManager.sharedInstance.gameEnded = false + let move = SKAction.move(to: CGPoint(x: self.size.width / 2, y: self.size.height / 2), duration: 1) + let removeParticle = SKAction.removeFromParent() + let sequence = SKAction.sequence([move, removeParticle]) + var actionAdded = false + for nodeChild in children { + if nodeChild.name == "peerLabel" || nodeChild.name == "hostLabel" { + continue + } + if nodeChild.name == "way" { + nodeChild.run(SKAction.removeFromParent()) + continue + } + if nodeChild.name != "clouds" { + nodeChild.run(sequence) { + if !actionAdded { + let explosion = self.getFinalExplosion() + self.addChild(explosion) + let action = SKAction.afterDelay(2) { + (self.childNode(withName: "hostLabel") as! SKLabelNode).horizontalAlignmentMode = .center + (self.childNode(withName: "peerLabel") as! SKLabelNode).horizontalAlignmentMode = .center + self.childNode(withName: "hostLabel")?.run(SKAction.move(to: CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.25), duration: 1)) + self.childNode(withName: "peerLabel")?.run(SKAction.move(to: CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.25), duration: 1)) + self.initGameEndIcons() + let node = ButtonNode(textureName: "yellow_button05", text: "Menü", isEnabled: true, position: CGPoint(x: self.size.width / 2, y: self.size.height / 2 - 300), onButtonPress: { + self.backToMenuAction() + }) + node.name = "BackButton" + self.addChild(node) + } + explosion.run(action) + actionAdded = true + } + } + } + } + } + + func gameQuit() { + entityManager.getHUD()?.blockWholeScreenPane.isHidden = true + gameEndEffects = true + GameCenterManager.sharedInstance.quitGame = false + let move = SKAction.move(to: CGPoint(x: self.size.width / 2, y: self.size.height / 2), duration: 1) + let removeParticle = SKAction.removeFromParent() + let sequence = SKAction.sequence([move, removeParticle]) + var actionAdded = false + for nodeChild in children { + if nodeChild.name == "peerLabel" || nodeChild.name == "hostLabel" { + nodeChild.removeFromParent() + } + if nodeChild.name == "way" { + nodeChild.run(SKAction.removeFromParent()) + continue + } + if nodeChild.name != "clouds" { + nodeChild.run(sequence) { + if !actionAdded { + let explosion = self.getFinalExplosion() + self.addChild(explosion) + let action = SKAction.afterDelay(2) { + let node = ButtonNode(textureName: "yellow_button05", text: "Menü", isEnabled: true, position: CGPoint(x: self.size.width / 2, y: self.size.height / 2 - 300), onButtonPress: { + self.backToMenuAction() + }) + node.name = "BackButton" + self.addChild(node) + } + explosion.run(action) + actionAdded = true + } + } + } + } + let disconnectLabel = SKLabelNode.init(fontNamed: "Courier-Bold") + disconnectLabel.position = CGPoint(x: self.size.width/2, y: self.size.height/2) + disconnectLabel.horizontalAlignmentMode = .center + disconnectLabel.fontColor = UIColor.black + disconnectLabel.alpha = 0 + disconnectLabel.setScale(0.1) + if GameCenterManager.sharedInstance.opponentQuit { + if GameCenterManager.sharedInstance.localPlayer == GameCenterManager.sharedInstance.hostingPlayer { + disconnectLabel.text = GameCenterManager.sharedInstance.peerPlayer?.displayName + } else { + disconnectLabel.text = GameCenterManager.sharedInstance.hostingPlayer?.displayName + } + disconnectLabel.text?.append(" hat das Spiel verlassen!") + } else { + disconnectLabel.text = "Du hast das Spiel verlassen!" + } + let showUpAnimation = SKAction.sequence([ + SKAction.fadeAlpha(by: 1, duration: 2.5), + SKAction.scale(by: 10, duration: 1), + ]) + disconnectLabel.run(showUpAnimation) + self.addChild(disconnectLabel) + } + + func initGameEndIcons() { + let iclonSize = CGSize(width: 400, height: 400) + let winnerIcon = SKSpriteNode(texture: SKTexture(imageNamed: "winner")); + winnerIcon.size = iclonSize + let loserIcon = SKSpriteNode(texture: SKTexture(imageNamed: "BaseTexture")) + loserIcon.size = iclonSize + let loserFire = SKEmitterNode(fileNamed: "LoserFire") + loserFire?.zPosition = loserIcon.zPosition - 1 + loserFire?.run(SKAction.scale(by: 4, duration: 8)) + let iconPosition1 = CGPoint(x: self.size.width * 0.25, y: self.size.height * 0.55) + let iconPosition2 = CGPoint(x: self.size.width * 0.75, y: self.size.height * 0.55) + let coin = SpinningLogo3DNode() + if GameCenterManager.sharedInstance.winner == GameCenterManager.sharedInstance.hostingPlayer?.displayName { + winnerIcon.position = iconPosition1 + coin.position = iconPosition1 + loserIcon.position = iconPosition2 + loserFire?.position = iconPosition2 + } else { + winnerIcon.position = iconPosition2 + coin.position = iconPosition2 + loserIcon.position = iconPosition1 + loserFire?.position = iconPosition1 + } + self.addChild(winnerIcon) + self.addChild(coin) + self.addChild(loserIcon) + self.addChild(loserFire!) + } + + func getFinalExplosion() -> SKEmitterNode { + let explosion = SKEmitterNode(fileNamed: "Explosion")! + explosion.zPosition = 2 + explosion.position = CGPoint(x: self.size.width / 2, y: self.size.height / 2) + explosion.name = "explosion" + explosion.particleColorSequence = nil + explosion.particleColorBlendFactor = 1.0 + return explosion + } + + func backToMenuAction() { + GameCenterManager.sharedInstance.reset() + self.gameEndEffects = false + entityManager.getTimer()?.stopTimer() + RoundCalculatorService.sharedInstance.currentRound = 1 + self.view?.presentScene(MenuScene(size: self.size)) + entityManager.entities.removeAll() + self.removeFromParent() + } + + func checkBases(bases: Set, touchLocation: CGPoint) { for base in bases { if atPoint(touchLocation) == base.component(ofType: DefaultBaseComponent.self)?.spriteNode { if !base.changeOwnership { @@ -145,13 +288,13 @@ class GameScene: SKScene{ } } - func moveFireAndBase(base: Base, touchLocation: CGPoint){ + func moveFireAndBase(base: Base, touchLocation: CGPoint) { base.component(ofType: DefaultBaseComponent.self)?.spriteNode.position = touchLocation base.component(ofType: TeamComponent.self)?.fire.position = touchLocation - base.component(ofType: DefaultBaseComponent.self)?.labelNode.position = CGPoint(x:touchLocation.x + 30, y: touchLocation.y - 50) + base.component(ofType: TeamComponent.self)?.unitcountLabel.position = CGPoint(x:touchLocation.x + 30, y: touchLocation.y - 50) } - func showNearestBases(base: Base){ + func showNearestBases(base: Base) { for adjacencyBase in base.adjacencyList { let node = adjacencyBase.component(ofType: DefaultBaseComponent.self)?.spriteNode node?.run(SKAction.sequence([ @@ -161,7 +304,7 @@ class GameScene: SKScene{ } } - func checkIfMoveIsAble() -> Bool{ + func checkIfMoveIsAble() -> Bool { if isAttackMove() { return RoundCalculatorService.sharedInstance.numberOfAttacks < 2 } else { @@ -178,6 +321,32 @@ class GameScene: SKScene{ } func isAttackMove() -> Bool { - return collisionBase?.ownershipPlayer != currentDraggedBase?.ownershipPlayer + if collisionBase?.ownershipPlayer == nil { + return true + } + return collisionBase?.ownershipPlayer != currentDraggedBase?.ownershipPlayer && !(collisionBase?.changeOwnership ?? false) } + + + + @objc func pauseGame() -> Void { + if !self.gameEndEffects{ + entityManager.removeModal() + entityManager.getHUD()?.roundTimer.stopTimer() + entityManager.add(Modal(modaltype: .PauseGame, + base: nil, + anchorPoint: CGPoint(x: self.size.width / 2 , y: self.size.height / 2), + gameScene: self, + currentDraggedBase: nil, + touchLocation: nil, + collisionBase: nil + )) + } + } + + @objc func resumeGame() -> Void { + entityManager.removeModal() + entityManager.getHUD()?.roundTimer.resumeTimer() + } + } diff --git a/GoldWars/GoldWars/Scenes/MenuScene.swift b/GoldWars/GoldWars/Scenes/MenuScene.swift index 82469a3..a960d55 100644 --- a/GoldWars/GoldWars/Scenes/MenuScene.swift +++ b/GoldWars/GoldWars/Scenes/MenuScene.swift @@ -17,46 +17,59 @@ class MenuScene: SKScene { entityManager.setScene(scene: self) let midX = self.size.width / 2 let midY = self.size.height / 2 - entityManager.add(Button(name: "startGameButton", - textureName: "yellow_button04", - text: "Start Game", - position: CGPoint(x: midX, y: midY), - onButtonPress: { - if CommandLine.arguments.contains("--no-matchmaking") { - self.loadScene(scene: GameScene(size: self.size)) - SoundManager.sharedInstance.stopMenuMusic() - } else { - - if GameCenterManager.isAuthenticated { - GameCenterManager.sharedInstance.presentMatchmaker() - }else { - GameCenterManager.sharedInstance.authUser() - } - } - })) - entityManager.add(Button(name: "settingsButton", - textureName: "yellow_button04", - text: "Settings", - position: CGPoint(x: midX, y: midY - 80 ), - onButtonPress: { - let scene = SettingsScene(size: self.size) - self.loadScene(scene: scene) - })) - entityManager.add(Button(name: "gameCenterButton", - textureName: "yellow_button04", - text: "GameCenter", - position: CGPoint(x: midX, y: midY - 160), - onButtonPress: { - if GameCenterManager.isAuthenticated { - GameCenterManager.sharedInstance.presentGameCenter() - }else { - GameCenterManager.sharedInstance.authUser() - } - })) + entityManager.add( + Button(name: "startGameButton", + textureName: "gold_button_3", + text: "Start Game", + position: CGPoint(x: midX, y: midY + 90), + onButtonPress: { + if CommandLine.arguments.contains("--no-matchmaking") { + self.loadScene(scene: GameScene(size: self.size)) + SoundManager.sharedInstance.stopMenuMusic() + } else { + if GameCenterManager.isAuthenticated { + GameCenterManager.sharedInstance.presentMatchmaker() + } else { + GameCenterManager.sharedInstance.authUser() + } + } + } + ) + ) + entityManager.add( + Button(name: "settingsButton", + textureName: "gold_button_3", + text: "Einstellungen", + position: CGPoint(x: midX, y: midY ), + onButtonPress: { self.loadScene(scene: SettingsScene(size: self.size))} + ) + ) + entityManager.add( + Button(name: "gameCenterButton", + textureName: "gold_button_3", + text: "GameCenter", + position: CGPoint(x: midX, y: midY - 90), + onButtonPress: { + if GameCenterManager.isAuthenticated { + GameCenterManager.sharedInstance.presentGameCenter() + } else { + GameCenterManager.sharedInstance.authUser() + } + } + ) + ) + entityManager.add( + Button(name: "regelwerkButton", + textureName: "questionmark", + text: "", + position: CGPoint(x: self.size.width - 50, y: self.size.height - 50), + onButtonPress: { self.loadScene(scene: RulesScene(size: self.size)) } + ) + ) entityManager.add(Background(size: self.size)) - entityManager.add(SpinningLogoEntity(position: CGPoint(x: midX, y: midY + 200))) + entityManager.add(SpinningLogoEntity(sceneSize: self.size)) - if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true { + if SoundManager.sharedInstance.isMusicPlaying == false && SoundManager.sharedInstance.isMusicEnabled == true && !CommandLine.arguments.contains("--no-music") && !UserDefaults.standard.bool(forKey: "noMusic"){ SoundManager.sharedInstance.startMenuMusic() } } @@ -76,6 +89,5 @@ class MenuScene: SKScene { if GameCenterManager.sharedInstance.initIsFinish { self.loadScene(scene: GameCenterManager.sharedInstance.gameScene!) } - } } diff --git a/GoldWars/GoldWars/Scenes/RulesScene.swift b/GoldWars/GoldWars/Scenes/RulesScene.swift new file mode 100644 index 0000000..2c8e064 --- /dev/null +++ b/GoldWars/GoldWars/Scenes/RulesScene.swift @@ -0,0 +1,118 @@ +// +// RulesScene.swift +// GoldWars +// +// Created by Chauntalle Schüle on 18.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import SpriteKit +import GameplayKit + +class RulesScene: SKScene { + + var image: SKSpriteNode? + + override func sceneDidLoad() { + EntityManager.rulesEMInstance.setScene(scene: self) + EntityManager.rulesEMInstance.add( + Button(name: "backToMenuScene", + textureName: "questionmark", + text: "", + position: CGPoint(x: self.size.width - 50, y: self.size.height - 50), + onButtonPress: { + EntityManager.rulesEMInstance.entities.removeAll() + self.view?.presentScene( + MenuScene(size: self.size), + transition: SKTransition.flipVertical(withDuration: 0.5) + ) + } + ) + ) + + EntityManager.rulesEMInstance.add( + Label(fontnamed: "Courier-Bold", + name: "rulesLabel", + text: "Regelwerk", + fontSize: 90, + fontColor: .black, + position: CGPoint(x: self.size.width * 0.5, y: self.size.height - 100), + horizontalAlignmentMode: .center, + vertikalAligmentMode: .baseline, + isAnimationEnabled: true, + isAnimationInfinite: true + ) + ) + + image = SKSpriteNode(imageNamed: "RulesSpiel") + image!.size = CGSize(width: size.width * 0.8, height: size.height * 0.8) + image!.position = CGPoint(x: size.width * 0.6, y: size.height * 0.6 - 150) + image!.zPosition = 4 + + self.addChild(image!) + + EntityManager.rulesEMInstance.add( + Button(name: "Spiel", + textureName: "yellow_button13", + text: "Spiel", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 + 150), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesSpiel") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Basen", + textureName: "yellow_button13", + text: "Basen", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 + 85), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesBasen") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Einheiten", + textureName: "yellow_button13", + text: "Einheiten", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 + 20), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesEinheiten") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Spielende", + textureName: "yellow_button13", + text: "Spielende", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 - 45), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesSpielende") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Boost", + textureName: "yellow_button13", + text: "Boost", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 - 110), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesBoost") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Erfolge", + textureName: "yellow_button13", + text: "Erfolge", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.5 - 175), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "RulesErfolge") } + ) + ) + EntityManager.rulesEMInstance.add( + Button(name: "Credits", + textureName: "yellow_button13", + text: "Credits", + position: CGPoint(x: self.size.width * 0.1, y: self.size.height * 0.1 - 20), + onButtonPress: { self.image!.texture = SKTexture(imageNamed: "Credits") } + ) + ) + EntityManager.rulesEMInstance.add(Background(size: self.size)) + } + + override func update(_ currentTime: TimeInterval) { + if EntityManager.rulesEMInstance.entities.count != 0 { + EntityManager.rulesEMInstance.getBackground()!.update(deltaTime: currentTime) + } + } +} diff --git a/GoldWars/GoldWars/SettingsScene.swift b/GoldWars/GoldWars/Scenes/SettingsScene.swift similarity index 78% rename from GoldWars/GoldWars/SettingsScene.swift rename to GoldWars/GoldWars/Scenes/SettingsScene.swift index 2e0760d..4336046 100644 --- a/GoldWars/GoldWars/SettingsScene.swift +++ b/GoldWars/GoldWars/Scenes/SettingsScene.swift @@ -11,14 +11,17 @@ import SpriteKit class SettingsScene: SKScene { var entityManager = EntityManager.settingsEMInstance + var musicButtonText = "" + var isMusicDeactivatedByUserDefault = UserDefaults.standard.bool(forKey: "noMusic") override func sceneDidLoad() { entityManager.setScene(scene: self) let positionX = self.size.width * 0.1 let positionY = self.size.height * 0.05 + isMusicDeactivatedByUserDefault ? setMusicButtonTextByUserDefault(text: "Aus") : setMusicButtonTextByUserDefault(text: "An") entityManager.add(Button(name: "backToMenuScene", textureName: "yellow_button04", - text: "Back", + text: "Zurück", position: CGPoint(x: positionX, y: positionY), onButtonPress: { let scene = MenuScene(size: self.size) @@ -26,32 +29,36 @@ class SettingsScene: SKScene { })) entityManager.add(Button(name: "StopMenuMusic", textureName: "yellow_button04", - text: "ON/OFF", + text: musicButtonText, position: CGPoint(x: self.size.width * 0.6, y: self.size.height / 2), onButtonPress: { if SoundManager.sharedInstance.isMusicPlaying { SoundManager.sharedInstance.stopMenuMusic() SoundManager.sharedInstance.isMusicEnabled = false + self.entityManager.changeSettingsButtonText(buttonName: "StopMenuMusic", text: "Aus") } else { SoundManager.sharedInstance.isMusicEnabled = true SoundManager.sharedInstance.startMenuMusic() + self.entityManager.changeSettingsButtonText(buttonName: "StopMenuMusic", text: "An") } })) entityManager.add(Button(name: "StopMovingBackground", textureName: "yellow_button04", - text: "MOVE/STOP", + text: "An", position: CGPoint(x: self.size.width * 0.6, y: self.size.height / 2 - 100), onButtonPress: { if BackgroundComponent.isMovingBackgroundEnabled { BackgroundComponent.isMovingBackgroundEnabled = false + self.entityManager.changeSettingsButtonText(buttonName: "StopMovingBackground", text: "Aus") } else { BackgroundComponent.isMovingBackgroundEnabled = true + self.entityManager.changeSettingsButtonText(buttonName: "StopMovingBackground", text: "An") } })) entityManager.add(Label(fontnamed: "Courier-Bold", name: "SettingsLabel", - text: "Settings", - fontSize: 200.0, + text: "Einstellungen", + fontSize: 150.0, fontColor: .black, position: CGPoint(x: self.size.width * 0.5, y: self.size.height * 0.7), horizontalAlignmentMode: .center, @@ -61,7 +68,7 @@ class SettingsScene: SKScene { ) entityManager.add(Label(fontnamed: "Courier-Bold", name: "LabelMusic", - text: "Music", fontSize: 50.0, + text: "Sounds", fontSize: 50.0, fontColor: .black, position: CGPoint(x: self.size.width * 0.5, y: self.size.height / 2 - 15), horizontalAlignmentMode: .right, @@ -71,7 +78,7 @@ class SettingsScene: SKScene { ) entityManager.add(Label(fontnamed: "Courier-Bold", name: "LabelBackground", - text: "Background", + text: "Wind", fontSize: 50.0, fontColor: .black, position: CGPoint(x: self.size.width * 0.5, y: self.size.height / 2 - 115), @@ -83,6 +90,10 @@ class SettingsScene: SKScene { entityManager.add(Background(size: self.size)) } + func setMusicButtonTextByUserDefault(text: String) { + self.musicButtonText = text + } + func loadScene(scene: SKScene) { let transition = SKTransition.flipVertical(withDuration: 0.5) entityManager.entities.removeAll() @@ -94,5 +105,4 @@ class SettingsScene: SKScene { entityManager.getBackground()!.update(deltaTime: currentTime) } } - } diff --git a/GoldWars/GoldWars/DataService.swift b/GoldWars/GoldWars/Services/DataService.swift similarity index 52% rename from GoldWars/GoldWars/DataService.swift rename to GoldWars/GoldWars/Services/DataService.swift index 506478d..ad6202c 100644 --- a/GoldWars/GoldWars/DataService.swift +++ b/GoldWars/GoldWars/Services/DataService.swift @@ -5,44 +5,7 @@ // Created by Tim Herbst on 13.05.20. // Copyright © 2020 SP2. All rights reserved. // - -struct PlayerMove: Codable { - let fromBase: Int - let toBase: Int - var unitCount: Int -} - -struct LocalRoundData: Codable { - var localPlayerMoves: [PlayerMove] - var hasAttackBoost: Bool - var hasDefenceBoost: Bool - - init() { - localPlayerMoves = [] - hasAttackBoost = false - hasDefenceBoost = false - } -} - -class SnapshotModel: Codable { - var baseEntites: [BaseEntityModel] - - init(baseEntites: [BaseEntityModel]) { - self.baseEntites = baseEntites - } -} - -class BaseEntityModel: Codable { - let baseId: Int - var unitCount: Int - var ownership: String? - - init(baseId: Int, unitCount: Int, ownership: String?, hasAttackBoost: Bool, hasDefenceBoost: Bool) { - self.baseId = baseId - self.unitCount = unitCount - self.ownership = ownership - } -} +import Foundation class DataService { static let sharedInstance = DataService() @@ -53,13 +16,13 @@ class DataService { var mapModel: MapGenerationModel? var entityManager = EntityManager.gameEMInstance - + func addMove(playerMove: PlayerMove) { - var equalMove = localRoundData.localPlayerMoves.filter { (ele) -> Bool in - ele.fromBase == playerMove.fromBase && ele.toBase == playerMove.toBase - } - if equalMove.count == 1 { - equalMove[0].unitCount = Int(equalMove[0].unitCount) + Int(playerMove.unitCount) + let equalMoveIdx = localRoundData.localPlayerMoves.firstIndex(where: { (localPlayerMove) -> Bool in + localPlayerMove.toBase == playerMove.toBase && localPlayerMove.fromBase == playerMove.fromBase + }) + if equalMoveIdx != nil { + localRoundData.localPlayerMoves[equalMoveIdx!].unitCount = Int(localRoundData.localPlayerMoves[equalMoveIdx!].unitCount) + Int(playerMove.unitCount) } else { self.localRoundData.localPlayerMoves.append(playerMove) } diff --git a/GoldWars/GoldWars/Services/EloHelper.swift b/GoldWars/GoldWars/Services/EloHelper.swift new file mode 100644 index 0000000..91f3b62 --- /dev/null +++ b/GoldWars/GoldWars/Services/EloHelper.swift @@ -0,0 +1,70 @@ +// +// EloHelper.swift +// GoldWars +// +// Created by Marcel Schwarz on 13.06.20. +// Copyright © 2020 SP2. All rights reserved. +// + +import GameKit +import os + +struct EloDataForPeer : Codable { + let scoreToReport: Int64 +} + +class EloHelper { + + static private let LOG = OSLog.init(subsystem: "EloHelper", category: "EloHelper") + + static let IDENTIFIER_ALL_ELO = "de.hft.stuttgart.ip2.goldwars.bestelo" + static let IDENTIFIER_ELO = "de.hft.stuttgart.ip2.goldwars.matchmaking" + + static func updateEloScore(winner: GKPlayer, hatDenNikoGemacht looser: GKPlayer) { + + let leaderboard = GKLeaderboard.init(players: [winner, looser]) + leaderboard.identifier = EloHelper.IDENTIFIER_ELO + + leaderboard.loadScores{scores, error in + + // Get Scores + let R_looser = scores?.filter { $0.player == looser }.first ?? GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: looser) + let R_winner = scores?.filter { $0.player == winner }.first ?? GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: winner) + + // Calc ELO + let Q_looser = pow(10.0, Double(R_looser.value) / 400.0) + let Q_winner = pow(10.0, Double(R_winner.value) / 400.0) + let E_looser = Q_looser / (Q_looser + Q_winner) + let E_winner = Q_winner / (Q_looser + Q_winner) + + let R_winner_new = Int64(Double(R_winner.value) + 10.0 * (1.0 - E_winner)) + let R_looser_new = Int64(Double(R_looser.value) + 10.0 * (0.0 - E_looser)) + + // Update Elo on leaderboard + let winner_new = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: winner) + winner_new.value = R_winner_new + let looser_new = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: looser) + looser_new.value = R_looser_new + + let scoreForPeer = winner == GameCenterManager.sharedInstance.localPlayer ? looser_new : winner_new + let scoreForHost = winner == GameCenterManager.sharedInstance.localPlayer ? winner_new : looser_new + + MultiplayerNetwork.sharedInstance.sendEloData(scoreToReport: scoreForPeer) + reportScore(score: scoreForHost.value) + } + } + + static func reportScore(score: Int64) { + let gkScoreElo = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ELO, player: GKLocalPlayer.local) + gkScoreElo.value = score + let gkScoreAll = GKScore(leaderboardIdentifier: EloHelper.IDENTIFIER_ALL_ELO, player: GKLocalPlayer.local) + gkScoreAll.value = score + GKScore.report([gkScoreAll, gkScoreElo], withCompletionHandler: { error in + if error != nil { + os_log("Could not report %@", log: LOG, type: .error, error!.localizedDescription) + } else { + os_log("New Scores reported to EloSystem", log: self.LOG, type: .info) + } + }) + } +} diff --git a/GoldWars/GoldWars/GameCenterManager.swift b/GoldWars/GoldWars/Services/GameCenterManager.swift similarity index 83% rename from GoldWars/GoldWars/GameCenterManager.swift rename to GoldWars/GoldWars/Services/GameCenterManager.swift index d10654b..65aec4a 100644 --- a/GoldWars/GoldWars/GameCenterManager.swift +++ b/GoldWars/GoldWars/Services/GameCenterManager.swift @@ -24,12 +24,13 @@ struct State: Codable { // 3 Host hat Spiel gestartet // 4 Peer hat verloren // 5 Peer hat gewonnen + // 6 Peer hat Spiel verlassen let state: Int } -final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKGameCenterControllerDelegate ,GKMatchDelegate,GKLocalPlayerListener{ +final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKGameCenterControllerDelegate, GKMatchDelegate, GKLocalPlayerListener{ - static let sharedInstance = GameCenterManager() + static var sharedInstance = GameCenterManager() let LOG = OSLog.init(subsystem: "GameCenterManager", category: "GameCenterManager") @@ -44,7 +45,11 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG var entityManager = EntityManager.gameEMInstance var localPlayerRandomNumber: RandomNumber? var initIsFinish = false + var gameEnded = false + var winner: String? var gameScene: GameScene? + var quitGame: Bool = false + var opponentQuit: Bool = false static var isAuthenticated: Bool { return GKLocalPlayer.local.isAuthenticated } @@ -56,6 +61,16 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG localPlayerRandomNumber = RandomNumber() } + func reset() { + isMatchStarted = false + isServer = false + localPlayerRandomNumber = RandomNumber() + initIsFinish = false + gameEnded = false + winner = nil + gameScene = nil + } + func authUser() -> Void { GKLocalPlayer.local.authenticateHandler = { gcAuthVC, error in NotificationCenter.default @@ -88,7 +103,6 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG GKAchievement.loadAchievements { (achievements: [GKAchievement]?, err: Error?) in var achievementExists: Bool = false achievements?.forEach({ (achievement: GKAchievement) in - print(achievement.identifier) if achievement.identifier == identifier { achievementExists = true achievement.percentComplete += increasePercentComplete @@ -154,10 +168,16 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG os_log("Spiel startet", log: LOG, type: .info) case 4: os_log("State 4 erhalten, Peer hat verloren", log: LOG, type: .info) - // TODO: Trigger Loser Scene + winner = hostingPlayer?.displayName + gameEnded = true case 5: os_log("State 5 erhalten, Peer hat gewonnen", log: LOG, type: .info) - // TODO: Trigger Winner Scene + winner = peerPlayer?.displayName + gameEnded = true + case 6: + os_log("State 6 erhalten, Peer hat Spiel verlassen ", log: LOG, type: .info) + opponentQuit = true + quitGame = true default: break } @@ -185,9 +205,33 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG initIsFinish = true os_log("Peer startet Spiel", log: LOG, type: .info) } + if let notification = try? jsonDecoder.decode(NotificationModel.self, from: data) { + os_log("Notification erhalten", log: LOG, type: .info) + NotificationCenter.default.post(name: Notification.Name(rawValue: notification.name), object: nil) + } + if let eloData = try? jsonDecoder.decode(EloDataForPeer.self, from: data) { + print("Recieved elo data: \(eloData.scoreToReport)") + EloHelper.reportScore(score: eloData.scoreToReport) + } + if let heartbeat = try? jsonDecoder.decode(Heartbeat.self, from: data) { + entityManager.getHUD()?.roundTimer.isHeartbeatLocked = false + let df = DateFormatter() + df.dateFormat = "yyyy-MM-dd HH:mm:ss" + let dateString = df.string(from: heartbeat.date) + print("Received last Heartbeat at \(dateString)") + } + MultiplayerNetwork.sharedInstance.isSending = false } + func match(_ match: GKMatch, player: GKPlayer, didChange state: GKPlayerConnectionState) { + if myMatch != match { return } + if state == GKPlayerConnectionState.disconnected { + self.opponentQuit = true; + gameScene?.gameQuit() + } + } + func initAndSendMap() -> Void { self.gameScene = GameScene(size: self.menusc!.size) let mapModel = MapFactory(scene: self.gameScene!, entityManager: entityManager).load() @@ -212,6 +256,7 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG } return nilGK } + func sendStateToPeers(state: State){ let encoder = JSONEncoder() let encoded = (try? encoder.encode(state))! @@ -230,6 +275,7 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG matchmakerVC!.matchmakerDelegate = self viewController?.present(matchmakerVC!, animated: true, completion: nil) } + func matchmakerViewControllerWasCancelled(_ viewController: GKMatchmakerViewController) { viewController.dismiss(animated: true, completion: nil) } @@ -260,6 +306,5 @@ final class GameCenterManager: NSObject, GKMatchmakerViewControllerDelegate, GKG } extension Notification.Name { - static let presentGame = Notification.Name(rawValue: "presentGame") static let authenticationChanged = Notification.Name(rawValue: "authenticationChanged") } diff --git a/GoldWars/GoldWars/MultiplayerNetwork.swift b/GoldWars/GoldWars/Services/MultiplayerNetwork.swift similarity index 56% rename from GoldWars/GoldWars/MultiplayerNetwork.swift rename to GoldWars/GoldWars/Services/MultiplayerNetwork.swift index aaac30d..a55914a 100644 --- a/GoldWars/GoldWars/MultiplayerNetwork.swift +++ b/GoldWars/GoldWars/Services/MultiplayerNetwork.swift @@ -9,36 +9,39 @@ import GameplayKit import Foundation import GameKit +import os -class MultiplayerNetwork{ +class MultiplayerNetwork { + static let sharedInstance = MultiplayerNetwork() + let LOG = OSLog.init(subsystem: "MultiplayerNetwork", category: "MultiplayerNetwork") + var isSending = false - func sendData(data: Data) { - let mmHelper = GameCenterManager.sharedInstance - if let multiplayerMatch = mmHelper.myMatch { - do { - try multiplayerMatch.sendData(toAllPlayers: data, with: .reliable) - } catch { - } - } - } + func sendData(data: Data) { + let mmHelper = GameCenterManager.sharedInstance + if let multiplayerMatch = mmHelper.myMatch { + do { + try multiplayerMatch.sendData(toAllPlayers: data, with: .reliable) + } catch { + os_log("Could not send data to desired Player", log: LOG, type: .error) + } + } + } func sendDataToHost(data: Data) { - if let multiplayerMatch = GameCenterManager.sharedInstance.myMatch{ do { try multiplayerMatch.send(data, to: [GameCenterManager.sharedInstance.hostingPlayer!], dataMode: .reliable) } catch { - //TODO: Add logging + os_log("Could not send data to Host", log: LOG, type: .error) } } } func sendPlayerMoves(localRoundData: LocalRoundData) { if GameCenterManager.sharedInstance.isServer == false { - print("I am client") self.isSending = true let encoder = JSONEncoder() let encoded = (try? encoder.encode(localRoundData))! @@ -61,4 +64,21 @@ class MultiplayerNetwork{ sendData(data: encoded) } + func sendEloData(scoreToReport: GKScore) { + let encoder = JSONEncoder() + let encoded = (try? encoder.encode(EloDataForPeer(scoreToReport: scoreToReport.value)))! + sendData(data: encoded) + } + + func sendNotificationToPlayer(name: String) { + let encoder = JSONEncoder() + let encoded = (try? encoder.encode(NotificationModel(name: name)))! + sendData(data: encoded) + } + + func sendHeartbeatToPlayer() { + let encoder = JSONEncoder() + let encoded = (try? encoder.encode(Heartbeat(date: Date())))! + sendData(data: encoded) + } } diff --git a/GoldWars/GoldWars/RoundCalculatorService.swift b/GoldWars/GoldWars/Services/RoundCalculatorService.swift similarity index 80% rename from GoldWars/GoldWars/RoundCalculatorService.swift rename to GoldWars/GoldWars/Services/RoundCalculatorService.swift index 95f0c72..2190ad1 100644 --- a/GoldWars/GoldWars/RoundCalculatorService.swift +++ b/GoldWars/GoldWars/Services/RoundCalculatorService.swift @@ -15,25 +15,24 @@ class RoundCalculatorService { static let LOG = OSLog.init(subsystem: "Round Calculator", category: "RoundCalculatorService") var allPlayerMoves: [String: [PlayerMove]] = [:] - // TODO: Better data structure var boosts: [String: (Bool, Bool)] = [:] // First bool is atk boost, second is def boost let ATK_BOOST_MULTIPLICATOR = 1.1 let DEF_BOOST_MULTIPLICATOR = 1.1 let MAX_ROUNDS = 20 var currentRound = 1 - var isCalculating = false var numberOfAttacks = 0 var numberOfOwnUnitMoves = 0 + var isCalculating = false func calculateRound() { os_log("Started calculating Round", log: RoundCalculatorService.LOG, type: .info) isCalculating = true let currentSnapshotModel = DataService.sharedInstance.snapshotModel - var baseSpecificMoves = collectBaseSpecificMoves() - - // TODO: Refactor to a less complex way + + os_log("Solving transaction moves", log: RoundCalculatorService.LOG, type: .info) + os_log("Removing attacking forces", log: RoundCalculatorService.LOG, type: .info) for (baseId, playerMovesByBase) in baseSpecificMoves { let targetBase = currentSnapshotModel?.baseEntites.filter { $0.baseId == baseId }[0] let possiblyOwnershipMoves = playerMovesByBase.filter { $0.key == targetBase?.ownership} @@ -63,6 +62,7 @@ class RoundCalculatorService { } } + os_log("Calculate attacking moves", log: RoundCalculatorService.LOG, type: .info) for (baseId, playerMovesByBase) in baseSpecificMoves { var combinePotentionalForces: [String: PlayerMove] = [:] @@ -79,7 +79,6 @@ class RoundCalculatorService { if combinePotentionalForces.count > 0 { let sortedPotentionalCombinedForces = combinePotentionalForces.sorted { $0.1.unitCount > $1.1.unitCount } - var playerMoveWithMaxUnits = sortedPotentionalCombinedForces[0] if playerMovesByBase.count >= 2 { @@ -124,6 +123,7 @@ class RoundCalculatorService { } baseSpecificMoves.removeValue(forKey: baseId) } + os_log("Adding unitgrowth", log: RoundCalculatorService.LOG, type: .info) var player1BaseCount = 0; var player2BaseCount = 0; let player1 = GameCenterManager.sharedInstance.hostingPlayer?.displayName @@ -143,6 +143,7 @@ class RoundCalculatorService { } return BaseEntityModel } + os_log("Validate if game ending criteria is reached", log: RoundCalculatorService.LOG, type: .info) allPlayerMoves.removeAll() DataService.sharedInstance.localRoundData.localPlayerMoves.removeAll() DataService.sharedInstance.localRoundData.hasAttackBoost = false @@ -158,14 +159,25 @@ class RoundCalculatorService { winner = determineWinner(by: "capture") } winner == GameCenterManager.sharedInstance.hostingPlayer?.displayName ? GameCenterManager.sharedInstance.sendStateToPeers(state: State(state: 4)) : GameCenterManager.sharedInstance.sendStateToPeers(state: State(state: 5)) - //TODO: Trigger Winner/Loser-Scene for Server + GameCenterManager.sharedInstance.winner = winner + GameCenterManager.sharedInstance.gameEnded = true + + // Update EloSystem + if winner == GameCenterManager.sharedInstance.hostingPlayer?.displayName { + EloHelper.updateEloScore(winner: GameCenterManager.sharedInstance.hostingPlayer!, hatDenNikoGemacht: GameCenterManager.sharedInstance.peerPlayer!) + } else { + EloHelper.updateEloScore(winner: GameCenterManager.sharedInstance.peerPlayer!, hatDenNikoGemacht: GameCenterManager.sharedInstance.hostingPlayer!) + } + return } currentRound += 1 entityManager.getHUD()?.setCurrentRound(round: currentRound) + os_log("Sending snapshotmodel to player", log: RoundCalculatorService.LOG, type: .info) MultiplayerNetwork.sharedInstance.sendSnapshotModelToPlayers() DataService.sharedInstance.snapshotModel = currentSnapshotModel + os_log("Updating entities", log: RoundCalculatorService.LOG, type: .info) entityManager.updateSnapshotModel(snapshotModel: currentSnapshotModel!) entityManager.getHUD()?.startWithDuration() os_log("Finished calculating Round", log: RoundCalculatorService.LOG, type: .info) @@ -175,7 +187,6 @@ class RoundCalculatorService { for playerMove in DataService.sharedInstance.remotePlayerMoves { allPlayerMoves[playerMove.key] = playerMove.value.localPlayerMoves } - boosts[GameCenterManager.sharedInstance.hostingPlayer!.displayName] = ( DataService.sharedInstance.localRoundData.hasAttackBoost, DataService.sharedInstance.localRoundData.hasDefenceBoost @@ -206,10 +217,6 @@ class RoundCalculatorService { return baseSpecificMoves } - func resolvePlayerMove(playerMove: PlayerMove, unitCount: Int, ownership: String?, resolveType: String) { - //TODO: outsource playermoves - } - func resetNumberOfAttacksAndFormats() { self.numberOfAttacks = 0; self.numberOfOwnUnitMoves = 0; @@ -234,20 +241,20 @@ class RoundCalculatorService { func determineWinner(by criteria: String) -> String { var winner: String? switch criteria { - case "rounds": - let peerPlayerBasesCount = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.peerPlayer!).count - let hostingPlayerBasesCount = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.hostingPlayer!).count - if peerPlayerBasesCount == hostingPlayerBasesCount { - let hostingPlayerUnitCount = entityManager.getUnitSum(by: GameCenterManager.sharedInstance.hostingPlayer!) - let peerPlayerUnitCount = entityManager.getUnitSum(by: GameCenterManager.sharedInstance.peerPlayer!) - winner = hostingPlayerUnitCount > peerPlayerUnitCount ? GameCenterManager.sharedInstance.hostingPlayer?.displayName : GameCenterManager.sharedInstance.peerPlayer?.displayName - } else { - winner = hostingPlayerBasesCount > peerPlayerBasesCount ? GameCenterManager.sharedInstance.hostingPlayer?.displayName : GameCenterManager.sharedInstance.peerPlayer?.displayName - } - case "capture": - winner = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.hostingPlayer!).count == 0 ? GameCenterManager.sharedInstance.peerPlayer?.displayName : GameCenterManager.sharedInstance.hostingPlayer?.displayName - default: - break + case "rounds": + let peerPlayerBasesCount = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.peerPlayer!).count + let hostingPlayerBasesCount = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.hostingPlayer!).count + if peerPlayerBasesCount == hostingPlayerBasesCount { + let hostingPlayerUnitCount = entityManager.getUnitSum(by: GameCenterManager.sharedInstance.hostingPlayer!) + let peerPlayerUnitCount = entityManager.getUnitSum(by: GameCenterManager.sharedInstance.peerPlayer!) + winner = hostingPlayerUnitCount > peerPlayerUnitCount ? GameCenterManager.sharedInstance.hostingPlayer?.displayName : GameCenterManager.sharedInstance.peerPlayer?.displayName + } else { + winner = hostingPlayerBasesCount > peerPlayerBasesCount ? GameCenterManager.sharedInstance.hostingPlayer?.displayName : GameCenterManager.sharedInstance.peerPlayer?.displayName + } + case "capture": + winner = entityManager.getBasesByPlayer(for: GameCenterManager.sharedInstance.hostingPlayer!).count == 0 ? GameCenterManager.sharedInstance.peerPlayer?.displayName : GameCenterManager.sharedInstance.hostingPlayer?.displayName + default: + break } return winner! } diff --git a/GoldWars/GoldWars/RoundTimer.swift b/GoldWars/GoldWars/Services/RoundTimer.swift similarity index 65% rename from GoldWars/GoldWars/RoundTimer.swift rename to GoldWars/GoldWars/Services/RoundTimer.swift index 8f27a60..09b25d7 100644 --- a/GoldWars/GoldWars/RoundTimer.swift +++ b/GoldWars/GoldWars/Services/RoundTimer.swift @@ -12,6 +12,7 @@ class RoundTimer: Timer { var timer: Timer? var timeLeft: Int = 0 + var isHeartbeatLocked = false var calculate = false var roundEnded = "Syncing" @@ -29,27 +30,49 @@ class RoundTimer: Timer { timeLeft = 30 } + func stopTimer() { + guard timer != nil else { return } + timer?.invalidate() + timer = nil + } + + func resumeTimer() { + timer = Timer.scheduledTimer( + timeInterval: 1.0, + target: self, + selector: #selector(onTimerFires), + userInfo: nil, + repeats: true + ) + } + @objc func onTimerFires() { timeLeft -= 1 - EntityManager.gameEMInstance.updateTime(time: (timeLeft > 0 ? String(timeLeft) : roundEnded)) if timeLeft == 0 { + EntityManager.gameEMInstance.removeModal() RoundCalculatorService.sharedInstance.resetNumberOfAttacksAndFormats() if !MultiplayerNetwork.sharedInstance.isSending { MultiplayerNetwork.sharedInstance.sendPlayerMoves(localRoundData: DataService.sharedInstance.localRoundData) } calculate = true } + if timeLeft <= 0 { if calculate && !RoundCalculatorService.sharedInstance.isCalculating && DataService.sharedInstance.didReceiveAllData() && GameCenterManager.sharedInstance.isServer { - RoundCalculatorService.sharedInstance.calculateRound() - calculate = false + RoundCalculatorService.sharedInstance.calculateRound() + calculate = false } } + + if (!isHeartbeatLocked && (timeLeft % 7 == 0)) { + MultiplayerNetwork.sharedInstance.sendHeartbeatToPlayer() + isHeartbeatLocked = true; + } } } diff --git a/GoldWars/GoldWars/SoundManager.swift b/GoldWars/GoldWars/Services/SoundManager.swift similarity index 54% rename from GoldWars/GoldWars/SoundManager.swift rename to GoldWars/GoldWars/Services/SoundManager.swift index b6cb5d4..e780252 100644 --- a/GoldWars/GoldWars/SoundManager.swift +++ b/GoldWars/GoldWars/Services/SoundManager.swift @@ -8,12 +8,17 @@ import SpriteKit import AVFoundation +import os class SoundManager { + public static var sharedInstance = SoundManager() + let LOG = OSLog.init(subsystem: "SoundManager", category: "SoundManager") var audioPlayer = AVAudioPlayer() + var effectPlayer = AVAudioPlayer() var backgroundMainMenuAudio: URL? + var soundEffect: URL? var isMusicPlaying = false var isMusicEnabled = true @@ -23,18 +28,34 @@ class SoundManager { do { audioPlayer = try AVAudioPlayer(contentsOf: backgroundMainMenuAudio!) } catch { - //TODO: Add logging + os_log("backgroundMusic is broken", log: LOG, type: .error) } audioPlayer.numberOfLoops = -1 audioPlayer.prepareToPlay() if self.isMusicEnabled == true { audioPlayer.play() + UserDefaults.standard.set(false, forKey: "noMusic") + } + } + + func playSoundEffect(pathToFile: String, fileExtension: String, volumeLevel: Float){ + soundEffect = Bundle.main.url(forResource: pathToFile, withExtension: fileExtension) + do { + effectPlayer = try AVAudioPlayer(contentsOf: soundEffect!) + } catch { + os_log("Could not load sound file %@", log: LOG, type: .error, pathToFile) + } + effectPlayer.volume += volumeLevel + effectPlayer.prepareToPlay() + if self.isMusicEnabled == true { + effectPlayer.play() } } func stopMenuMusic() { audioPlayer.pause() self.isMusicPlaying = false + UserDefaults.standard.set(true, forKey: "noMusic") } func setVolume(_ volume: Float) {