我的第三次提交

This commit is contained in:
liu
2021-10-17 13:32:45 +08:00
parent b92968f349
commit 1d1869d3a7
1314 changed files with 19477 additions and 0 deletions

View File

@@ -0,0 +1,413 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 50;
objects = {
/* Begin PBXBuildFile section */
1F1F4C3825F8EF7B00AA1528 /* LogoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1F4C3725F8EF7B00AA1528 /* LogoView.swift */; };
1F1F4C3C25F8F15B00AA1528 /* Modifiers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F1F4C3B25F8F15B00AA1528 /* Modifiers.swift */; };
1F22DBC725F978DE000D1514 /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F22DBC625F978DE000D1514 /* Extensions.swift */; };
1F402B3D25F47BF5009A3F10 /* FruitMachineApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F402B3C25F47BF5009A3F10 /* FruitMachineApp.swift */; };
1F402B3F25F47BF5009A3F10 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F402B3E25F47BF5009A3F10 /* ContentView.swift */; };
1F402B4125F47BF6009A3F10 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F402B4025F47BF6009A3F10 /* Assets.xcassets */; };
1F402B4425F47BF6009A3F10 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1F402B4325F47BF6009A3F10 /* Preview Assets.xcassets */; };
1F8B888526042A6B008FBB09 /* PlaySound.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F8B888426042A6B008FBB09 /* PlaySound.swift */; };
1F8B8888260435C7008FBB09 /* spin.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B8887260435C7008FBB09 /* spin.mp3 */; };
1F8B888B26043702008FBB09 /* win.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B888A26043702008FBB09 /* win.mp3 */; };
1F8B888F26044C1F008FBB09 /* high-score.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B888E26044C1F008FBB09 /* high-score.mp3 */; };
1F8B889226045071008FBB09 /* change.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B889126045071008FBB09 /* change.mp3 */; };
1F8B889526045200008FBB09 /* game-over.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B889426045200008FBB09 /* game-over.mp3 */; };
1F8B88982604539A008FBB09 /* reset.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B88972604539A008FBB09 /* reset.mp3 */; };
1F8B889B26046650008FBB09 /* background.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 1F8B889A26046650008FBB09 /* background.mp3 */; };
1F901B7D25FB2AFC00F14270 /* InfoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1F901B7C25FB2AFC00F14270 /* InfoView.swift */; };
1FE24BE625F9D4B20053E3E7 /* ReelView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE24BE525F9D4B20053E3E7 /* ReelView.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
1F1F4C3725F8EF7B00AA1528 /* LogoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LogoView.swift; sourceTree = "<group>"; };
1F1F4C3B25F8F15B00AA1528 /* Modifiers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Modifiers.swift; sourceTree = "<group>"; };
1F22DBC625F978DE000D1514 /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
1F402B3925F47BF5009A3F10 /* FruitMachine.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FruitMachine.app; sourceTree = BUILT_PRODUCTS_DIR; };
1F402B3C25F47BF5009A3F10 /* FruitMachineApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FruitMachineApp.swift; sourceTree = "<group>"; };
1F402B3E25F47BF5009A3F10 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
1F402B4025F47BF6009A3F10 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
1F402B4325F47BF6009A3F10 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
1F402B4525F47BF6009A3F10 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
1F8B888426042A6B008FBB09 /* PlaySound.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaySound.swift; sourceTree = "<group>"; };
1F8B8887260435C7008FBB09 /* spin.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = spin.mp3; sourceTree = "<group>"; };
1F8B888A26043702008FBB09 /* win.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = win.mp3; sourceTree = "<group>"; };
1F8B888E26044C1F008FBB09 /* high-score.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "high-score.mp3"; sourceTree = "<group>"; };
1F8B889126045071008FBB09 /* change.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = change.mp3; sourceTree = "<group>"; };
1F8B889426045200008FBB09 /* game-over.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = "game-over.mp3"; sourceTree = "<group>"; };
1F8B88972604539A008FBB09 /* reset.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = reset.mp3; sourceTree = "<group>"; };
1F8B889A26046650008FBB09 /* background.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = background.mp3; sourceTree = "<group>"; };
1F901B7C25FB2AFC00F14270 /* InfoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoView.swift; sourceTree = "<group>"; };
1FE24BE525F9D4B20053E3E7 /* ReelView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReelView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
1F402B3625F47BF5009A3F10 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
1F1F4C3A25F8F12D00AA1528 /* Helpers */ = {
isa = PBXGroup;
children = (
1F1F4C3B25F8F15B00AA1528 /* Modifiers.swift */,
1F22DBC625F978DE000D1514 /* Extensions.swift */,
1F8B888426042A6B008FBB09 /* PlaySound.swift */,
);
path = Helpers;
sourceTree = "<group>";
};
1F33AC8B25F86D2C00DEF3CC /* Views */ = {
isa = PBXGroup;
children = (
1F402B3E25F47BF5009A3F10 /* ContentView.swift */,
1F1F4C3725F8EF7B00AA1528 /* LogoView.swift */,
1FE24BE525F9D4B20053E3E7 /* ReelView.swift */,
1F901B7C25FB2AFC00F14270 /* InfoView.swift */,
);
path = Views;
sourceTree = "<group>";
};
1F402B3025F47BF5009A3F10 = {
isa = PBXGroup;
children = (
1F402B3B25F47BF5009A3F10 /* FruitMachine */,
1F402B3A25F47BF5009A3F10 /* Products */,
);
sourceTree = "<group>";
};
1F402B3A25F47BF5009A3F10 /* Products */ = {
isa = PBXGroup;
children = (
1F402B3925F47BF5009A3F10 /* FruitMachine.app */,
);
name = Products;
sourceTree = "<group>";
};
1F402B3B25F47BF5009A3F10 /* FruitMachine */ = {
isa = PBXGroup;
children = (
1F782FB82609392C0052B244 /* Sounds */,
1F1F4C3A25F8F12D00AA1528 /* Helpers */,
1F402B3C25F47BF5009A3F10 /* FruitMachineApp.swift */,
1F33AC8B25F86D2C00DEF3CC /* Views */,
1F402B4025F47BF6009A3F10 /* Assets.xcassets */,
1F402B4525F47BF6009A3F10 /* Info.plist */,
1F402B4225F47BF6009A3F10 /* Preview Content */,
);
path = FruitMachine;
sourceTree = "<group>";
};
1F402B4225F47BF6009A3F10 /* Preview Content */ = {
isa = PBXGroup;
children = (
1F402B4325F47BF6009A3F10 /* Preview Assets.xcassets */,
);
path = "Preview Content";
sourceTree = "<group>";
};
1F782FB82609392C0052B244 /* Sounds */ = {
isa = PBXGroup;
children = (
1F8B889A26046650008FBB09 /* background.mp3 */,
1F8B88972604539A008FBB09 /* reset.mp3 */,
1F8B889126045071008FBB09 /* change.mp3 */,
1F8B8887260435C7008FBB09 /* spin.mp3 */,
1F8B888A26043702008FBB09 /* win.mp3 */,
1F8B888E26044C1F008FBB09 /* high-score.mp3 */,
1F8B889426045200008FBB09 /* game-over.mp3 */,
);
path = Sounds;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
1F402B3825F47BF5009A3F10 /* FruitMachine */ = {
isa = PBXNativeTarget;
buildConfigurationList = 1F402B4825F47BF6009A3F10 /* Build configuration list for PBXNativeTarget "FruitMachine" */;
buildPhases = (
1F402B3525F47BF5009A3F10 /* Sources */,
1F402B3625F47BF5009A3F10 /* Frameworks */,
1F402B3725F47BF5009A3F10 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = FruitMachine;
productName = FruitMachine;
productReference = 1F402B3925F47BF5009A3F10 /* FruitMachine.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
1F402B3125F47BF5009A3F10 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1240;
LastUpgradeCheck = 1240;
TargetAttributes = {
1F402B3825F47BF5009A3F10 = {
CreatedOnToolsVersion = 12.4;
};
};
};
buildConfigurationList = 1F402B3425F47BF5009A3F10 /* Build configuration list for PBXProject "FruitMachine" */;
compatibilityVersion = "Xcode 9.3";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 1F402B3025F47BF5009A3F10;
productRefGroup = 1F402B3A25F47BF5009A3F10 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
1F402B3825F47BF5009A3F10 /* FruitMachine */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
1F402B3725F47BF5009A3F10 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1F8B888F26044C1F008FBB09 /* high-score.mp3 in Resources */,
1F402B4425F47BF6009A3F10 /* Preview Assets.xcassets in Resources */,
1F8B88982604539A008FBB09 /* reset.mp3 in Resources */,
1F402B4125F47BF6009A3F10 /* Assets.xcassets in Resources */,
1F8B8888260435C7008FBB09 /* spin.mp3 in Resources */,
1F8B889526045200008FBB09 /* game-over.mp3 in Resources */,
1F8B889226045071008FBB09 /* change.mp3 in Resources */,
1F8B889B26046650008FBB09 /* background.mp3 in Resources */,
1F8B888B26043702008FBB09 /* win.mp3 in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
1F402B3525F47BF5009A3F10 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
1FE24BE625F9D4B20053E3E7 /* ReelView.swift in Sources */,
1F8B888526042A6B008FBB09 /* PlaySound.swift in Sources */,
1F22DBC725F978DE000D1514 /* Extensions.swift in Sources */,
1F1F4C3C25F8F15B00AA1528 /* Modifiers.swift in Sources */,
1F402B3F25F47BF5009A3F10 /* ContentView.swift in Sources */,
1F1F4C3825F8EF7B00AA1528 /* LogoView.swift in Sources */,
1F402B3D25F47BF5009A3F10 /* FruitMachineApp.swift in Sources */,
1F901B7D25FB2AFC00F14270 /* InfoView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin XCBuildConfiguration section */
1F402B4625F47BF6009A3F10 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
1F402B4725F47BF6009A3F10 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_ENABLE_OBJC_WEAK = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 14.4;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
1F402B4925F47BF6009A3F10 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"FruitMachine/Preview Content\"";
DEVELOPMENT_TEAM = Z3W45GNWDZ;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = FruitMachine/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = cn.liuming.FruitMachine;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
1F402B4A25F47BF6009A3F10 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_ENTITLEMENTS = "";
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_ASSET_PATHS = "\"FruitMachine/Preview Content\"";
DEVELOPMENT_TEAM = Z3W45GNWDZ;
ENABLE_PREVIEWS = YES;
INFOPLIST_FILE = FruitMachine/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = cn.liuming.FruitMachine;
PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_MACCATALYST = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
1F402B3425F47BF5009A3F10 /* Build configuration list for PBXProject "FruitMachine" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1F402B4625F47BF6009A3F10 /* Debug */,
1F402B4725F47BF6009A3F10 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
1F402B4825F47BF6009A3F10 /* Build configuration list for PBXNativeTarget "FruitMachine" */ = {
isa = XCConfigurationList;
buildConfigurations = (
1F402B4925F47BF6009A3F10 /* Debug */,
1F402B4A25F47BF6009A3F10 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 1F402B3125F47BF5009A3F10 /* Project object */;
}

View File

@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>

View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>FruitMachine.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>FruitMachine.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,158 @@
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@2x.png",
"scale": "2x"
},
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@3x.png",
"scale": "3x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@2x.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@3x.png",
"scale": "3x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@3x.png",
"scale": "3x"
},
{
"size": "57x57",
"idiom": "iphone",
"filename": "icon-57.png",
"scale": "1x"
},
{
"size": "57x57",
"idiom": "iphone",
"filename": "icon-57@2x.png",
"scale": "2x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@2x.png",
"scale": "2x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@3x.png",
"scale": "3x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20-ipad.png",
"scale": "1x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20@2x-ipad.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29-ipad.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29@2x-ipad.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40.png",
"scale": "1x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "50x50",
"idiom": "ipad",
"filename": "icon-50.png",
"scale": "1x"
},
{
"size": "50x50",
"idiom": "ipad",
"filename": "icon-50@2x.png",
"scale": "2x"
},
{
"size": "72x72",
"idiom": "ipad",
"filename": "icon-72.png",
"scale": "1x"
},
{
"size": "72x72",
"idiom": "ipad",
"filename": "icon-72@2x.png",
"scale": "2x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76.png",
"scale": "1x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76@2x.png",
"scale": "2x"
},
{
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "icon-83.5@2x.png",
"scale": "2x"
},
{
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "icon-1024.png",
"scale": "1x"
}
],
"info": {
"version": 1,
"author": "icon.wuruihong.com"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x9F",
"green" : "0x00",
"red" : "0xDD"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x51",
"green" : "0x00",
"red" : "0x5C"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "0.200",
"blue" : "0.000",
"green" : "0.000",
"red" : "0.000"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,20 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "0x44",
"green" : "0xE1",
"red" : "0xFF"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,24 @@
{
"images" : [
{
"filename" : "background.pdf",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true
}
}

View File

@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "奇妙水果机-Logo.png",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "奇妙水果机.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "拉杆.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "柠檬.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "槽位-草莓.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "槽位.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "牛油果.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 367 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "百香果.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "草莓.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "葡萄.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 935 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"filename" : "钱币.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

View File

@@ -0,0 +1,19 @@
//
// FruitMachineApp.swift
// FruitMachine
//
// Created by on 2021/3/7.
//
import SwiftUI
@main
struct FruitMachineApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
}
}

View File

@@ -0,0 +1,23 @@
//
// Extensions.swift
// FruitMachine
//
// Created by on 2021/3/11.
//
import SwiftUI
extension Text {
func scoreLableStyle() -> Text {
self
.foregroundColor(.white)
.font(.system(size: 10, weight: .bold, design: .rounded))
}
func scoreNumberStyle() -> Text {
self
.foregroundColor(.white)
.font(.system(.title, design: .rounded))
.fontWeight(.heavy)
}
}

View File

@@ -0,0 +1,89 @@
//
// ShadowModifier.swift
// FruitMachine
//
// Created by on 2021/3/10.
//
import SwiftUI
struct ShadowModifier: ViewModifier {
func body(content: Content) -> some View {
content.shadow(color: Color("ColorTransparentBlack"), radius: 0, x: 0, y: 6)
}
}
struct ButtonModifier: ViewModifier {
func body(content: Content) -> some View {
content
.font(.title)
.accentColor(.white)
}
}
struct ScoreNumberModifier: ViewModifier {
func body(content: Content) -> some View {
content
.shadow(color: Color("ColorTransparentBlack"), radius: 0, x: 0, y: 3)
.layoutPriority(1)
}
}
struct ScoreContainerModifier: ViewModifier {
func body(content: Content) -> some View {
content
.padding(.vertical, 4)
.padding(.horizontal, 16)
.frame(minWidth: 138)
.background(
Capsule()
.foregroundColor(Color("ColorTransparentBlack"))
)
}
}
struct ImageModifier: ViewModifier {
func body(content: Content) -> some View {
content
.scaledToFit()
.frame(minWidth: 140, idealWidth: 200, maxWidth: 220, minHeight: 130, idealHeight: 190, maxHeight: 200, alignment: .center)
.modifier(ShadowModifier())
}
}
struct CoinNumberModifier: ViewModifier {
func body(content: Content) -> some View {
content
.font(.system(.title, design: .rounded))
.padding(.vertical, 5)
.frame(width: 90)
.shadow(color: Color("ColorTransparentBlack"), radius: 0, x: 0, y: 3)
}
}
struct CoinCapsuleModifier: ViewModifier {
func body(content: Content) -> some View {
content
.background(
Capsule()
.fill(LinearGradient(gradient: Gradient(colors: [Color("ColorPink"), Color("ColorPurple")]), startPoint: .top, endPoint: .bottom))
)
.padding(3)
.background(
Capsule()
.fill(LinearGradient(gradient: Gradient(colors: [Color("ColorPink"), Color("ColorPurple")]), startPoint: .bottom, endPoint: .top))
.modifier(ShadowModifier())
)
}
}
struct CoinImageModifier: ViewModifier {
func body(content: Content) -> some View {
content
.scaledToFit()
.frame(height: 64)
.animation(.default)
.modifier(ShadowModifier())
}
}

View File

@@ -0,0 +1,21 @@
//
// PlaySound.swift
// FruitMachine
//
// Created by on 2021/3/19.
//
import AVFoundation
var audioPlayer: AVAudioPlayer?
func playSound(sound: String, type: String) {
if let path = Bundle.main.path(forResource: sound, ofType: type) {
do {
audioPlayer = try AVAudioPlayer(contentsOf: URL(fileURLWithPath: path))
audioPlayer?.play()
} catch {
print("错误:无法找到文件并播放该声效文件!")
}
}
}

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>奇妙水果机</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
</dict>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
<key>UILaunchScreen</key>
<dict>
<key>UIColorName</key>
<string>ColorPurple</string>
<key>UIImageName</key>
<string>奇妙水果机-Logo</string>
</dict>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>LSApplicationCategoryType</key>
<string></string>
</dict>
</plist>

View File

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,367 @@
//
// ContentView.swift
// FruitMachine
//
// Created by on 2021/3/7.
//
import SwiftUI
struct ContentView: View {
//MARK: - Properties
@State private var showingInfoView: Bool = false
@State private var highScore: Int = UserDefaults.standard.integer(forKey: "HighScore")
@State private var coins: Int = 100
@State private var coinsAmount: Int = 10
@State private var isActive10 = true
@State private var showingModal = false
@State private var animatingSymbol = false
@State private var animatingModal = false
let haptics = UINotificationFeedbackGenerator()
let symbols = ["草莓", "柠檬", "牛油果", "百香果", "葡萄"]
@State private var reels: Array = [0, 1, 2]
// MARK: - Functions
// MARK: -
func spinReels() {
reels = reels.map { _ in
Int.random(in: 0...symbols.count - 1)
}
playSound(sound: "spin", type: "mp3")
haptics.notificationOccurred(.success)
}
// MARK: -
func checkWinning() {
if reels[0] == reels[1] && reels[1] == reels[2] {
//
playerWins()
//
if coins > highScore {
newHighScore()
} else {
playSound(sound: "win", type: "mp3")
}
} else {
//
playerLoses()
}
}
func playerWins() {
coins += coinsAmount * 10
}
func newHighScore() {
highScore = coins
UserDefaults.standard.set(highScore, forKey: "HighScore")
playSound(sound: "high-score", type: "mp3")
}
func playerLoses() {
coins -= coinsAmount
}
func activate10() {
coinsAmount = 10
isActive10 = true
playSound(sound: "change", type: "mp3")
haptics.notificationOccurred(.success)
}
func activate20() {
coinsAmount = 20
isActive10 = false
playSound(sound: "change", type: "mp3")
haptics.notificationOccurred(.success)
}
//
func isGameOver() {
if coins <= 0 {
//
showingModal = true
playSound(sound: "game-over", type: "mp3")
}
}
//
func resetGame() {
UserDefaults.standard.set(0, forKey: "HighScore")
highScore = 0
coins = 100
activate10()
playSound(sound: "reset", type: "mp3")
}
//MARK: - Body
var body: some View {
ZStack {
//MARK: - Background
LinearGradient(gradient: Gradient(colors: [Color("ColorPink"), Color("ColorPurple")]), startPoint: .top, endPoint: .bottom)
.edgesIgnoringSafeArea(.all)
//MARK: - Interface
VStack(alignment: .center, spacing: 5) {
//MARK: - Header
LogoView()
Spacer()
//MARK: - Score
HStack {
HStack {
Text("你的\n分数")
.scoreLableStyle()
.multilineTextAlignment(.trailing)
Text("\(coins)")
.scoreNumberStyle()
.modifier(ScoreNumberModifier())
} //: HStack
.modifier(ScoreContainerModifier())
Spacer()
HStack {
Text("\(highScore)")
.scoreNumberStyle()
.modifier(ScoreNumberModifier())
Text("最高\n分数")
.scoreLableStyle()
.multilineTextAlignment(.leading)
} //: HStack
.modifier(ScoreContainerModifier())
} //: HStack
//MARK: - FruitMachine
VStack(alignment: .center, spacing: 0) {
//MARK: - #1
ZStack {
ReelView()
Image(symbols[reels[0]])
.resizable()
.modifier(ImageModifier())
.opacity(animatingSymbol ? 1 : 0)
.offset(y: animatingSymbol ? 0 : -50)
.animation(.easeOut(duration: Double.random(in: 0.5...0.7)))
.onAppear{
self.animatingSymbol.toggle()
}
} //: ZStack
HStack(alignment: .center, spacing: 0) {
//MARK: - #2
ZStack {
ReelView()
Image(symbols[reels[1]])
.resizable()
.modifier(ImageModifier())
.opacity(animatingSymbol ? 1 : 0)
.offset(y: animatingSymbol ? 0 : -50)
.animation(.easeOut(duration: Double.random(in: 0.7...0.9)))
.onAppear{
self.animatingSymbol.toggle()
}
} //: ZStack
Spacer()
//MARK: - 3
ZStack {
ReelView()
Image(symbols[reels[2]])
.resizable()
.modifier(ImageModifier())
.opacity(animatingSymbol ? 1 : 0)
.offset(y: animatingSymbol ? 0 : -50)
.animation(.easeOut(duration: Double.random(in: 0.9...1.1)))
.onAppear{
self.animatingSymbol.toggle()
}
} //: ZStack
} //: HStack
.frame(maxWidth: 500)
//MARK: -
Button(action: {
//
withAnimation{
self.animatingSymbol = false
}
//
self.spinReels()
//
withAnimation{
self.animatingSymbol = true
}
//
self.checkWinning()
//
self.isGameOver()
}, label: {
Image("拉杆")
.renderingMode(.original)
.resizable()
.modifier(ImageModifier())
})
} //: VStack
.layoutPriority(2)
//MARK: - Footer
Spacer()
HStack {
//MARK: - 20
HStack(alignment: .center, spacing: 10) {
Button(action: {
activate20()
}) {
Text("20")
.fontWeight(.heavy)
.foregroundColor(isActive10 == false ? Color("ColorYellow") : .white)
.modifier(CoinNumberModifier())
} //: Button
.modifier(CoinCapsuleModifier())
Image("钱币")
.resizable()
.opacity(isActive10 == false ? 1 : 0)
.offset(x: isActive10 == false ? 0 : 20)
.modifier(CoinImageModifier())
} //: HStack
Spacer()
//MARK: - 10
HStack(alignment: .center, spacing: 10) {
Image("钱币")
.resizable()
.opacity(isActive10 == true ? 1 : 0)
.offset(x: isActive10 == true ? 0 : -20)
.modifier(CoinImageModifier())
Button(action: {
activate10()
}) {
Text("10")
.fontWeight(.heavy)
.foregroundColor(isActive10 == true ? Color("ColorYellow") : .white)
.modifier(CoinNumberModifier())
} //: Button
.modifier(CoinCapsuleModifier())
} //: HStack
} //: HStack
}
// MARK: -
.overlay(
//
Button(action: {
resetGame()
}, label: {
Image(systemName: "arrow.2.circlepath.circle")
})
.modifier(ButtonModifier())
, alignment: .topLeading
)
.overlay(
//
Button(action: {
//print("")
self.showingInfoView = true
}, label: {
Image(systemName: "info.circle")
})
.modifier(ButtonModifier())
, alignment: .topTrailing
)
.padding()
.frame(maxWidth: 720)
.blur(radius: $showingModal.wrappedValue ? 5 : 0, opaque: false)
//MARK: - Popup
if $showingModal.wrappedValue {
ZStack {
Color("ColorTransparentBlack").edgesIgnoringSafeArea(.all)
VStack(spacing: 0) {
//
Text("游戏结束")
.font(.title)
.fontWeight(.heavy)
.padding()
.frame(minWidth:0, maxWidth: .infinity)
.background(Color("ColorPink"))
.foregroundColor(.white)
Spacer()
//
VStack(alignment: .center, spacing: 16) {
Image("槽位-草莓")
.resizable()
.scaledToFit()
.frame(maxHeight: 72)
Text("很不幸!你失去了所有的分数。\n让我们再来一次吧!")
.font(.body)
.lineLimit(2)
.multilineTextAlignment(.center)
.foregroundColor(.gray)
.layoutPriority(1)
Button(action: {
self.showingModal = false
self.animatingModal = false
self.activate10()
self.coins = 100
}, label: {
Text("新游戏")
.font(.body)
.fontWeight(.semibold)
.accentColor(Color("ColorPink"))
.padding(.horizontal, 12)
.padding(.vertical, 8)
.frame(minWidth: 128)
.background(
Capsule()
.strokeBorder(lineWidth: 1.75)
.foregroundColor(Color("ColorPink"))
)
})
}
Spacer()
} //: VStack
.frame(minWidth: 280, idealWidth: 280, maxWidth: 320, minHeight: 260, idealHeight: 280, maxHeight: 320, alignment: .center)
.background(Color.white)
.cornerRadius(20)
.shadow(color: Color("ColorTransparentBlack"), radius: 6, x: 0, y: 8)
.opacity(animatingModal ? 1 : 0)
.offset(y: animatingModal ? 0 : -100)
.animation(Animation.spring(response: 0.6, dampingFraction: 1.0, blendDuration: 1.0))
.onAppear{
self.animatingModal = true
}
} //: ZStack
} //: IfEnd
} //: ZStack
.sheet(isPresented: $showingInfoView) {
InfoView()
}
}
}
//MARK: - Preview
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}

