Merge branch 'Ar_kit'

Conflicts:
	DouShouQi_App/DouShouQi_App/Views/Menu/MainMenuView.swift
	DouShouQi_App/DouShouQi_App/Views/Player/SelectPlayerView.swift
dev_save_game
Rayhân HASSOU 10 months ago
commit 81a6d20a10

@ -66,6 +66,9 @@
ECB636532C0463A9007CD5E2 /* SoundPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */; }; ECB636532C0463A9007CD5E2 /* SoundPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */; };
ECB636552C047992007CD5E2 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB636542C047992007CD5E2 /* Image.xcassets */; }; ECB636552C047992007CD5E2 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = ECB636542C047992007CD5E2 /* Image.xcassets */; };
ECE777142C2068F400D354B0 /* EditPlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECE777132C2068F400D354B0 /* EditPlayerView.swift */; }; 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 */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
@ -83,6 +86,13 @@
remoteGlobalIDString = 645834572BF5F92300E18321; remoteGlobalIDString = 645834572BF5F92300E18321;
remoteInfo = DouShouQi_App; remoteInfo = DouShouQi_App;
}; };
ECF3FD212C2582B300F5E62B /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = ECF3FD0A2C2582B200F5E62B;
remoteInfo = ArKit;
};
/* End PBXContainerItemProxy section */ /* End PBXContainerItemProxy section */
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
@ -149,6 +159,10 @@
ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundPlayer.swift; sourceTree = "<group>"; }; ECB636522C0463A9007CD5E2 /* SoundPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SoundPlayer.swift; sourceTree = "<group>"; };
ECB636542C047992007CD5E2 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; }; ECB636542C047992007CD5E2 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
ECE777132C2068F400D354B0 /* EditPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditPlayerView.swift; sourceTree = "<group>"; }; ECE777132C2068F400D354B0 /* EditPlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditPlayerView.swift; sourceTree = "<group>"; };
ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = ArKit.xcodeproj; path = ../../Swift/ArKit/ArKit.xcodeproj; sourceTree = "<group>"; };
ECF3FD232C25B83000F5E62B /* SelectFighterSound.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = SelectFighterSound.mp3; path = ../../../../../../Downloads/SelectFighterSound.mp3; sourceTree = "<group>"; };
ECF3FD252C25BDCF00F5E62B /* Start.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Start.mp3; path = ../../../../../../Downloads/Start.mp3; sourceTree = "<group>"; };
ECF3FD272C25C83100F5E62B /* Fight.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; name = Fight.mp3; path = ../../../../../../Downloads/Fight.mp3; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
@ -184,6 +198,7 @@
6458344F2BF5F92300E18321 = { 6458344F2BF5F92300E18321 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */,
6458345A2BF5F92300E18321 /* DouShouQi_App */, 6458345A2BF5F92300E18321 /* DouShouQi_App */,
6458346B2BF5F92600E18321 /* DouShouQi_AppTests */, 6458346B2BF5F92600E18321 /* DouShouQi_AppTests */,
645834752BF5F92600E18321 /* DouShouQi_AppUITests */, 645834752BF5F92600E18321 /* DouShouQi_AppUITests */,
@ -412,6 +427,9 @@
EC62C5032C045BD30048CD0B /* Sounds */ = { EC62C5032C045BD30048CD0B /* Sounds */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
ECF3FD272C25C83100F5E62B /* Fight.mp3 */,
ECF3FD252C25BDCF00F5E62B /* Start.mp3 */,
ECF3FD232C25B83000F5E62B /* SelectFighterSound.mp3 */,
EC62C50C2C046D9E0048CD0B /* SplashScreenSound.mp3 */, EC62C50C2C046D9E0048CD0B /* SplashScreenSound.mp3 */,
EC62C5052C045C1A0048CD0B /* TitleScreenButtonSound.mp3 */, EC62C5052C045C1A0048CD0B /* TitleScreenButtonSound.mp3 */,
); );
@ -472,6 +490,14 @@
path = CoreData; path = CoreData;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
ECF3FD1E2C2582B300F5E62B /* Products */ = {
isa = PBXGroup;
children = (
ECF3FD222C2582B300F5E62B /* ArKit.app */,
);
name = Products;
sourceTree = "<group>";
};
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
@ -560,6 +586,12 @@
mainGroup = 6458344F2BF5F92300E18321; mainGroup = 6458344F2BF5F92300E18321;
productRefGroup = 645834592BF5F92300E18321 /* Products */; productRefGroup = 645834592BF5F92300E18321 /* Products */;
projectDirPath = ""; projectDirPath = "";
projectReferences = (
{
ProductGroup = ECF3FD1E2C2582B300F5E62B /* Products */;
ProjectRef = ECF3FD1D2C2582B300F5E62B /* ArKit.xcodeproj */;
},
);
projectRoot = ""; projectRoot = "";
targets = ( targets = (
645834572BF5F92300E18321 /* DouShouQi_App */, 645834572BF5F92300E18321 /* DouShouQi_App */,
@ -569,6 +601,16 @@
}; };
/* End PBXProject section */ /* 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 */ /* Begin PBXResourcesBuildPhase section */
645834562BF5F92300E18321 /* Resources */ = { 645834562BF5F92300E18321 /* Resources */ = {
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
@ -579,8 +621,11 @@
6493C1C02C046BF900B5121D /* samurai.ttf in Resources */, 6493C1C02C046BF900B5121D /* samurai.ttf in Resources */,
EC62C5062C045C1A0048CD0B /* TitleScreenButtonSound.mp3 in Resources */, EC62C5062C045C1A0048CD0B /* TitleScreenButtonSound.mp3 in Resources */,
EC62C5172C0620C00048CD0B /* rap.mp3 in Resources */, EC62C5172C0620C00048CD0B /* rap.mp3 in Resources */,
ECF3FD262C25BDCF00F5E62B /* Start.mp3 in Resources */,
EC62C50D2C046D9E0048CD0B /* SplashScreenSound.mp3 in Resources */, EC62C50D2C046D9E0048CD0B /* SplashScreenSound.mp3 in Resources */,
645834632BF5F92500E18321 /* Preview Assets.xcassets in Resources */, 645834632BF5F92500E18321 /* Preview Assets.xcassets in Resources */,
ECF3FD282C25C83100F5E62B /* Fight.mp3 in Resources */,
ECF3FD242C25B83000F5E62B /* SelectFighterSound.mp3 in Resources */,
645834602BF5F92500E18321 /* Assets.xcassets in Resources */, 645834602BF5F92500E18321 /* Assets.xcassets in Resources */,
ECB636552C047992007CD5E2 /* Image.xcassets in Resources */, ECB636552C047992007CD5E2 /* Image.xcassets in Resources */,
EC62C4FF2C0457AD0048CD0B /* TitleScreenMusic.mp3 in Resources */, EC62C4FF2C0457AD0048CD0B /* TitleScreenMusic.mp3 in Resources */,

@ -9,18 +9,25 @@ import SwiftUI
import SpriteKit import SpriteKit
struct GameView: View { 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 { var body: some View {
VStack { VStack {
TopGameBoard().frame(maxHeight: 200) TopGameBoard().frame(maxHeight: 200)
SpriteView(scene: gameScene) SpriteView(scene: gameScene)
} }
.onAppear { .onAppear {
playSound(named: "Fight")
//MusicPlayer.shared.playBackgroundMusic(music: "GameMusic")
DispatchQueue.main.asyncAfter(deadline: .now() + 0.7) {
MusicPlayer.shared.playBackgroundMusic(music: "GameMusic") MusicPlayer.shared.playBackgroundMusic(music: "GameMusic")
} }
}
.onDisappear { .onDisappear {
MusicPlayer.shared.stopBackgroundMusic() MusicPlayer.shared.stopBackgroundMusic()
} }
.navigationBarHidden(true) // Hide the navigation bar
} }
} }

@ -38,7 +38,7 @@ struct MainMenuView: View {
HStack { HStack {
VStack(spacing: 25) { VStack(spacing: 25) {
MainMenuButton(text: "Play", destination: SelectPlayerView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10) 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: "Best Scores", destination: ScoreBoardView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)
MainMenuButton(text: "Players", destination: PlayersView(), 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) MainMenuButton(text: "Settings", destination: SettingsView(), sound: "TitleScreenButtonSound", topRightCorner: 10, bottomRightCorner: 10)

@ -15,20 +15,32 @@ struct SelectPlayerView: View {
Spacer() Spacer()
// SelectPlayerButtonView() SelectPlayerButtonView()
Spacer() Spacer()
HStack { HStack {
VStack(alignment: .trailing) 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) MainMenuButton(text: "Settings", destination: ContentView(), sound: "TitleScreenButtonSound", horizontalAlignment: .trailing, topLeftCorner: 10, bottomLeftCorner: 10)
} }
} }
Spacer() 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()
}
} }
} }

Loading…
Cancel
Save