diff --git a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj index b2dce8c..ce28cde 100644 --- a/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj +++ b/DouShouQi_App/DouShouQi_App.xcodeproj/project.pbxproj @@ -66,6 +66,9 @@ ECB636532C0463A9007CD5E2 /* SoundPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */; }; ECB636552C047992007CD5E2 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB636542C047992007CD5E2 /* Image.xcassets */; }; ECE777142C2068F400D354B0 /* EditPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE777132C2068F400D354B0 /* EditPlayerView.swift */; }; + ECF3FD242C25B83000F5E62B /* SelectFighterSound.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = ECF3FD232C25B83000F5E62B /* SelectFighterSound.mp3 */; }; + ECF3FD262C25BDCF00F5E62B /* Start.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = ECF3FD252C25BDCF00F5E62B /* Start.mp3 */; }; + ECF3FD282C25C83100F5E62B /* Fight.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = ECF3FD272C25C83100F5E62B /* Fight.mp3 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -83,6 +86,13 @@ remoteGlobalIDString = 645834572BF5F92300E18321; remoteInfo = DouShouQi_App; }; + ECF3FD212C2582B300F5E62B /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = ECF3FD0A2C2582B200F5E62B; + remoteInfo = ArKit; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -149,6 +159,10 @@ ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundPlayer.swift; sourceTree = ""; }; ECB636542C047992007CD5E2 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = ""; }; ECE777132C2068F400D354B0 /* EditPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditPlayerView.swift; sourceTree = ""; }; + ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ArKit.xcodeproj; path = ../../Swift/ArKit/ArKit.xcodeproj; sourceTree = ""; }; + ECF3FD232C25B83000F5E62B /* SelectFighterSound.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = SelectFighterSound.mp3; path = ../../../../../../Downloads/SelectFighterSound.mp3; sourceTree = ""; }; + ECF3FD252C25BDCF00F5E62B /* Start.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Start.mp3; path = ../../../../../../Downloads/Start.mp3; sourceTree = ""; }; + ECF3FD272C25C83100F5E62B /* Fight.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Fight.mp3; path = ../../../../../../Downloads/Fight.mp3; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -184,6 +198,7 @@ 6458344F2BF5F92300E18321 = { isa = PBXGroup; children = ( + ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */, 6458345A2BF5F92300E18321 /* DouShouQi_App */, 6458346B2BF5F92600E18321 /* DouShouQi_AppTests */, 645834752BF5F92600E18321 /* DouShouQi_AppUITests */, @@ -412,6 +427,9 @@ EC62C5032C045BD30048CD0B /* Sounds */ = { isa = PBXGroup; children = ( + ECF3FD272C25C83100F5E62B /* Fight.mp3 */, + ECF3FD252C25BDCF00F5E62B /* Start.mp3 */, + ECF3FD232C25B83000F5E62B /* SelectFighterSound.mp3 */, EC62C50C2C046D9E0048CD0B /* SplashScreenSound.mp3 */, EC62C5052C045C1A0048CD0B /* TitleScreenButtonSound.mp3 */, ); @@ -472,6 +490,14 @@ path = CoreData; sourceTree = ""; }; + ECF3FD1E2C2582B300F5E62B /* Products */ = { + isa = PBXGroup; + children = ( + ECF3FD222C2582B300F5E62B /* ArKit.app */, + ); + name = Products; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -560,6 +586,12 @@ mainGroup = 6458344F2BF5F92300E18321; productRefGroup = 645834592BF5F92300E18321 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = ECF3FD1E2C2582B300F5E62B /* Products */; + ProjectRef = ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 645834572BF5F92300E18321 /* DouShouQi_App */, @@ -569,6 +601,16 @@ }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + ECF3FD222C2582B300F5E62B /* ArKit.app */ = { + isa = PBXReferenceProxy; + fileType = wrapper.application; + path = ArKit.app; + remoteRef = ECF3FD212C2582B300F5E62B /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 645834562BF5F92300E18321 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -579,8 +621,11 @@ 6493C1C02C046BF900B5121D /* samurai.ttf in Resources */, EC62C5062C045C1A0048CD0B /* TitleScreenButtonSound.mp3 in Resources */, EC62C5172C0620C00048CD0B /* rap.mp3 in Resources */, + ECF3FD262C25BDCF00F5E62B /* Start.mp3 in Resources */, EC62C50D2C046D9E0048CD0B /* SplashScreenSound.mp3 in Resources */, 645834632BF5F92500E18321 /* Preview Assets.xcassets in Resources */, + ECF3FD282C25C83100F5E62B /* Fight.mp3 in Resources */, + ECF3FD242C25B83000F5E62B /* SelectFighterSound.mp3 in Resources */, 645834602BF5F92500E18321 /* Assets.xcassets in Resources */, ECB636552C047992007CD5E2 /* Image.xcassets in Resources */, EC62C4FF2C0457AD0048CD0B /* TitleScreenMusic.mp3 in Resources */, diff --git a/DouShouQi_App/DouShouQi_App/Views/Game/GameView.swift b/DouShouQi_App/DouShouQi_App/Views/Game/GameView.swift index 45ad8f4..23f94be 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Game/GameView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Game/GameView.swift @@ -9,18 +9,25 @@ import SwiftUI import SpriteKit struct GameView: View { - var gameScene : GameScene = GameScene(size: CGSize(width: 700, height: 900)) + var gameScene: GameScene = GameScene(size: CGSize(width: 700, height: 900)) var body: some View { VStack { TopGameBoard().frame(maxHeight: 200) SpriteView(scene: gameScene) } .onAppear { - MusicPlayer.shared.playBackgroundMusic(music: "GameMusic") + playSound(named: "Fight") + + //MusicPlayer.shared.playBackgroundMusic(music: "GameMusic") + + DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) { + MusicPlayer.shared.playBackgroundMusic(music: "GameMusic") + } } .onDisappear { MusicPlayer.shared.stopBackgroundMusic() } + .navigationBarHidden(true) // Hide the navigation bar } } diff --git a/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift b/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift index 2642ee8..9efa0c5 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift @@ -38,7 +38,7 @@ struct MainMenuView: View { HStack { VStack(spacing: 25) { MainMenuButton(text: "Play", destination: SelectPlayerView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) - //MainMenuButton(text: "Historique", destination: HistoricView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) + MainMenuButton(text: "Historique", destination: HistoricView(historicVM: HistoricVM()), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) MainMenuButton(text: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) MainMenuButton(text: "Players", destination: PlayersView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) MainMenuButton(text: "Settings", destination: SettingsView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) diff --git a/DouShouQi_App/DouShouQi_App/Views/Player/SelectPlayerView.swift b/DouShouQi_App/DouShouQi_App/Views/Player/SelectPlayerView.swift index 11a2f6d..bd8f41a 100644 --- a/DouShouQi_App/DouShouQi_App/Views/Player/SelectPlayerView.swift +++ b/DouShouQi_App/DouShouQi_App/Views/Player/SelectPlayerView.swift @@ -15,20 +15,32 @@ struct SelectPlayerView: View { Spacer() - // SelectPlayerButtonView() - + SelectPlayerButtonView() + Spacer() HStack { VStack(alignment: .trailing) { - MainMenuButton(text: "Start", destination: GameView(), sound: "TitleScreenButtonSound", horizontalAlignment: .trailing, topLeftCorner: 10, bottomLeftCorner: 10) + MainMenuButton(text: "Start", destination: GameView(), sound: "Start", horizontalAlignment: .trailing, topLeftCorner: 10, bottomLeftCorner: 10) MainMenuButton(text: "Settings", destination: ContentView(), sound: "TitleScreenButtonSound", horizontalAlignment: .trailing, topLeftCorner: 10, bottomLeftCorner: 10) } } Spacer() } + .onAppear { + playSound(named: "SelectFighterSound") + + //MusicPlayer.shared.playBackgroundMusic(music: "GameMusic") + + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + MusicPlayer.shared.playBackgroundMusic(music: "TitleScreenMusic") + } + } + .onDisappear { + MusicPlayer.shared.stopBackgroundMusic() + } } }