View File

@@ -0,0 +1,72 @@
//
// InfoView.swift
// FruitMachine
//
// Created by on 2021/3/12.
//
import SwiftUI
struct InfoView: View {
//MARK: - Properties
@Environment(\.presentationMode) var presentationMode
//MARK: - Body
var body: some View {
VStack {
LogoView()
Spacer()
Form {
Section(header: Text("关于应用程序")) {
FormRowView(firstItem: "应用程序", secondItem: "奇妙水果机")
FormRowView(firstItem: "平台", secondItem: "iPhone、iPad、Mac")
FormRowView(firstItem: "开发者", secondItem: "Happy/Liu Ming")
FormRowView(firstItem: "设计者", secondItem: "Oscar")
FormRowView(firstItem: "音效", secondItem: "Star")
FormRowView(firstItem: "网站", secondItem: "www.liuming.cn")
FormRowView(firstItem: "版本", secondItem: "0.0.1")
} //: Section
} //: Form
.font(.system(.body, design: .rounded))
} //: VStack
.padding(.top, 40)
.overlay(
Button(action: {
//
audioPlayer?.stop()
self.presentationMode.wrappedValue.dismiss()
}) {
Image(systemName: "xmark.circle")
.font(.title)
}
.padding(.top, 30)
.padding(.trailing, 20)
.accentColor(.secondary)
, alignment: .topTrailing)
.onAppear(){
playSound(sound: "background", type: "mp3")
}
}
}
//MARK: - Preview
struct InfoView_Previews: PreviewProvider {
static var previews: some View {
InfoView()
}
}
struct FormRowView: View {
var firstItem: String
var secondItem: String
var body: some View {
HStack {
Text(firstItem).foregroundColor(.gray)
Spacer()
Text(secondItem)
} //: HStack
}
}

View File

@@ -0,0 +1,28 @@
//
// LogoView.swift
// FruitMachine
//
// Created by on 2021/3/10.
//
import SwiftUI
struct LogoView: View {
// MARK: - Body
var body: some View {
Image("奇妙水果机")
.resizable()
.scaledToFit()
.frame(minWidth: 256, idealWidth: 300, maxWidth: 320, minHeight: 82, idealHeight: 92, maxHeight: 112, alignment: .center)
.padding(.horizontal)
.layoutPriority(1)
.modifier(ShadowModifier())
}
}
struct LogoView_Previews: PreviewProvider {
static var previews: some View {
LogoView()
}
}

View File

@@ -0,0 +1,27 @@
//
// ReelView.swift
// FruitMachine
//
// Created by on 2021/3/11.
//
import SwiftUI
struct ReelView: View {
//MARK: - Properties
//MARK: - Body
var body: some View {
Image("槽位")
.resizable()
.modifier(ImageModifier())
}
}
//MARK: - Preview
struct ReelView_Previews: PreviewProvider {
static var previews: some View {
ReelView()
.previewLayout(.fixed(width: 220, height: 220))
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

View File

@@ -0,0 +1,158 @@
{
"images": [
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@2x.png",
"scale": "2x"
},
{
"size": "20x20",
"idiom": "iphone",
"filename": "icon-20@3x.png",
"scale": "3x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@2x.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "iphone",
"filename": "icon-29@3x.png",
"scale": "3x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "iphone",
"filename": "icon-40@3x.png",
"scale": "3x"
},
{
"size": "57x57",
"idiom": "iphone",
"filename": "icon-57.png",
"scale": "1x"
},
{
"size": "57x57",
"idiom": "iphone",
"filename": "icon-57@2x.png",
"scale": "2x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@2x.png",
"scale": "2x"
},
{
"size": "60x60",
"idiom": "iphone",
"filename": "icon-60@3x.png",
"scale": "3x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20-ipad.png",
"scale": "1x"
},
{
"size": "20x20",
"idiom": "ipad",
"filename": "icon-20@2x-ipad.png",
"scale": "2x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29-ipad.png",
"scale": "1x"
},
{
"size": "29x29",
"idiom": "ipad",
"filename": "icon-29@2x-ipad.png",
"scale": "2x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40.png",
"scale": "1x"
},
{
"size": "40x40",
"idiom": "ipad",
"filename": "icon-40@2x.png",
"scale": "2x"
},
{
"size": "50x50",
"idiom": "ipad",
"filename": "icon-50.png",
"scale": "1x"
},
{
"size": "50x50",
"idiom": "ipad",
"filename": "icon-50@2x.png",
"scale": "2x"
},
{
"size": "72x72",
"idiom": "ipad",
"filename": "icon-72.png",
"scale": "1x"
},
{
"size": "72x72",
"idiom": "ipad",
"filename": "icon-72@2x.png",
"scale": "2x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76.png",
"scale": "1x"
},
{
"size": "76x76",
"idiom": "ipad",
"filename": "icon-76@2x.png",
"scale": "2x"
},
{
"size": "83.5x83.5",
"idiom": "ipad",
"filename": "icon-83.5@2x.png",
"scale": "2x"
},
{
"size": "1024x1024",
"idiom": "ios-marketing",
"filename": "icon-1024.png",
"scale": "1x"
}
],
"info": {
"version": 1,
"author": "icon.wuruihong.com"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Some files were not shown because too many files have changed in this diff Show More