From ebc575df886537d0ad2956283683f20cf1736aef Mon Sep 17 00:00:00 2001 From: marco Date: Tue, 5 Oct 2021 17:22:01 -0600 Subject: [PATCH] windows vs linux --- android/app/src/main/AndroidManifest.xml | 86 +- ios/Runner.xcodeproj/project.pbxproj | 940 ++++++++-------- lib/bug_holder.dart | 142 +-- lib/coin_holder.dart | 188 ++-- lib/debris_holder.dart | 134 +-- lib/main.dart | 1184 ++++++++++---------- lib/main_menu_overlay.dart | 296 ++--- lib/runner.dart | 1290 +++++++++++----------- lib/wall_holder.dart | 130 +-- lib/wire_holder.dart | 144 +-- pubspec.lock | 766 ++++++------- pubspec.yaml | 176 +-- 12 files changed, 2738 insertions(+), 2738 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 6d1d8a2..fff9634 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,43 +1,43 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 6050029..c000573 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -1,471 +1,471 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1020; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - 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 = 9.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 9705A1C41CF9048500538489 /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; + 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; + 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; + 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 97C146EB1CF9000F007C117D /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 9740EEB11CF90186004384FC /* Flutter */ = { + isa = PBXGroup; + children = ( + 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, + 9740EEB21CF90195004384FC /* Debug.xcconfig */, + 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, + 9740EEB31CF90195004384FC /* Generated.xcconfig */, + ); + name = Flutter; + sourceTree = ""; + }; + 97C146E51CF9000F007C117D = { + isa = PBXGroup; + children = ( + 9740EEB11CF90186004384FC /* Flutter */, + 97C146F01CF9000F007C117D /* Runner */, + 97C146EF1CF9000F007C117D /* Products */, + ); + sourceTree = ""; + }; + 97C146EF1CF9000F007C117D /* Products */ = { + isa = PBXGroup; + children = ( + 97C146EE1CF9000F007C117D /* Runner.app */, + ); + name = Products; + sourceTree = ""; + }; + 97C146F01CF9000F007C117D /* Runner */ = { + isa = PBXGroup; + children = ( + 97C146FA1CF9000F007C117D /* Main.storyboard */, + 97C146FD1CF9000F007C117D /* Assets.xcassets */, + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, + 97C147021CF9000F007C117D /* Info.plist */, + 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, + 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, + 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, + 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, + ); + path = Runner; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 97C146ED1CF9000F007C117D /* Runner */ = { + isa = PBXNativeTarget; + buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; + buildPhases = ( + 9740EEB61CF901F6004384FC /* Run Script */, + 97C146EA1CF9000F007C117D /* Sources */, + 97C146EB1CF9000F007C117D /* Frameworks */, + 97C146EC1CF9000F007C117D /* Resources */, + 9705A1C41CF9048500538489 /* Embed Frameworks */, + 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Runner; + productName = Runner; + productReference = 97C146EE1CF9000F007C117D /* Runner.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 97C146E61CF9000F007C117D /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 1020; + ORGANIZATIONNAME = ""; + TargetAttributes = { + 97C146ED1CF9000F007C117D = { + CreatedOnToolsVersion = 7.3.1; + LastSwiftMigration = 1100; + }; + }; + }; + buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 97C146E51CF9000F007C117D; + productRefGroup = 97C146EF1CF9000F007C117D /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 97C146ED1CF9000F007C117D /* Runner */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 97C146EC1CF9000F007C117D /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, + 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, + 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXShellScriptBuildPhase section */ + 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Thin Binary"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; + }; + 9740EEB61CF901F6004384FC /* Run Script */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + name = "Run Script"; + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; + }; +/* End PBXShellScriptBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 97C146EA1CF9000F007C117D /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, + 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 97C146FA1CF9000F007C117D /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C146FB1CF9000F007C117D /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 97C147001CF9000F007C117D /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 249021D3217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Profile; + }; + 249021D4217E4FDB00AE95B9 /* Profile */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Profile; + }; + 97C147031CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 97C147041CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = 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_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_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + 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 = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SUPPORTED_PLATFORMS = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 97C147061CF9000F007C117D /* Debug */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Debug; + }; + 97C147071CF9000F007C117D /* Release */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CLANG_ENABLE_MODULES = YES; + CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; + ENABLE_BITCODE = NO; + INFOPLIST_FILE = Runner/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = com.firogames.firoRunner; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; + SWIFT_VERSION = 5.0; + VERSIONING_SYSTEM = "apple-generic"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147031CF9000F007C117D /* Debug */, + 97C147041CF9000F007C117D /* Release */, + 249021D3217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 97C147061CF9000F007C117D /* Debug */, + 97C147071CF9000F007C117D /* Release */, + 249021D4217E4FDB00AE95B9 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 97C146E61CF9000F007C117D /* Project object */; } \ No newline at end of file diff --git a/lib/bug_holder.dart b/lib/bug_holder.dart index 7407e4f..58d1729 100644 --- a/lib/bug_holder.dart +++ b/lib/bug_holder.dart @@ -1,71 +1,71 @@ -import 'package:firo_runner/holder.dart'; -import 'package:firo_runner/platform.dart'; -import 'package:flame/components.dart'; - -import 'package:firo_runner/bug.dart'; -import 'package:firo_runner/main.dart'; - -class BugHolder extends Holder { - late List bug; - late List breaking; - - @override - Future load() async { - bug = await loadListSprites("bug", "bug", 8); - breaking = await loadListSprites("bug", "bug_break", 13); - } - - List getBug(String state) { - switch (state) { - case "normal": - return bug; - default: - return breaking; - } - } - - bool generateBug(MyGame gameRef, int level, - {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { - return false; - } - - if (random.nextInt(100) > 25) { - return true; - } else { - int nearestPlatform = getNearestPlatform(level); - - Platform? platform = - gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); - if (platform != null && platform.prohibitObstacles) { - return false; - } - double xCoordinate = -100; - - if (level == 0) { - xCoordinate = gameRef.size.x; - } else if (platform != null) { - xCoordinate = platform.sprite.x; - } else { - return false; - } - - Bug bug = Bug(gameRef); - bug.setPosition(xCoordinate, gameRef.blockSize * level); - - if (gameRef.isTooNearOtherObstacles(bug.sprite.toRect())) { - return false; - } - - objects[level].add(bug); - gameRef.add(bug.sprite); - if (platform != null) { - platform.removeChildren.add(() { - objects[level].remove(bug); - bug.remove(); - }); - } - return false; - } - } -} +import 'package:firo_runner/holder.dart'; +import 'package:firo_runner/platform.dart'; +import 'package:flame/components.dart'; + +import 'package:firo_runner/bug.dart'; +import 'package:firo_runner/main.dart'; + +class BugHolder extends Holder { + late List bug; + late List breaking; + + @override + Future load() async { + bug = await loadListSprites("bug", "bug", 8); + breaking = await loadListSprites("bug", "bug_break", 13); + } + + List getBug(String state) { + switch (state) { + case "normal": + return bug; + default: + return breaking; + } + } + + bool generateBug(MyGame gameRef, int level, + {bool force = false, double xPosition = 0}) { + if (objects[level].isNotEmpty) { + return false; + } + + if (random.nextInt(100) > 25) { + return true; + } else { + int nearestPlatform = getNearestPlatform(level); + + Platform? platform = + gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); + if (platform != null && platform.prohibitObstacles) { + return false; + } + double xCoordinate = -100; + + if (level == 0) { + xCoordinate = gameRef.size.x; + } else if (platform != null) { + xCoordinate = platform.sprite.x; + } else { + return false; + } + + Bug bug = Bug(gameRef); + bug.setPosition(xCoordinate, gameRef.blockSize * level); + + if (gameRef.isTooNearOtherObstacles(bug.sprite.toRect())) { + return false; + } + + objects[level].add(bug); + gameRef.add(bug.sprite); + if (platform != null) { + platform.removeChildren.add(() { + objects[level].remove(bug); + bug.remove(); + }); + } + return false; + } + } +} diff --git a/lib/coin_holder.dart b/lib/coin_holder.dart index 190713a..988227d 100644 --- a/lib/coin_holder.dart +++ b/lib/coin_holder.dart @@ -1,94 +1,94 @@ -import 'package:firo_runner/holder.dart'; -import 'package:flame/components.dart'; - -import 'package:firo_runner/coin.dart'; -import 'package:firo_runner/main.dart'; -import 'package:flame/extensions.dart'; -import 'package:firo_runner/platform.dart'; - -class CoinHolder extends Holder { - late List coin; - late SpriteAnimationGroupComponent sprite; - late MyGame personalGameRef; - - @override - Future load() async { - coin = await loadListSprites("coin", "coin", 12); - SpriteAnimation normal = SpriteAnimation.spriteList(coin, stepTime: 0.1); - - sprite = SpriteAnimationGroupComponent( - animations: { - CoinState.normal: normal, - }, - current: CoinState.normal, - ); - - sprite.changePriorityWithoutResorting(COIN_PRIORITY); - - sprite.size = Vector2(20, 20); - } - - void setPersonalGameRef(MyGame gameRef) { - personalGameRef = gameRef; - } - - @override - void resize(Vector2 newSize, double xRatio, double yRatio) { - super.resize(newSize, xRatio, yRatio); - sprite.x *= xRatio; - sprite.y *= yRatio; - sprite.width *= xRatio; - sprite.height *= yRatio; - } - - void renderCoinScore(Canvas c) { - sprite.position = Vector2(personalGameRef.size.x - 70, 10); - sprite.render(c); - } - - List getCoin() { - return coin; - } - - bool generateCoin(MyGame gameRef, int level, - {bool force = false, double xPosition = 0}) { - if (total() > 5 && !force) { - return false; - } - - if (objects[level].isNotEmpty && !force) { - return false; - } - - if (random.nextInt(100) > 25 && !force) { - return true; - } else { - int nearestPlatform = getNearestPlatform(level); - - Platform? platform = - gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); - double xCoordinate = -100; - - if (force) { - xCoordinate = xPosition; - } else if (level == 0) { - xCoordinate = gameRef.size.x; - } else if (platform != null) { - xCoordinate = platform.sprite.x; - } else { - return false; - } - - Coin coin = Coin(gameRef); - coin.setPosition(xCoordinate, gameRef.blockSize * level); - - if (gameRef.isTooNearOtherObstacles(coin.sprite.toRect()) && !force) { - return false; - } - - objects[level].add(coin); - gameRef.add(coin.sprite); - } - return false; - } -} +import 'package:firo_runner/holder.dart'; +import 'package:flame/components.dart'; + +import 'package:firo_runner/coin.dart'; +import 'package:firo_runner/main.dart'; +import 'package:flame/extensions.dart'; +import 'package:firo_runner/platform.dart'; + +class CoinHolder extends Holder { + late List coin; + late SpriteAnimationGroupComponent sprite; + late MyGame personalGameRef; + + @override + Future load() async { + coin = await loadListSprites("coin", "coin", 12); + SpriteAnimation normal = SpriteAnimation.spriteList(coin, stepTime: 0.1); + + sprite = SpriteAnimationGroupComponent( + animations: { + CoinState.normal: normal, + }, + current: CoinState.normal, + ); + + sprite.changePriorityWithoutResorting(COIN_PRIORITY); + + sprite.size = Vector2(20, 20); + } + + void setPersonalGameRef(MyGame gameRef) { + personalGameRef = gameRef; + } + + @override + void resize(Vector2 newSize, double xRatio, double yRatio) { + super.resize(newSize, xRatio, yRatio); + sprite.x *= xRatio; + sprite.y *= yRatio; + sprite.width *= xRatio; + sprite.height *= yRatio; + } + + void renderCoinScore(Canvas c) { + sprite.position = Vector2(personalGameRef.size.x - 70, 10); + sprite.render(c); + } + + List getCoin() { + return coin; + } + + bool generateCoin(MyGame gameRef, int level, + {bool force = false, double xPosition = 0}) { + if (total() > 5 && !force) { + return false; + } + + if (objects[level].isNotEmpty && !force) { + return false; + } + + if (random.nextInt(100) > 25 && !force) { + return true; + } else { + int nearestPlatform = getNearestPlatform(level); + + Platform? platform = + gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); + double xCoordinate = -100; + + if (force) { + xCoordinate = xPosition; + } else if (level == 0) { + xCoordinate = gameRef.size.x; + } else if (platform != null) { + xCoordinate = platform.sprite.x; + } else { + return false; + } + + Coin coin = Coin(gameRef); + coin.setPosition(xCoordinate, gameRef.blockSize * level); + + if (gameRef.isTooNearOtherObstacles(coin.sprite.toRect()) && !force) { + return false; + } + + objects[level].add(coin); + gameRef.add(coin.sprite); + } + return false; + } +} diff --git a/lib/debris_holder.dart b/lib/debris_holder.dart index 8a44179..d367d82 100644 --- a/lib/debris_holder.dart +++ b/lib/debris_holder.dart @@ -1,67 +1,67 @@ -import 'package:firo_runner/holder.dart'; -import 'package:firo_runner/platform.dart'; -import 'package:flame/components.dart'; -import 'package:flame/extensions.dart'; -import 'package:flame/flame.dart'; - -import 'package:firo_runner/debris.dart'; -import 'package:firo_runner/main.dart'; - -class DebrisHolder extends Holder { - late List debris; - - @override - Future load() async { - debris = await loadListSprites("debris", "debris", 21); - } - - List getDebris() { - return debris; - } - - bool generateDebris(MyGame gameRef, int level, - {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { - return false; - } - - if (random.nextInt(100) > 25) { - return true; - } else { - int nearestPlatform = getNearestPlatform(level); - - Platform? platform = - gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); - if (platform != null && platform.prohibitObstacles) { - return false; - } - double xCoordinate = -100; - - if (level == 0) { - xCoordinate = gameRef.size.x; - } else if (platform != null) { - xCoordinate = platform.sprite.x; - } else { - return false; - } - - Debris debris = Debris(gameRef); - debris.setPosition( - xCoordinate, gameRef.blockSize * level - gameRef.blockSize / 3); - - if (gameRef.isTooNearOtherObstacles(debris.sprite.toRect())) { - return false; - } - - objects[level].add(debris); - gameRef.add(debris.sprite); - if (platform != null) { - platform.removeChildren.add(() { - objects[level].remove(debris); - debris.remove(); - }); - } - return false; - } - } -} +import 'package:firo_runner/holder.dart'; +import 'package:firo_runner/platform.dart'; +import 'package:flame/components.dart'; +import 'package:flame/extensions.dart'; +import 'package:flame/flame.dart'; + +import 'package:firo_runner/debris.dart'; +import 'package:firo_runner/main.dart'; + +class DebrisHolder extends Holder { + late List debris; + + @override + Future load() async { + debris = await loadListSprites("debris", "debris", 21); + } + + List getDebris() { + return debris; + } + + bool generateDebris(MyGame gameRef, int level, + {bool force = false, double xPosition = 0}) { + if (objects[level].isNotEmpty) { + return false; + } + + if (random.nextInt(100) > 25) { + return true; + } else { + int nearestPlatform = getNearestPlatform(level); + + Platform? platform = + gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); + if (platform != null && platform.prohibitObstacles) { + return false; + } + double xCoordinate = -100; + + if (level == 0) { + xCoordinate = gameRef.size.x; + } else if (platform != null) { + xCoordinate = platform.sprite.x; + } else { + return false; + } + + Debris debris = Debris(gameRef); + debris.setPosition( + xCoordinate, gameRef.blockSize * level - gameRef.blockSize / 3); + + if (gameRef.isTooNearOtherObstacles(debris.sprite.toRect())) { + return false; + } + + objects[level].add(debris); + gameRef.add(debris.sprite); + if (platform != null) { + platform.removeChildren.add(() { + objects[level].remove(debris); + debris.remove(); + }); + } + return false; + } + } +} diff --git a/lib/main.dart b/lib/main.dart index be8a8e1..c83cf2f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,592 +1,592 @@ -import 'dart:async'; -import 'dart:convert'; -import 'dart:io'; -import 'dart:math'; - -import 'package:firo_runner/bug_holder.dart'; -import 'package:firo_runner/circuit_background.dart'; -import 'package:firo_runner/coin_holder.dart'; -import 'package:firo_runner/debris_holder.dart'; -import 'package:firo_runner/firework.dart'; -import 'package:firo_runner/game_state.dart'; -import 'package:firo_runner/moving_object.dart'; -import 'package:firo_runner/platform.dart'; -import 'package:firo_runner/platform_holder.dart'; -import 'package:firo_runner/wall_holder.dart'; -import 'package:firo_runner/wire.dart'; -import 'package:firo_runner/wire_holder.dart'; -import 'package:flame/components.dart'; -import 'package:flame/extensions.dart'; -import 'package:flame/flame.dart'; -import 'package:flame/game.dart'; -import 'package:flame/gestures.dart'; -import 'package:flame/keyboard.dart'; -import 'package:flame_audio/flame_audio.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:firo_runner/runner.dart'; -import 'package:flutter/foundation.dart' show kIsWeb; -import 'package:http/http.dart' as http; - -import 'package:firo_runner/lose_menu_overlay.dart'; -import 'package:firo_runner/main_menu_overlay.dart'; - -const COLOR = Color(0xFFDDC0A3); -const int LOADING_TIME = 2000000; - -const LEVEL2 = 25000000; -const LEVEL3 = 50000000; -const LEVEL4 = 75000000; -const LEVEL5 = 100000000; -const LEVEL6 = 125000000; -const LEVEL7 = 150000000; - -const COINS_ROBOT_UPGRADE1 = 50; -const COINS_ROBOT_UPGRADE2 = 100; - -const OVERLAY_PRIORITY = 110; -const RUNNER_PRIORITY = 100; -const BUG_PRIORITY = 75; -const COIN_PRIORITY = 70; -const PLATFORM_PRIORITY = 50; -const WALL_PRIORITY = 40; -const DEBRIS_PRIORITY = 30; -const WIRE_PRIORITY = 25; -const FIREWORK_PRIORITY = 15; -const WINDOW_PRIORITY = 10; - -// const overlayText = TextStyle( -// fontSize: 30, -// color: Colors.white, -// ); - -const AssetImage mainMenuImage = AssetImage('assets/images/mm3.gif'); -const AssetImage lossImage = AssetImage('assets/images/overlay100.png'); -const AssetImage buttonImage = AssetImage('assets/images/button-new.png'); - -void main() async { - WidgetsFlutterBinding.ensureInitialized(); - await Flame.device.fullScreen(); - await Flame.device.setLandscape(); - final myGame = MyGame(); - runApp(MaterialApp( - debugShowCheckedModeBanner: false, - home: GameWidget( - game: myGame, - overlayBuilderMap: { - // Should be used once before all overlays are called. Flame has a slight - // delay when constructing the overlay widgets, so to make the text and - // images load together, all the other overlays should be called in the - // load section, and removed, and the loading black screen should be kept - // up until everything is finished loading. - 'loading': (_, myGame) { - return Center( - child: Container( - height: myGame.viewport.canvasSize.y, - width: myGame.viewport.canvasSize.x, - color: Colors.black, - ), - ); - }, - 'mainMenu': (_, myGame) { - return MainMenuOverlay(game: myGame); - }, - 'gameOver': (_, myGame) { - return LoseMenuOverlay(game: myGame); - }, - }, - ))); -} - -int getNearestPlatform(int level) { - return level <= 0 - ? 0 - : level <= 3 - ? 2 - : level <= 6 - ? 5 - : 8; -} - -class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { - TextPaint fireworksPaint = TextPaint( - config: const TextPaintConfig( - fontSize: 48.0, fontFamily: 'Codystar', color: COLOR), - ); - - TextPaint scoresPaint = TextPaint( - config: const TextPaintConfig(fontSize: 16.0, color: COLOR), - ); - - late CircuitBackground circuitBackground; - late PlatformHolder platformHolder; - late CoinHolder coinHolder; - late WireHolder wireHolder; - late BugHolder bugHolder; - late Firework fireworks; - late DebrisHolder debrisHolder; - late WallHolder wallHolder; - Random random = Random(); - bool playingMusic = false; - - late Runner runner; - late GameState gameState; - late double blockSize; - - bool loaded = false; - bool firstDeath = true; - late Wire wire; - late TextComponent _distance; - late TextComponent _coins; - int startLoading = 0; - - MyGame() : super() { - viewport.resize(Vector2(1920, 1080)); - } - - @override - Future onLoad() async { - // debugMode = true; - FlameAudio.bgm.initialize(); - - await FlameAudio.audioCache.loadAll([ - 'sfx/bug_chomp.mp3', - 'sfx/coin_catch.mp3', - 'sfx/fall_death.mp3', - 'sfx/glitch_death.mp3', - 'sfx/jet_boost.mp3', - 'sfx/menu_button.mp3', - 'sfx/obstacle_death.mp3', - 'sfx/robot_friend_beep.mp3', - 'Infinite_Menu.mp3', - 'Infinite_Spankage_M.mp3', - ]); - - circuitBackground = CircuitBackground(this); - await circuitBackground.load(); - platformHolder = PlatformHolder(); - await platformHolder.load(); - coinHolder = CoinHolder(); - coinHolder.setPersonalGameRef(this); - await coinHolder.load(); - wireHolder = WireHolder(); - await wireHolder.load(); - bugHolder = BugHolder(); - await bugHolder.load(); - debrisHolder = DebrisHolder(); - await debrisHolder.load(); - wallHolder = WallHolder(); - await wallHolder.load(); - fireworks = Firework(this); - await fireworks.load(); - - gameState = GameState(); - - runner = Runner(); - await runner.load(); - - loaded = true; - _distance = TextComponent("Time: 0", - position: Vector2(size.x - 100, 10), textRenderer: scoresPaint) - ..anchor = Anchor.topRight; - _distance.changePriorityWithoutResorting(OVERLAY_PRIORITY); - _coins = TextComponent(": 0", - position: Vector2(size.x - 20, 10), textRenderer: scoresPaint) - ..anchor = Anchor.topRight; - _coins.changePriorityWithoutResorting(OVERLAY_PRIORITY); - overlays.add("gameOver"); - overlays.remove('gameOver'); - overlays.add("mainMenu"); - overlays.add('loading'); - setUp(); - gameState.setPaused(); - startLoading = DateTime.now().microsecondsSinceEpoch; - } - - void playMusic() { - if (overlays.isActive('mainMenu')) { - FlameAudio.bgm.play('Infinite_Menu.mp3'); - } else { - FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); - } - playingMusic = true; - } - - void fillScreen() { - if (shouldReset) { - return; - } - int dangerLevel = gameState.getDangerLevel(); - - platformHolder.generatePlatforms(this); - - if (dangerLevel > 2) { - int wireChosenRegion = random.nextInt(9); - if (wireChosenRegion % 3 != 2 && - wireChosenRegion != 6 && - wireChosenRegion != 7) { - wireHolder.generateWire(this, wireChosenRegion); - } - } - - if (dangerLevel > 0) { - int bugChosenRegion = random.nextInt(9); - if (bugChosenRegion % 3 != 2 && bugChosenRegion % 3 != 0) { - bugHolder.generateBug(this, bugChosenRegion); - } - } - - if (dangerLevel > 1) { - int debrisChosenRegion = random.nextInt(9); - if (debrisChosenRegion % 3 == 0 && debrisChosenRegion != 6) { - debrisHolder.generateDebris(this, debrisChosenRegion); - } - } - - int choseCoinLevel = random.nextInt(9); - if (choseCoinLevel % 3 != 2 && choseCoinLevel != 6) { - coinHolder.generateCoin(this, choseCoinLevel); - } - - if (dangerLevel > 4) { - int wallChosenRegion = random.nextInt(9); - if (wallChosenRegion % 3 == 1 && wallChosenRegion != 7) { - wallHolder.generateWall(this, wallChosenRegion); - } - } - } - - bool isTooNearOtherObstacles(Rect rect) { - Rect obstacleBounds = Rect.fromLTRB( - 3 * rect.left - 2 * (rect.left + blockSize) - 1, - 3 * rect.top - 2 * (rect.top + blockSize) - 1, - 3 * (rect.left + blockSize) - 2 * rect.left + 1, - 3 * (rect.top + blockSize) - 2 * rect.top + 1); - for (List wireLevel in wireHolder.objects) { - for (MovingObject wire in wireLevel) { - if (wire.intersect(obstacleBounds) != "none") { - return true; - } - } - } - - for (List coinLevel in coinHolder.objects) { - for (MovingObject coin in coinLevel) { - if (coin.intersect(obstacleBounds) != "none") { - return true; - } - } - } - - for (List bugLevel in bugHolder.objects) { - for (MovingObject bug in bugLevel) { - if (bug.intersect(obstacleBounds) != "none") { - return true; - } - } - } - - for (List debrisLevel in debrisHolder.objects) { - for (MovingObject debris in debrisLevel) { - if (debris.intersect(obstacleBounds) != "none") { - return true; - } - } - } - - for (List wallLevel in wallHolder.objects) { - for (MovingObject wall in wallLevel) { - if (wall.intersect(obstacleBounds) != "none") { - return true; - } - } - } - - return false; - } - - bool shouldReset = false; - - // late Socket socket; - // void dataHandler(data) { - // print(new String.fromCharCodes(data).trim()); - // } - // - // void errorHandler(error, StackTrace trace) { - // print(error); - // } - // - // void doneHandler() { - // socket.destroy(); - // } - - // Future connectServer() async { - // try { - // Socket.connect('10.0.0.224', 50018).then((Socket sock) { - // socket = sock; - // socket.listen(dataHandler, - // onError: errorHandler, onDone: doneHandler, cancelOnError: false); - // }); - // } catch (e) { - // print(e); - // } - // // try { - // // final response = await http.post( - // // Uri.parse('http://10.0.0.224:50017'), - // // headers: { - // // 'Content-Type': 'application/json; charset=UTF-8', - // // }, - // // body: jsonEncode({ - // // 'title': "hi", - // // }), - // // ); - // // if (response.statusCode == 201) { - // // // If the server did return a 201 CREATED response, - // // // then parse the JSON. - // // print("hello"); - // // print(response); - // // print(response.body); - // // } else { - // // // If the server did not return a 201 CREATED response, - // // // then throw an exception. - // // throw Exception('Failed to create album.'); - // // } - // // // var value = await channel.stream.first; - // // // print(value); - // // } catch (e) { - // // print(e); - // // } - // } - - Future displayLoss() async { - if (!(runner.sprite.animation?.done() ?? false) && - runner.sprite.animation!.loop == false && - firstDeath) { - return; - } - // await connectServer(); - firstDeath = false; - overlays.add('gameOver'); - } - - void mainMenu() { - overlays.remove('gameOver'); - overlays.add('mainMenu'); - FlameAudio.bgm.stop(); - FlameAudio.bgm.play('Infinite_Menu.mp3'); - } - - void reset() { - runner.sprite.animation!.reset(); - overlays.remove('gameOver'); - overlays.remove('mainMenu'); - shouldReset = false; - components.clear(); - setUp(); - } - - void die() { - gameState.setPaused(); - shouldReset = true; - } - - void setUp() { - add(runner); - fireworks.setUp(); - runner.sprite.clearEffects(); - runner.sprite.current = RunnerState.run; - circuitBackground.setUp(); - platformHolder.setUp(); - coinHolder.setUp(); - wireHolder.setUp(); - bugHolder.setUp(); - debrisHolder.setUp(); - wallHolder.setUp(); - - gameState.setUp(this); - - runner.setUp(); - add(_coins); - add(_distance); - - fillScreen(); - platformHolder.objects[2][0].sprite.current = PlatformState.left; - platformHolder.objects[5][0].sprite.current = PlatformState.left; - } - - @override - void render(Canvas canvas) { - if (!overlays.isActive('mainMenu')) { - circuitBackground.render(canvas); - fireworks.renderText(canvas); - super.render(canvas); - // final fpsCount = fps(10000); - // fireworksPaint.render( - // canvas, - // fpsCount.toString(), - // Vector2(0, 0), - // ); - coinHolder.renderCoinScore(canvas); - } - } - - @override - void update(double dt) { - if (overlays.isActive('loading') && - (DateTime.now().microsecondsSinceEpoch - startLoading) > LOADING_TIME) { - overlays.remove('loading'); - if (!kIsWeb) { - playMusic(); - } - } - fireworks.update(dt); - platformHolder.removePast(this); - coinHolder.removePast(this); - wireHolder.removePast(this); - bugHolder.removePast(this); - debrisHolder.removePast(this); - wallHolder.removePast(this); - fillScreen(); - super.update(dt); - circuitBackground.update(dt); - gameState.update(dt); - platformHolder.update(dt); - coinHolder.update(dt); - wireHolder.update(dt); - bugHolder.update(dt); - debrisHolder.update(dt); - wallHolder.update(dt); - - _distance.text = "Time: ${gameState.getPlayerDistance()}"; - _coins.text = " ${gameState.numCoins}"; - if (shouldReset && - !overlays.isActive('gameOver') && - !overlays.isActive('mainMenu')) { - displayLoss(); - } - } - - @override - void onResize(Vector2 canvasSize) { - Vector2 oldSize = viewport.canvasSize; - super.onResize(canvasSize); - blockSize = canvasSize.y / 9; - if (loaded) { - double xRatio = canvasSize.x / oldSize.x; - double yRatio = canvasSize.y / oldSize.y; - circuitBackground.resize(canvasSize, xRatio, yRatio); - runner.resize(canvasSize, xRatio, yRatio); - platformHolder.resize(canvasSize, xRatio, yRatio); - coinHolder.resize(canvasSize, xRatio, yRatio); - wireHolder.resize(canvasSize, xRatio, yRatio); - bugHolder.resize(canvasSize, xRatio, yRatio); - debrisHolder.resize(canvasSize, xRatio, yRatio); - wallHolder.resize(canvasSize, xRatio, yRatio); - fireworks.resize(canvasSize, xRatio, yRatio); - } - } - - // Mobile controls - late List xDeltas; - late List yDeltas; - @override - void onPanStart(DragStartInfo info) { - xDeltas = List.empty(growable: true); - yDeltas = List.empty(growable: true); - } - - bool action = false; - - @override - void onPanUpdate(DragUpdateInfo info) { - xDeltas.add(info.delta.game.x); - yDeltas.add(info.delta.game.y); - if (xDeltas.length > 2 && !action) { - action = true; - if (!playingMusic && kIsWeb) { - playMusic(); - } - double xDelta = xDeltas.isEmpty - ? 0 - : xDeltas.reduce((value, element) => value + element); - double yDelta = yDeltas.isEmpty - ? 0 - : yDeltas.reduce((value, element) => value + element); - if (xDelta.abs() > yDelta.abs()) { - if (xDelta > 0) { - runner.control("right"); - } else { - runner.control("left"); - } - } else if (xDelta.abs() < yDelta.abs()) { - if (yDelta > 0) { - runner.control("down"); - } else { - runner.control("up"); - } - } - xDeltas = List.empty(growable: true); - yDeltas = List.empty(growable: true); - } - } - - @override - void onPanEnd(DragEndInfo info) { - action = false; - xDeltas = List.empty(growable: true); - yDeltas = List.empty(growable: true); - } - - @override - void onTap() { - if (!playingMusic && kIsWeb) { - playMusic(); - } - runner.control("center"); - } - - // Keyboard controls. - var keyboardKey; - @override - void onKeyEvent(RawKeyEvent event) { - if (!playingMusic && kIsWeb) { - playMusic(); - } - if (event is RawKeyDownEvent) { - action = true; - keyboardKey = null; - switch (event.data.logicalKey.keyId) { - case 4294968068: - case 119: - case 87: - // case "w": - runner.control("up"); - break; - case 4294968066: - case 97: - case 65: - // case "a": - runner.control("left"); - break; - case 4294968065: - case 115: - case 83: - // case "s": - runner.control("down"); - break; - case 4294968067: - case 100: - case 68: - // case "d": - runner.control("right"); - break; - default: - break; - } - } - - if (event is RawKeyUpEvent) { - action = false; - } - } -} +import 'dart:async'; +import 'dart:convert'; +import 'dart:io'; +import 'dart:math'; + +import 'package:firo_runner/bug_holder.dart'; +import 'package:firo_runner/circuit_background.dart'; +import 'package:firo_runner/coin_holder.dart'; +import 'package:firo_runner/debris_holder.dart'; +import 'package:firo_runner/firework.dart'; +import 'package:firo_runner/game_state.dart'; +import 'package:firo_runner/moving_object.dart'; +import 'package:firo_runner/platform.dart'; +import 'package:firo_runner/platform_holder.dart'; +import 'package:firo_runner/wall_holder.dart'; +import 'package:firo_runner/wire.dart'; +import 'package:firo_runner/wire_holder.dart'; +import 'package:flame/components.dart'; +import 'package:flame/extensions.dart'; +import 'package:flame/flame.dart'; +import 'package:flame/game.dart'; +import 'package:flame/gestures.dart'; +import 'package:flame/keyboard.dart'; +import 'package:flame_audio/flame_audio.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:firo_runner/runner.dart'; +import 'package:flutter/foundation.dart' show kIsWeb; +import 'package:http/http.dart' as http; + +import 'package:firo_runner/lose_menu_overlay.dart'; +import 'package:firo_runner/main_menu_overlay.dart'; + +const COLOR = Color(0xFFDDC0A3); +const int LOADING_TIME = 2000000; + +const LEVEL2 = 25000000; +const LEVEL3 = 50000000; +const LEVEL4 = 75000000; +const LEVEL5 = 100000000; +const LEVEL6 = 125000000; +const LEVEL7 = 150000000; + +const COINS_ROBOT_UPGRADE1 = 50; +const COINS_ROBOT_UPGRADE2 = 100; + +const OVERLAY_PRIORITY = 110; +const RUNNER_PRIORITY = 100; +const BUG_PRIORITY = 75; +const COIN_PRIORITY = 70; +const PLATFORM_PRIORITY = 50; +const WALL_PRIORITY = 40; +const DEBRIS_PRIORITY = 30; +const WIRE_PRIORITY = 25; +const FIREWORK_PRIORITY = 15; +const WINDOW_PRIORITY = 10; + +// const overlayText = TextStyle( +// fontSize: 30, +// color: Colors.white, +// ); + +const AssetImage mainMenuImage = AssetImage('assets/images/mm3.gif'); +const AssetImage lossImage = AssetImage('assets/images/overlay100.png'); +const AssetImage buttonImage = AssetImage('assets/images/button-new.png'); + +void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Flame.device.fullScreen(); + await Flame.device.setLandscape(); + final myGame = MyGame(); + runApp(MaterialApp( + debugShowCheckedModeBanner: false, + home: GameWidget( + game: myGame, + overlayBuilderMap: { + // Should be used once before all overlays are called. Flame has a slight + // delay when constructing the overlay widgets, so to make the text and + // images load together, all the other overlays should be called in the + // load section, and removed, and the loading black screen should be kept + // up until everything is finished loading. + 'loading': (_, myGame) { + return Center( + child: Container( + height: myGame.viewport.canvasSize.y, + width: myGame.viewport.canvasSize.x, + color: Colors.black, + ), + ); + }, + 'mainMenu': (_, myGame) { + return MainMenuOverlay(game: myGame); + }, + 'gameOver': (_, myGame) { + return LoseMenuOverlay(game: myGame); + }, + }, + ))); +} + +int getNearestPlatform(int level) { + return level <= 0 + ? 0 + : level <= 3 + ? 2 + : level <= 6 + ? 5 + : 8; +} + +class MyGame extends BaseGame with PanDetector, TapDetector, KeyboardEvents { + TextPaint fireworksPaint = TextPaint( + config: const TextPaintConfig( + fontSize: 48.0, fontFamily: 'Codystar', color: COLOR), + ); + + TextPaint scoresPaint = TextPaint( + config: const TextPaintConfig(fontSize: 16.0, color: COLOR), + ); + + late CircuitBackground circuitBackground; + late PlatformHolder platformHolder; + late CoinHolder coinHolder; + late WireHolder wireHolder; + late BugHolder bugHolder; + late Firework fireworks; + late DebrisHolder debrisHolder; + late WallHolder wallHolder; + Random random = Random(); + bool playingMusic = false; + + late Runner runner; + late GameState gameState; + late double blockSize; + + bool loaded = false; + bool firstDeath = true; + late Wire wire; + late TextComponent _distance; + late TextComponent _coins; + int startLoading = 0; + + MyGame() : super() { + viewport.resize(Vector2(1920, 1080)); + } + + @override + Future onLoad() async { + // debugMode = true; + FlameAudio.bgm.initialize(); + + await FlameAudio.audioCache.loadAll([ + 'sfx/bug_chomp.mp3', + 'sfx/coin_catch.mp3', + 'sfx/fall_death.mp3', + 'sfx/glitch_death.mp3', + 'sfx/jet_boost.mp3', + 'sfx/menu_button.mp3', + 'sfx/obstacle_death.mp3', + 'sfx/robot_friend_beep.mp3', + 'Infinite_Menu.mp3', + 'Infinite_Spankage_M.mp3', + ]); + + circuitBackground = CircuitBackground(this); + await circuitBackground.load(); + platformHolder = PlatformHolder(); + await platformHolder.load(); + coinHolder = CoinHolder(); + coinHolder.setPersonalGameRef(this); + await coinHolder.load(); + wireHolder = WireHolder(); + await wireHolder.load(); + bugHolder = BugHolder(); + await bugHolder.load(); + debrisHolder = DebrisHolder(); + await debrisHolder.load(); + wallHolder = WallHolder(); + await wallHolder.load(); + fireworks = Firework(this); + await fireworks.load(); + + gameState = GameState(); + + runner = Runner(); + await runner.load(); + + loaded = true; + _distance = TextComponent("Time: 0", + position: Vector2(size.x - 100, 10), textRenderer: scoresPaint) + ..anchor = Anchor.topRight; + _distance.changePriorityWithoutResorting(OVERLAY_PRIORITY); + _coins = TextComponent(": 0", + position: Vector2(size.x - 20, 10), textRenderer: scoresPaint) + ..anchor = Anchor.topRight; + _coins.changePriorityWithoutResorting(OVERLAY_PRIORITY); + overlays.add("gameOver"); + overlays.remove('gameOver'); + overlays.add("mainMenu"); + overlays.add('loading'); + setUp(); + gameState.setPaused(); + startLoading = DateTime.now().microsecondsSinceEpoch; + } + + void playMusic() { + if (overlays.isActive('mainMenu')) { + FlameAudio.bgm.play('Infinite_Menu.mp3'); + } else { + FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); + } + playingMusic = true; + } + + void fillScreen() { + if (shouldReset) { + return; + } + int dangerLevel = gameState.getDangerLevel(); + + platformHolder.generatePlatforms(this); + + if (dangerLevel > 2) { + int wireChosenRegion = random.nextInt(9); + if (wireChosenRegion % 3 != 2 && + wireChosenRegion != 6 && + wireChosenRegion != 7) { + wireHolder.generateWire(this, wireChosenRegion); + } + } + + if (dangerLevel > 0) { + int bugChosenRegion = random.nextInt(9); + if (bugChosenRegion % 3 != 2 && bugChosenRegion % 3 != 0) { + bugHolder.generateBug(this, bugChosenRegion); + } + } + + if (dangerLevel > 1) { + int debrisChosenRegion = random.nextInt(9); + if (debrisChosenRegion % 3 == 0 && debrisChosenRegion != 6) { + debrisHolder.generateDebris(this, debrisChosenRegion); + } + } + + int choseCoinLevel = random.nextInt(9); + if (choseCoinLevel % 3 != 2 && choseCoinLevel != 6) { + coinHolder.generateCoin(this, choseCoinLevel); + } + + if (dangerLevel > 4) { + int wallChosenRegion = random.nextInt(9); + if (wallChosenRegion % 3 == 1 && wallChosenRegion != 7) { + wallHolder.generateWall(this, wallChosenRegion); + } + } + } + + bool isTooNearOtherObstacles(Rect rect) { + Rect obstacleBounds = Rect.fromLTRB( + 3 * rect.left - 2 * (rect.left + blockSize) - 1, + 3 * rect.top - 2 * (rect.top + blockSize) - 1, + 3 * (rect.left + blockSize) - 2 * rect.left + 1, + 3 * (rect.top + blockSize) - 2 * rect.top + 1); + for (List wireLevel in wireHolder.objects) { + for (MovingObject wire in wireLevel) { + if (wire.intersect(obstacleBounds) != "none") { + return true; + } + } + } + + for (List coinLevel in coinHolder.objects) { + for (MovingObject coin in coinLevel) { + if (coin.intersect(obstacleBounds) != "none") { + return true; + } + } + } + + for (List bugLevel in bugHolder.objects) { + for (MovingObject bug in bugLevel) { + if (bug.intersect(obstacleBounds) != "none") { + return true; + } + } + } + + for (List debrisLevel in debrisHolder.objects) { + for (MovingObject debris in debrisLevel) { + if (debris.intersect(obstacleBounds) != "none") { + return true; + } + } + } + + for (List wallLevel in wallHolder.objects) { + for (MovingObject wall in wallLevel) { + if (wall.intersect(obstacleBounds) != "none") { + return true; + } + } + } + + return false; + } + + bool shouldReset = false; + + // late Socket socket; + // void dataHandler(data) { + // print(new String.fromCharCodes(data).trim()); + // } + // + // void errorHandler(error, StackTrace trace) { + // print(error); + // } + // + // void doneHandler() { + // socket.destroy(); + // } + + // Future connectServer() async { + // try { + // Socket.connect('10.0.0.224', 50018).then((Socket sock) { + // socket = sock; + // socket.listen(dataHandler, + // onError: errorHandler, onDone: doneHandler, cancelOnError: false); + // }); + // } catch (e) { + // print(e); + // } + // // try { + // // final response = await http.post( + // // Uri.parse('http://10.0.0.224:50017'), + // // headers: { + // // 'Content-Type': 'application/json; charset=UTF-8', + // // }, + // // body: jsonEncode({ + // // 'title': "hi", + // // }), + // // ); + // // if (response.statusCode == 201) { + // // // If the server did return a 201 CREATED response, + // // // then parse the JSON. + // // print("hello"); + // // print(response); + // // print(response.body); + // // } else { + // // // If the server did not return a 201 CREATED response, + // // // then throw an exception. + // // throw Exception('Failed to create album.'); + // // } + // // // var value = await channel.stream.first; + // // // print(value); + // // } catch (e) { + // // print(e); + // // } + // } + + Future displayLoss() async { + if (!(runner.sprite.animation?.done() ?? false) && + runner.sprite.animation!.loop == false && + firstDeath) { + return; + } + // await connectServer(); + firstDeath = false; + overlays.add('gameOver'); + } + + void mainMenu() { + overlays.remove('gameOver'); + overlays.add('mainMenu'); + FlameAudio.bgm.stop(); + FlameAudio.bgm.play('Infinite_Menu.mp3'); + } + + void reset() { + runner.sprite.animation!.reset(); + overlays.remove('gameOver'); + overlays.remove('mainMenu'); + shouldReset = false; + components.clear(); + setUp(); + } + + void die() { + gameState.setPaused(); + shouldReset = true; + } + + void setUp() { + add(runner); + fireworks.setUp(); + runner.sprite.clearEffects(); + runner.sprite.current = RunnerState.run; + circuitBackground.setUp(); + platformHolder.setUp(); + coinHolder.setUp(); + wireHolder.setUp(); + bugHolder.setUp(); + debrisHolder.setUp(); + wallHolder.setUp(); + + gameState.setUp(this); + + runner.setUp(); + add(_coins); + add(_distance); + + fillScreen(); + platformHolder.objects[2][0].sprite.current = PlatformState.left; + platformHolder.objects[5][0].sprite.current = PlatformState.left; + } + + @override + void render(Canvas canvas) { + if (!overlays.isActive('mainMenu')) { + circuitBackground.render(canvas); + fireworks.renderText(canvas); + super.render(canvas); + // final fpsCount = fps(10000); + // fireworksPaint.render( + // canvas, + // fpsCount.toString(), + // Vector2(0, 0), + // ); + coinHolder.renderCoinScore(canvas); + } + } + + @override + void update(double dt) { + if (overlays.isActive('loading') && + (DateTime.now().microsecondsSinceEpoch - startLoading) > LOADING_TIME) { + overlays.remove('loading'); + if (!kIsWeb) { + playMusic(); + } + } + fireworks.update(dt); + platformHolder.removePast(this); + coinHolder.removePast(this); + wireHolder.removePast(this); + bugHolder.removePast(this); + debrisHolder.removePast(this); + wallHolder.removePast(this); + fillScreen(); + super.update(dt); + circuitBackground.update(dt); + gameState.update(dt); + platformHolder.update(dt); + coinHolder.update(dt); + wireHolder.update(dt); + bugHolder.update(dt); + debrisHolder.update(dt); + wallHolder.update(dt); + + _distance.text = "Time: ${gameState.getPlayerDistance()}"; + _coins.text = " ${gameState.numCoins}"; + if (shouldReset && + !overlays.isActive('gameOver') && + !overlays.isActive('mainMenu')) { + displayLoss(); + } + } + + @override + void onResize(Vector2 canvasSize) { + Vector2 oldSize = viewport.canvasSize; + super.onResize(canvasSize); + blockSize = canvasSize.y / 9; + if (loaded) { + double xRatio = canvasSize.x / oldSize.x; + double yRatio = canvasSize.y / oldSize.y; + circuitBackground.resize(canvasSize, xRatio, yRatio); + runner.resize(canvasSize, xRatio, yRatio); + platformHolder.resize(canvasSize, xRatio, yRatio); + coinHolder.resize(canvasSize, xRatio, yRatio); + wireHolder.resize(canvasSize, xRatio, yRatio); + bugHolder.resize(canvasSize, xRatio, yRatio); + debrisHolder.resize(canvasSize, xRatio, yRatio); + wallHolder.resize(canvasSize, xRatio, yRatio); + fireworks.resize(canvasSize, xRatio, yRatio); + } + } + + // Mobile controls + late List xDeltas; + late List yDeltas; + @override + void onPanStart(DragStartInfo info) { + xDeltas = List.empty(growable: true); + yDeltas = List.empty(growable: true); + } + + bool action = false; + + @override + void onPanUpdate(DragUpdateInfo info) { + xDeltas.add(info.delta.game.x); + yDeltas.add(info.delta.game.y); + if (xDeltas.length > 2 && !action) { + action = true; + if (!playingMusic && kIsWeb) { + playMusic(); + } + double xDelta = xDeltas.isEmpty + ? 0 + : xDeltas.reduce((value, element) => value + element); + double yDelta = yDeltas.isEmpty + ? 0 + : yDeltas.reduce((value, element) => value + element); + if (xDelta.abs() > yDelta.abs()) { + if (xDelta > 0) { + runner.control("right"); + } else { + runner.control("left"); + } + } else if (xDelta.abs() < yDelta.abs()) { + if (yDelta > 0) { + runner.control("down"); + } else { + runner.control("up"); + } + } + xDeltas = List.empty(growable: true); + yDeltas = List.empty(growable: true); + } + } + + @override + void onPanEnd(DragEndInfo info) { + action = false; + xDeltas = List.empty(growable: true); + yDeltas = List.empty(growable: true); + } + + @override + void onTap() { + if (!playingMusic && kIsWeb) { + playMusic(); + } + runner.control("center"); + } + + // Keyboard controls. + var keyboardKey; + @override + void onKeyEvent(RawKeyEvent event) { + if (!playingMusic && kIsWeb) { + playMusic(); + } + if (event is RawKeyDownEvent) { + action = true; + keyboardKey = null; + switch (event.data.logicalKey.keyId) { + case 4294968068: + case 119: + case 87: + // case "w": + runner.control("up"); + break; + case 4294968066: + case 97: + case 65: + // case "a": + runner.control("left"); + break; + case 4294968065: + case 115: + case 83: + // case "s": + runner.control("down"); + break; + case 4294968067: + case 100: + case 68: + // case "d": + runner.control("right"); + break; + default: + break; + } + } + + if (event is RawKeyUpEvent) { + action = false; + } + } +} diff --git a/lib/main_menu_overlay.dart b/lib/main_menu_overlay.dart index b55c677..78b72d3 100644 --- a/lib/main_menu_overlay.dart +++ b/lib/main_menu_overlay.dart @@ -1,148 +1,148 @@ -import 'package:flame_audio/flame_audio.dart'; -import 'package:flutter/material.dart'; - -import 'main.dart'; - -class MainMenuOverlay extends StatelessWidget { - const MainMenuOverlay({ - Key? key, - required this.game, - }) : super(key: key); - - final MyGame game; - - @override - Widget build(BuildContext context) { - double width = MediaQuery.of(context).size.width; - return Center( - child: Container( - height: game.viewport.canvasSize.y, - width: game.viewport.canvasSize.x, - decoration: const BoxDecoration( - image: DecorationImage( - image: mainMenuImage, - fit: BoxFit.fitWidth, - ), - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - // const SizedBox( - // height: 32.0, - // ), - // const SizedBox( - // height: 32.0, - // ), - // const SizedBox( - // height: 32.0, - // ), - MaterialButton( - padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), - textColor: Colors.white, - splashColor: Colors.greenAccent, - elevation: 8.0, - child: Container( - decoration: const BoxDecoration( - image: - DecorationImage(image: buttonImage, fit: BoxFit.fill), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - " START ", - style: TextStyle( - color: Colors.cyan, - fontSize: width * 0.03, - ), - ), - ), - ), - // ), - onPressed: () async { - // Go to the Main Menu - FlameAudio.audioCache.play('sfx/menu_button.mp3'); - game.reset(); - FlameAudio.bgm.stop(); - FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); - game.runner.friend = await FlameAudio.audioCache - .loop('sfx/robot_friend_beep.mp3'); - }, - ), - // MaterialButton( - // padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), - // textColor: Colors.white, - // splashColor: Colors.greenAccent, - // elevation: 8.0, - // child: Container( - // decoration: const BoxDecoration( - // image: - // DecorationImage(image: buttonImage, fit: BoxFit.fill), - // ), - // child: Padding( - // padding: EdgeInsets.all(8.0), - // child: Text( - // " DEPOSIT ", - // style: TextStyle( - // color: Colors.cyan, - // fontSize: width * 0.03, - // ), - // ), - // ), - // ), - // // ), - // onPressed: () { - // // Show QR code - // }, - // ), - // MaterialButton( - // padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), - // textColor: Colors.white, - // splashColor: Colors.greenAccent, - // elevation: 8.0, - // child: Container( - // decoration: const BoxDecoration( - // image: - // DecorationImage(image: buttonImage, fit: BoxFit.fill), - // ), - // child: Padding( - // padding: EdgeInsets.all(8.0), - // child: Text( - // " LEADER BOARD ", - // style: TextStyle( - // color: Colors.cyan, - // fontSize: width * 0.03, - // ), - // ), - // ), - // ), - // // ), - // onPressed: () { - // // Show QR code - // }, - // ), - ], - ), - const SizedBox( - width: 32.0, - ), - const SizedBox( - width: 32.0, - ), - const SizedBox( - width: 32.0, - ), - const SizedBox( - width: 32.0, - ), - ], - ), - ), - ); - } -} +import 'package:flame_audio/flame_audio.dart'; +import 'package:flutter/material.dart'; + +import 'main.dart'; + +class MainMenuOverlay extends StatelessWidget { + const MainMenuOverlay({ + Key? key, + required this.game, + }) : super(key: key); + + final MyGame game; + + @override + Widget build(BuildContext context) { + double width = MediaQuery.of(context).size.width; + return Center( + child: Container( + height: game.viewport.canvasSize.y, + width: game.viewport.canvasSize.x, + decoration: const BoxDecoration( + image: DecorationImage( + image: mainMenuImage, + fit: BoxFit.fitWidth, + ), + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + // const SizedBox( + // height: 32.0, + // ), + // const SizedBox( + // height: 32.0, + // ), + // const SizedBox( + // height: 32.0, + // ), + MaterialButton( + padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), + textColor: Colors.white, + splashColor: Colors.greenAccent, + elevation: 8.0, + child: Container( + decoration: const BoxDecoration( + image: + DecorationImage(image: buttonImage, fit: BoxFit.fill), + ), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + " START ", + style: TextStyle( + color: Colors.cyan, + fontSize: width * 0.03, + ), + ), + ), + ), + // ), + onPressed: () async { + // Go to the Main Menu + FlameAudio.audioCache.play('sfx/menu_button.mp3'); + game.reset(); + FlameAudio.bgm.stop(); + FlameAudio.bgm.play('Infinite_Spankage_M.mp3'); + game.runner.friend = await FlameAudio.audioCache + .loop('sfx/robot_friend_beep.mp3'); + }, + ), + // MaterialButton( + // padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), + // textColor: Colors.white, + // splashColor: Colors.greenAccent, + // elevation: 8.0, + // child: Container( + // decoration: const BoxDecoration( + // image: + // DecorationImage(image: buttonImage, fit: BoxFit.fill), + // ), + // child: Padding( + // padding: EdgeInsets.all(8.0), + // child: Text( + // " DEPOSIT ", + // style: TextStyle( + // color: Colors.cyan, + // fontSize: width * 0.03, + // ), + // ), + // ), + // ), + // // ), + // onPressed: () { + // // Show QR code + // }, + // ), + // MaterialButton( + // padding: const EdgeInsets.fromLTRB(8, 8, 8, 8), + // textColor: Colors.white, + // splashColor: Colors.greenAccent, + // elevation: 8.0, + // child: Container( + // decoration: const BoxDecoration( + // image: + // DecorationImage(image: buttonImage, fit: BoxFit.fill), + // ), + // child: Padding( + // padding: EdgeInsets.all(8.0), + // child: Text( + // " LEADER BOARD ", + // style: TextStyle( + // color: Colors.cyan, + // fontSize: width * 0.03, + // ), + // ), + // ), + // ), + // // ), + // onPressed: () { + // // Show QR code + // }, + // ), + ], + ), + const SizedBox( + width: 32.0, + ), + const SizedBox( + width: 32.0, + ), + const SizedBox( + width: 32.0, + ), + const SizedBox( + width: 32.0, + ), + ], + ), + ), + ); + } +} diff --git a/lib/runner.dart b/lib/runner.dart index 94303f7..a224e32 100644 --- a/lib/runner.dart +++ b/lib/runner.dart @@ -1,645 +1,645 @@ -import 'package:flame/extensions.dart'; -import 'package:firo_runner/bug.dart'; -import 'package:firo_runner/moving_object.dart'; -import 'package:firo_runner/main.dart'; -import 'package:flame/effects.dart'; -import 'package:flame/flame.dart'; -import 'dart:math'; - -import 'package:flame/components.dart'; -import 'package:flame/image_composition.dart'; -import 'package:flame_audio/flame_audio.dart'; -import 'package:flutter/animation.dart'; - -enum RunnerState { - run, - jump, - duck, - duck2, - duck3, - kick, - kick2, - kick3, - float, - float2, - float3, - fall, - die, - electrocute, - glitch, -} - -class Runner extends Component with HasGameRef { - late SpriteAnimationGroupComponent sprite; - String runnerState = "run"; - int level = 4; - String previousState = "run"; - var runnerPosition = Vector2(0, 0); - late Vector2 runnerSize; - bool dead = false; - late var boost = null; - late var friend = null; - - void setUp() { - dead = false; - runnerState = "run"; - previousState = "run"; - level = 4; - - runnerSize = Vector2( - gameRef.size.y / 9, - gameRef.size.y / 9, - ); - - setSize(runnerSize, gameRef.blockSize); - runnerPosition = Vector2(gameRef.blockSize * 2, gameRef.blockSize * 4); - setPosition(runnerPosition); - } - - void setPosition(Vector2 position) { - sprite.position = position; - } - - void setSize(Vector2 size, double ySize) { - sprite.size = size; - } - - Sprite getSprite() { - return sprite.animation!.getSprite(); - } - - @override - void render(Canvas c) { - super.render(c); - getSprite().render(c, - position: Vector2(sprite.position.x - sprite.size.x / 3, - sprite.position.y - sprite.size.y / 3), - size: sprite.size * 1.6); - } - - void updateLevel() { - level = (sprite.position.y / gameRef.blockSize).round(); - } - - Future event(String event) async { - if (gameRef.gameState.isPaused) { - return; - } - sprite.animation!.reset(); - switch (event) { - case "jump": - previousState = runnerState; - runnerState = event; - sprite.current = RunnerState.jump; - sprite.addEffect(MoveEffect( - path: [ - // sprite.position, - Vector2(sprite.x, (level - 1) * gameRef.blockSize), - ], - duration: 0.15, - curve: Curves.bounceIn, - onComplete: () { - updateLevel(); - this.event("float"); - }, - )); - break; - case "double_jump": - if (belowPlatform()) { - break; - } - previousState = runnerState; - clearEffects(); - if (level - 1 < 0) { - break; - } - runnerState = event; - switch (gameRef.gameState.getRobotLevel()) { - case 3: - sprite.current = RunnerState.float3; - break; - case 2: - sprite.current = RunnerState.float2; - break; - default: - sprite.current = RunnerState.float; - break; - } - sprite.addEffect(MoveEffect( - path: [ - Vector2(sprite.x, (level - 2) * gameRef.blockSize), - ], - duration: 0.20, - curve: Curves.ease, - onComplete: () { - updateLevel(); - clearEffects(); - if (onTopOfPlatform()) { - this.event("run"); - } else { - this.event("float"); - } - }, - )); - break; - case "fall": - previousState = runnerState; - clearEffects(); - runnerState = event; - sprite.current = RunnerState.fall; - sprite.addEffect(getFallingEffect()); - break; - case "kick": - previousState = runnerState; - runnerState = event; - switch (gameRef.gameState.getRobotLevel()) { - case 3: - sprite.current = RunnerState.kick3; - break; - case 2: - sprite.current = RunnerState.kick2; - break; - default: - sprite.current = RunnerState.kick; - break; - } - break; - case "run": - previousState = runnerState; - runnerState = event; - sprite.current = RunnerState.run; - break; - case "float": - previousState = runnerState; - runnerState = event; - switch (gameRef.gameState.getRobotLevel()) { - case 3: - sprite.current = RunnerState.float3; - break; - case 2: - sprite.current = RunnerState.float2; - break; - default: - sprite.current = RunnerState.float; - break; - } - boost = await FlameAudio.audioCache.play('sfx/jet_boost.mp3'); - sprite.addEffect(MoveEffect( - path: [sprite.position], - duration: 1.5, - curve: Curves.ease, - onComplete: () { - updateLevel(); - boost.stop(); - if (onTopOfPlatform()) { - this.event("run"); - } else { - this.event("fall"); - } - }, - )); - break; - case "duck": - previousState = runnerState; - runnerState = event; - switch (gameRef.gameState.getRobotLevel()) { - case 3: - sprite.current = RunnerState.duck3; - break; - case 2: - sprite.current = RunnerState.duck2; - break; - default: - sprite.current = RunnerState.duck; - break; - } - sprite.addEffect(MoveEffect( - path: [sprite.position], - duration: 1.5, - curve: Curves.linear, - onComplete: () { - this.event("run"); - }, - )); - break; - case "die": - if (dead) { - return; - } - await FlameAudio.audioCache.play('sfx/fall_death.mp3'); - previousState = runnerState; - clearEffects(); - runnerState = event; - sprite.current = RunnerState.die; - dead = true; - friend.stop(); - gameRef.die(); - sprite.addEffect(getFallingEffect()); - break; - case "electrocute": - if (dead) { - return; - } - await FlameAudio.audioCache.play('sfx/fall_death.mp3'); - previousState = runnerState; - clearEffects(); - runnerState = event; - sprite.current = RunnerState.electrocute; - dead = true; - friend.stop(); - gameRef.die(); - sprite.addEffect(getFallingEffect()); - break; - case "glitch": - if (dead) { - return; - } - await FlameAudio.play('sfx/glitch_death.mp3'); - previousState = runnerState; - clearEffects(); - runnerState = event; - sprite.current = RunnerState.glitch; - dead = true; - friend.stop(); - gameRef.die(); - break; - default: - break; - } - } - - MoveEffect getFallingEffect() { - for (int i = level; i < 9; i++) { - if (i % 3 != 2) { - continue; - } - int distance = (i - 1 - level); - double time = 0.2; - for (int x = 2; x < distance; x++) { - time += time * pow(0.5, x - 1); - } - double estimatedXCoordinate = - time * gameRef.gameState.getVelocity() + sprite.x; - for (MovingObject p in gameRef.platformHolder.objects[i]) { - if (estimatedXCoordinate >= p.sprite.x - p.sprite.width / 2 && - estimatedXCoordinate <= p.sprite.x + p.sprite.width) { - return MoveEffect( - path: [ - Vector2(sprite.x, (i - 1) * gameRef.blockSize), - ], - duration: time, - curve: Curves.ease, - onComplete: () { - updateLevel(); - if (onTopOfPlatform()) { - event("run"); - } else { - event("fall"); - } - }, - ); - } - } - } - return MoveEffect( - path: [ - Vector2(sprite.x, 8 * gameRef.blockSize), - ], - duration: 0.2 * (8 - level), - curve: Curves.ease, - onComplete: () { - updateLevel(); - if (onTopOfPlatform()) { - event("run"); - } else { - event("fall"); - } - }, - ); - } - - void control(String input) { - if (gameRef.gameState.isPaused) { - return; - } - switch (input) { - case "up": - if (runnerState == "run" || runnerState == "kick") { - event("jump"); - } else if (runnerState == "float" && previousState == "jump") { - event("double_jump"); - } else if (runnerState == "duck") { - clearEffects(); - event("run"); - } - break; - case "down": - if (runnerState == "run" || runnerState == "kick") { - event("duck"); - } else if (runnerState == "float" && onTopOfPlatform()) { - clearEffects(); - event("run"); - } else if (runnerState == "float") { - clearEffects(); - event("fall"); - } - break; - case "right": - if (runnerState == "run" || runnerState == "kick") { - event("kick"); - } - break; - case "left": - if (runnerState == "kick") { - sprite.animation!.reset(); - clearEffects(); - event("run"); - } - break; - } - } - - @override - void update(double dt) { - super.update(dt); - if (sprite.position.y + sprite.size.y >= gameRef.size.y) { - event("die"); - } - // If the animation is finished - if (sprite.animation?.done() ?? false) { - if (!dead) { - sprite.animation!.reset(); - if (runnerState == "kick") { - event("run"); - } - sprite.current = RunnerState.run; - } - } - - if (runnerState == "float" || runnerState == "double_jump") { - if (onTopOfPlatform()) { - updateLevel(); - clearEffects(); - event("run"); - } - } - - intersecting(); - sprite.update(dt); - } - - bool onTopOfPlatform() { - Rect runnerRect = sprite.toRect(); - bool onTopOfPlatform = false; - for (List platformLevel in gameRef.platformHolder.objects) { - for (MovingObject p in platformLevel) { - String side = p.intersect(runnerRect); - if (side == "none") { - Rect belowRunner = Rect.fromLTRB(runnerRect.left, runnerRect.top, - runnerRect.right, runnerRect.bottom + 1); - if (p.intersect(belowRunner) != "none") { - onTopOfPlatform = true; - } - } - } - } - return onTopOfPlatform; - } - - bool belowPlatform() { - Rect runnerRect = Rect.fromLTRB( - sprite.toRect().left, - sprite.toRect().top, - sprite.toRect().right - sprite.toRect().width / 2, - sprite.toRect().bottom); - bool belowPlatform = false; - for (List platformLevel in gameRef.platformHolder.objects) { - for (MovingObject p in platformLevel) { - String side = p.intersect(runnerRect); - if (side == "none") { - Rect belowRunner = Rect.fromLTRB(runnerRect.left, runnerRect.top - 1, - runnerRect.right, runnerRect.bottom); - if (p.intersect(belowRunner) == "bottom") { - belowPlatform = true; - } - } - } - } - return belowPlatform; - } - - Future intersecting() async { - if (gameRef.gameState.isPaused) { - return; - } - Rect runnerRect = sprite.toRect(); - bool onTopOfPlatform = this.onTopOfPlatform(); - - for (List coinLevel in gameRef.coinHolder.objects) { - for (int i = 0; i < coinLevel.length;) { - if (coinLevel[i].intersect(runnerRect) != "none") { - gameRef.gameState.numCoins++; - await FlameAudio.audioCache.play('sfx/coin_catch.mp3'); - gameRef.coinHolder.remove(coinLevel, i); - continue; - } - i++; - } - } - - for (List wireLevel in gameRef.wireHolder.objects) { - for (int i = 0; i < wireLevel.length; i++) { - if (wireLevel[i].intersect(runnerRect) != "none") { - event("electrocute"); - return; - } - } - } - - for (List bugLevel in gameRef.bugHolder.objects) { - for (int i = 0; i < bugLevel.length; i++) { - String intersectState = bugLevel[i].intersect(runnerRect); - if (bugLevel[i].sprite.current == BugState.breaking) { - continue; - } - if (intersectState == "none") { - Rect above = Rect.fromLTRB( - runnerRect.left + sprite.width / 3, - runnerRect.top - 1, - runnerRect.right - sprite.width / 3, - runnerRect.bottom); - String aboveIntersect = bugLevel[i].intersect(above); - if (aboveIntersect != "none" && - (runnerState == "duck" || runnerState == "float")) { - continue; - } else if (aboveIntersect != "none") { - event("glitch"); - return; - } - } else if (intersectState == "left" && runnerState == "kick") { - await FlameAudio.audioCache.play('sfx/bug_chomp.mp3'); - bugLevel[i].sprite.current = BugState.breaking; - gameRef.coinHolder.generateCoin(gameRef, level, - force: true, xPosition: bugLevel[i].sprite.x + gameRef.blockSize); - } else { - event("glitch"); - return; - } - } - } - - for (List debrisLevel in gameRef.debrisHolder.objects) { - for (int i = 0; i < debrisLevel.length; i++) { - Rect slim = Rect.fromLTRB( - runnerRect.left + sprite.width / 3, - runnerRect.top, - runnerRect.right - sprite.width / 3, - runnerRect.bottom); - String intersectState = debrisLevel[i].intersect(slim); - if (intersectState == "none") { - continue; - } else if (runnerState == "duck" && intersectState != "above") { - continue; - } else { - await FlameAudio.audioCache.play('sfx/obstacle_death.mp3'); - event("die"); - } - } - } - - for (List wallLevel in gameRef.wallHolder.objects) { - for (int i = 0; i < wallLevel.length; i++) { - Rect slim = Rect.fromLTRB( - runnerRect.left + sprite.width / 3, - runnerRect.top + sprite.height / (runnerState == "duck" ? 3 : 6), - runnerRect.right - sprite.width / 3, - runnerRect.bottom - sprite.height / 3); - String intersectState = wallLevel[i].intersect(slim); - if (intersectState == "none") { - continue; - } else { - await FlameAudio.audioCache.play('sfx/obstacle_death.mp3'); - event("die"); - } - } - } - - if (!onTopOfPlatform && - (runnerState == "run" || - runnerState == "kick" || - runnerState == "duck")) { - clearEffects(); - event("fall"); - } - } - - Future load() async { - List satellites = []; - for (int i = 1; i <= 38; i++) { - satellites.add(await Flame.images.load( - 'runner/satellite/satellite00${i < 10 ? "0" + i.toString() : i.toString()}.png')); - } - - SpriteAnimation running = - await loadSpriteAnimation("run", 38, satellites: satellites); - - SpriteAnimation jumping = await loadSpriteAnimation("jump", 6, - satellites: satellites, loop: false); - - SpriteAnimation ducking = - await loadSpriteAnimation("duck1", 38, satellites: satellites); - - SpriteAnimation ducking2 = - await loadSpriteAnimation("duck2", 38, satellites: satellites); - - SpriteAnimation ducking3 = - await loadSpriteAnimation("duck3", 38, satellites: satellites); - - SpriteAnimation kicking = await loadSpriteAnimation("attack1", 38, - satellites: satellites, loop: false); - - SpriteAnimation kicking2 = await loadSpriteAnimation("attack2", 38, - satellites: satellites, loop: false); - - SpriteAnimation kicking3 = await loadSpriteAnimation("attack3", 38, - satellites: satellites, loop: false); - - SpriteAnimation floating = - await loadSpriteAnimation("hover1", 44, satellites: satellites); - - SpriteAnimation floating2 = - await loadSpriteAnimation("hover2", 44, satellites: satellites); - - SpriteAnimation floating3 = - await loadSpriteAnimation("hover3", 44, satellites: satellites); - - SpriteAnimation falling = await loadSpriteAnimation("fall", 20, - satellites: satellites, loop: false); - - SpriteAnimation dying = - await loadSpriteAnimation("death2", 57, loop: false); - - SpriteAnimation dyingGlitch = - await loadSpriteAnimation("death1", 81, loop: false); - - sprite = SpriteAnimationGroupComponent( - animations: { - RunnerState.run: running, - RunnerState.jump: jumping, - RunnerState.duck: ducking, - RunnerState.duck2: ducking2, - RunnerState.duck3: ducking3, - RunnerState.kick: kicking, - RunnerState.kick2: kicking2, - RunnerState.kick3: kicking3, - RunnerState.float: floating, - RunnerState.float2: floating2, - RunnerState.float3: floating3, - RunnerState.fall: falling, - RunnerState.die: dying, - RunnerState.electrocute: dying, - RunnerState.glitch: dyingGlitch, - }, - current: RunnerState.run, - ); - - changePriorityWithoutResorting(RUNNER_PRIORITY); - } - - Future loadSpriteAnimation(String name, int howManyFrames, - {List? satellites, bool loop = true}) async { - List sprites = []; - for (int i = 1; i <= howManyFrames; i++) { - final composition = ImageComposition(); - if (satellites != null) { - composition.add( - satellites.elementAt(((i - 1) % satellites.length)), Vector2(0, 0)); - } - composition.add( - await Flame.images.load( - 'runner/$name/${name}00${i < 10 ? "0" + i.toString() : i.toString()}.png'), - Vector2(0, 0)); - - sprites.add(Sprite(await composition.compose())); - } - - return SpriteAnimation.spriteList(sprites, stepTime: 0.02, loop: loop); - } - - void resize(Vector2 newSize, double xRatio, double yRatio) { - sprite.x = gameRef.blockSize * 2; - sprite.y = gameRef.blockSize * level; - sprite.size.x = gameRef.blockSize; - sprite.size.y = gameRef.blockSize; - if (sprite.effects.isNotEmpty) { - sprite.effects.first.onComplete!(); - } - } - - void clearEffects({bool keepSounds = false}) { - sprite.clearEffects(); - if (!keepSounds) { - boost.stop(); - } - } -} +import 'package:flame/extensions.dart'; +import 'package:firo_runner/bug.dart'; +import 'package:firo_runner/moving_object.dart'; +import 'package:firo_runner/main.dart'; +import 'package:flame/effects.dart'; +import 'package:flame/flame.dart'; +import 'dart:math'; + +import 'package:flame/components.dart'; +import 'package:flame/image_composition.dart'; +import 'package:flame_audio/flame_audio.dart'; +import 'package:flutter/animation.dart'; + +enum RunnerState { + run, + jump, + duck, + duck2, + duck3, + kick, + kick2, + kick3, + float, + float2, + float3, + fall, + die, + electrocute, + glitch, +} + +class Runner extends Component with HasGameRef { + late SpriteAnimationGroupComponent sprite; + String runnerState = "run"; + int level = 4; + String previousState = "run"; + var runnerPosition = Vector2(0, 0); + late Vector2 runnerSize; + bool dead = false; + late var boost = null; + late var friend = null; + + void setUp() { + dead = false; + runnerState = "run"; + previousState = "run"; + level = 4; + + runnerSize = Vector2( + gameRef.size.y / 9, + gameRef.size.y / 9, + ); + + setSize(runnerSize, gameRef.blockSize); + runnerPosition = Vector2(gameRef.blockSize * 2, gameRef.blockSize * 4); + setPosition(runnerPosition); + } + + void setPosition(Vector2 position) { + sprite.position = position; + } + + void setSize(Vector2 size, double ySize) { + sprite.size = size; + } + + Sprite getSprite() { + return sprite.animation!.getSprite(); + } + + @override + void render(Canvas c) { + super.render(c); + getSprite().render(c, + position: Vector2(sprite.position.x - sprite.size.x / 3, + sprite.position.y - sprite.size.y / 3), + size: sprite.size * 1.6); + } + + void updateLevel() { + level = (sprite.position.y / gameRef.blockSize).round(); + } + + Future event(String event) async { + if (gameRef.gameState.isPaused) { + return; + } + sprite.animation!.reset(); + switch (event) { + case "jump": + previousState = runnerState; + runnerState = event; + sprite.current = RunnerState.jump; + sprite.addEffect(MoveEffect( + path: [ + // sprite.position, + Vector2(sprite.x, (level - 1) * gameRef.blockSize), + ], + duration: 0.15, + curve: Curves.bounceIn, + onComplete: () { + updateLevel(); + this.event("float"); + }, + )); + break; + case "double_jump": + if (belowPlatform()) { + break; + } + previousState = runnerState; + clearEffects(); + if (level - 1 < 0) { + break; + } + runnerState = event; + switch (gameRef.gameState.getRobotLevel()) { + case 3: + sprite.current = RunnerState.float3; + break; + case 2: + sprite.current = RunnerState.float2; + break; + default: + sprite.current = RunnerState.float; + break; + } + sprite.addEffect(MoveEffect( + path: [ + Vector2(sprite.x, (level - 2) * gameRef.blockSize), + ], + duration: 0.20, + curve: Curves.ease, + onComplete: () { + updateLevel(); + clearEffects(); + if (onTopOfPlatform()) { + this.event("run"); + } else { + this.event("float"); + } + }, + )); + break; + case "fall": + previousState = runnerState; + clearEffects(); + runnerState = event; + sprite.current = RunnerState.fall; + sprite.addEffect(getFallingEffect()); + break; + case "kick": + previousState = runnerState; + runnerState = event; + switch (gameRef.gameState.getRobotLevel()) { + case 3: + sprite.current = RunnerState.kick3; + break; + case 2: + sprite.current = RunnerState.kick2; + break; + default: + sprite.current = RunnerState.kick; + break; + } + break; + case "run": + previousState = runnerState; + runnerState = event; + sprite.current = RunnerState.run; + break; + case "float": + previousState = runnerState; + runnerState = event; + switch (gameRef.gameState.getRobotLevel()) { + case 3: + sprite.current = RunnerState.float3; + break; + case 2: + sprite.current = RunnerState.float2; + break; + default: + sprite.current = RunnerState.float; + break; + } + boost = await FlameAudio.audioCache.play('sfx/jet_boost.mp3'); + sprite.addEffect(MoveEffect( + path: [sprite.position], + duration: 1.5, + curve: Curves.ease, + onComplete: () { + updateLevel(); + boost.stop(); + if (onTopOfPlatform()) { + this.event("run"); + } else { + this.event("fall"); + } + }, + )); + break; + case "duck": + previousState = runnerState; + runnerState = event; + switch (gameRef.gameState.getRobotLevel()) { + case 3: + sprite.current = RunnerState.duck3; + break; + case 2: + sprite.current = RunnerState.duck2; + break; + default: + sprite.current = RunnerState.duck; + break; + } + sprite.addEffect(MoveEffect( + path: [sprite.position], + duration: 1.5, + curve: Curves.linear, + onComplete: () { + this.event("run"); + }, + )); + break; + case "die": + if (dead) { + return; + } + await FlameAudio.audioCache.play('sfx/fall_death.mp3'); + previousState = runnerState; + clearEffects(); + runnerState = event; + sprite.current = RunnerState.die; + dead = true; + friend.stop(); + gameRef.die(); + sprite.addEffect(getFallingEffect()); + break; + case "electrocute": + if (dead) { + return; + } + await FlameAudio.audioCache.play('sfx/fall_death.mp3'); + previousState = runnerState; + clearEffects(); + runnerState = event; + sprite.current = RunnerState.electrocute; + dead = true; + friend.stop(); + gameRef.die(); + sprite.addEffect(getFallingEffect()); + break; + case "glitch": + if (dead) { + return; + } + await FlameAudio.play('sfx/glitch_death.mp3'); + previousState = runnerState; + clearEffects(); + runnerState = event; + sprite.current = RunnerState.glitch; + dead = true; + friend.stop(); + gameRef.die(); + break; + default: + break; + } + } + + MoveEffect getFallingEffect() { + for (int i = level; i < 9; i++) { + if (i % 3 != 2) { + continue; + } + int distance = (i - 1 - level); + double time = 0.2; + for (int x = 2; x < distance; x++) { + time += time * pow(0.5, x - 1); + } + double estimatedXCoordinate = + time * gameRef.gameState.getVelocity() + sprite.x; + for (MovingObject p in gameRef.platformHolder.objects[i]) { + if (estimatedXCoordinate >= p.sprite.x - p.sprite.width / 2 && + estimatedXCoordinate <= p.sprite.x + p.sprite.width) { + return MoveEffect( + path: [ + Vector2(sprite.x, (i - 1) * gameRef.blockSize), + ], + duration: time, + curve: Curves.ease, + onComplete: () { + updateLevel(); + if (onTopOfPlatform()) { + event("run"); + } else { + event("fall"); + } + }, + ); + } + } + } + return MoveEffect( + path: [ + Vector2(sprite.x, 8 * gameRef.blockSize), + ], + duration: 0.2 * (8 - level), + curve: Curves.ease, + onComplete: () { + updateLevel(); + if (onTopOfPlatform()) { + event("run"); + } else { + event("fall"); + } + }, + ); + } + + void control(String input) { + if (gameRef.gameState.isPaused) { + return; + } + switch (input) { + case "up": + if (runnerState == "run" || runnerState == "kick") { + event("jump"); + } else if (runnerState == "float" && previousState == "jump") { + event("double_jump"); + } else if (runnerState == "duck") { + clearEffects(); + event("run"); + } + break; + case "down": + if (runnerState == "run" || runnerState == "kick") { + event("duck"); + } else if (runnerState == "float" && onTopOfPlatform()) { + clearEffects(); + event("run"); + } else if (runnerState == "float") { + clearEffects(); + event("fall"); + } + break; + case "right": + if (runnerState == "run" || runnerState == "kick") { + event("kick"); + } + break; + case "left": + if (runnerState == "kick") { + sprite.animation!.reset(); + clearEffects(); + event("run"); + } + break; + } + } + + @override + void update(double dt) { + super.update(dt); + if (sprite.position.y + sprite.size.y >= gameRef.size.y) { + event("die"); + } + // If the animation is finished + if (sprite.animation?.done() ?? false) { + if (!dead) { + sprite.animation!.reset(); + if (runnerState == "kick") { + event("run"); + } + sprite.current = RunnerState.run; + } + } + + if (runnerState == "float" || runnerState == "double_jump") { + if (onTopOfPlatform()) { + updateLevel(); + clearEffects(); + event("run"); + } + } + + intersecting(); + sprite.update(dt); + } + + bool onTopOfPlatform() { + Rect runnerRect = sprite.toRect(); + bool onTopOfPlatform = false; + for (List platformLevel in gameRef.platformHolder.objects) { + for (MovingObject p in platformLevel) { + String side = p.intersect(runnerRect); + if (side == "none") { + Rect belowRunner = Rect.fromLTRB(runnerRect.left, runnerRect.top, + runnerRect.right, runnerRect.bottom + 1); + if (p.intersect(belowRunner) != "none") { + onTopOfPlatform = true; + } + } + } + } + return onTopOfPlatform; + } + + bool belowPlatform() { + Rect runnerRect = Rect.fromLTRB( + sprite.toRect().left, + sprite.toRect().top, + sprite.toRect().right - sprite.toRect().width / 2, + sprite.toRect().bottom); + bool belowPlatform = false; + for (List platformLevel in gameRef.platformHolder.objects) { + for (MovingObject p in platformLevel) { + String side = p.intersect(runnerRect); + if (side == "none") { + Rect belowRunner = Rect.fromLTRB(runnerRect.left, runnerRect.top - 1, + runnerRect.right, runnerRect.bottom); + if (p.intersect(belowRunner) == "bottom") { + belowPlatform = true; + } + } + } + } + return belowPlatform; + } + + Future intersecting() async { + if (gameRef.gameState.isPaused) { + return; + } + Rect runnerRect = sprite.toRect(); + bool onTopOfPlatform = this.onTopOfPlatform(); + + for (List coinLevel in gameRef.coinHolder.objects) { + for (int i = 0; i < coinLevel.length;) { + if (coinLevel[i].intersect(runnerRect) != "none") { + gameRef.gameState.numCoins++; + await FlameAudio.audioCache.play('sfx/coin_catch.mp3'); + gameRef.coinHolder.remove(coinLevel, i); + continue; + } + i++; + } + } + + for (List wireLevel in gameRef.wireHolder.objects) { + for (int i = 0; i < wireLevel.length; i++) { + if (wireLevel[i].intersect(runnerRect) != "none") { + event("electrocute"); + return; + } + } + } + + for (List bugLevel in gameRef.bugHolder.objects) { + for (int i = 0; i < bugLevel.length; i++) { + String intersectState = bugLevel[i].intersect(runnerRect); + if (bugLevel[i].sprite.current == BugState.breaking) { + continue; + } + if (intersectState == "none") { + Rect above = Rect.fromLTRB( + runnerRect.left + sprite.width / 3, + runnerRect.top - 1, + runnerRect.right - sprite.width / 3, + runnerRect.bottom); + String aboveIntersect = bugLevel[i].intersect(above); + if (aboveIntersect != "none" && + (runnerState == "duck" || runnerState == "float")) { + continue; + } else if (aboveIntersect != "none") { + event("glitch"); + return; + } + } else if (intersectState == "left" && runnerState == "kick") { + await FlameAudio.audioCache.play('sfx/bug_chomp.mp3'); + bugLevel[i].sprite.current = BugState.breaking; + gameRef.coinHolder.generateCoin(gameRef, level, + force: true, xPosition: bugLevel[i].sprite.x + gameRef.blockSize); + } else { + event("glitch"); + return; + } + } + } + + for (List debrisLevel in gameRef.debrisHolder.objects) { + for (int i = 0; i < debrisLevel.length; i++) { + Rect slim = Rect.fromLTRB( + runnerRect.left + sprite.width / 3, + runnerRect.top, + runnerRect.right - sprite.width / 3, + runnerRect.bottom); + String intersectState = debrisLevel[i].intersect(slim); + if (intersectState == "none") { + continue; + } else if (runnerState == "duck" && intersectState != "above") { + continue; + } else { + await FlameAudio.audioCache.play('sfx/obstacle_death.mp3'); + event("die"); + } + } + } + + for (List wallLevel in gameRef.wallHolder.objects) { + for (int i = 0; i < wallLevel.length; i++) { + Rect slim = Rect.fromLTRB( + runnerRect.left + sprite.width / 3, + runnerRect.top + sprite.height / (runnerState == "duck" ? 3 : 6), + runnerRect.right - sprite.width / 3, + runnerRect.bottom - sprite.height / 3); + String intersectState = wallLevel[i].intersect(slim); + if (intersectState == "none") { + continue; + } else { + await FlameAudio.audioCache.play('sfx/obstacle_death.mp3'); + event("die"); + } + } + } + + if (!onTopOfPlatform && + (runnerState == "run" || + runnerState == "kick" || + runnerState == "duck")) { + clearEffects(); + event("fall"); + } + } + + Future load() async { + List satellites = []; + for (int i = 1; i <= 38; i++) { + satellites.add(await Flame.images.load( + 'runner/satellite/satellite00${i < 10 ? "0" + i.toString() : i.toString()}.png')); + } + + SpriteAnimation running = + await loadSpriteAnimation("run", 38, satellites: satellites); + + SpriteAnimation jumping = await loadSpriteAnimation("jump", 6, + satellites: satellites, loop: false); + + SpriteAnimation ducking = + await loadSpriteAnimation("duck1", 38, satellites: satellites); + + SpriteAnimation ducking2 = + await loadSpriteAnimation("duck2", 38, satellites: satellites); + + SpriteAnimation ducking3 = + await loadSpriteAnimation("duck3", 38, satellites: satellites); + + SpriteAnimation kicking = await loadSpriteAnimation("attack1", 38, + satellites: satellites, loop: false); + + SpriteAnimation kicking2 = await loadSpriteAnimation("attack2", 38, + satellites: satellites, loop: false); + + SpriteAnimation kicking3 = await loadSpriteAnimation("attack3", 38, + satellites: satellites, loop: false); + + SpriteAnimation floating = + await loadSpriteAnimation("hover1", 44, satellites: satellites); + + SpriteAnimation floating2 = + await loadSpriteAnimation("hover2", 44, satellites: satellites); + + SpriteAnimation floating3 = + await loadSpriteAnimation("hover3", 44, satellites: satellites); + + SpriteAnimation falling = await loadSpriteAnimation("fall", 20, + satellites: satellites, loop: false); + + SpriteAnimation dying = + await loadSpriteAnimation("death2", 57, loop: false); + + SpriteAnimation dyingGlitch = + await loadSpriteAnimation("death1", 81, loop: false); + + sprite = SpriteAnimationGroupComponent( + animations: { + RunnerState.run: running, + RunnerState.jump: jumping, + RunnerState.duck: ducking, + RunnerState.duck2: ducking2, + RunnerState.duck3: ducking3, + RunnerState.kick: kicking, + RunnerState.kick2: kicking2, + RunnerState.kick3: kicking3, + RunnerState.float: floating, + RunnerState.float2: floating2, + RunnerState.float3: floating3, + RunnerState.fall: falling, + RunnerState.die: dying, + RunnerState.electrocute: dying, + RunnerState.glitch: dyingGlitch, + }, + current: RunnerState.run, + ); + + changePriorityWithoutResorting(RUNNER_PRIORITY); + } + + Future loadSpriteAnimation(String name, int howManyFrames, + {List? satellites, bool loop = true}) async { + List sprites = []; + for (int i = 1; i <= howManyFrames; i++) { + final composition = ImageComposition(); + if (satellites != null) { + composition.add( + satellites.elementAt(((i - 1) % satellites.length)), Vector2(0, 0)); + } + composition.add( + await Flame.images.load( + 'runner/$name/${name}00${i < 10 ? "0" + i.toString() : i.toString()}.png'), + Vector2(0, 0)); + + sprites.add(Sprite(await composition.compose())); + } + + return SpriteAnimation.spriteList(sprites, stepTime: 0.02, loop: loop); + } + + void resize(Vector2 newSize, double xRatio, double yRatio) { + sprite.x = gameRef.blockSize * 2; + sprite.y = gameRef.blockSize * level; + sprite.size.x = gameRef.blockSize; + sprite.size.y = gameRef.blockSize; + if (sprite.effects.isNotEmpty) { + sprite.effects.first.onComplete!(); + } + } + + void clearEffects({bool keepSounds = false}) { + sprite.clearEffects(); + if (!keepSounds) { + boost.stop(); + } + } +} diff --git a/lib/wall_holder.dart b/lib/wall_holder.dart index 823e0e9..e1f4a81 100644 --- a/lib/wall_holder.dart +++ b/lib/wall_holder.dart @@ -1,65 +1,65 @@ -import 'package:firo_runner/holder.dart'; -import 'package:firo_runner/platform.dart'; -import 'package:flame/components.dart'; - -import 'package:firo_runner/wall.dart'; -import 'package:firo_runner/main.dart'; - -class WallHolder extends Holder { - late List wall; - - @override - Future load() async { - wall = await loadListSprites("wall", "wall", 5); - } - - List getWall() { - return wall; - } - - bool generateWall(MyGame gameRef, int level, - {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { - return false; - } - - if (random.nextInt(100) > 25) { - return true; - } else { - int nearestPlatform = getNearestPlatform(level); - - Platform? platform = - gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); - if (platform != null && platform.prohibitObstacles) { - return false; - } - double xCoordinate = -100; - - if (level == 0) { - xCoordinate = gameRef.size.x; - } else if (platform != null) { - xCoordinate = platform.sprite.x; - } else { - return false; - } - - Wall wall = Wall(gameRef); - wall.setPosition(xCoordinate, gameRef.blockSize * level); - wall.bottomPlatformLevel = level + 1; - - if (gameRef.isTooNearOtherObstacles(wall.sprite.toRect())) { - return false; - } - - objects[level].add(wall); - gameRef.add(wall.sprite); - if (platform != null) { - platform.removeChildren.add(() { - objects[level].remove(wall); - wall.remove(); - }); - } - return false; - } - } -} +import 'package:firo_runner/holder.dart'; +import 'package:firo_runner/platform.dart'; +import 'package:flame/components.dart'; + +import 'package:firo_runner/wall.dart'; +import 'package:firo_runner/main.dart'; + +class WallHolder extends Holder { + late List wall; + + @override + Future load() async { + wall = await loadListSprites("wall", "wall", 5); + } + + List getWall() { + return wall; + } + + bool generateWall(MyGame gameRef, int level, + {bool force = false, double xPosition = 0}) { + if (objects[level].isNotEmpty) { + return false; + } + + if (random.nextInt(100) > 25) { + return true; + } else { + int nearestPlatform = getNearestPlatform(level); + + Platform? platform = + gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); + if (platform != null && platform.prohibitObstacles) { + return false; + } + double xCoordinate = -100; + + if (level == 0) { + xCoordinate = gameRef.size.x; + } else if (platform != null) { + xCoordinate = platform.sprite.x; + } else { + return false; + } + + Wall wall = Wall(gameRef); + wall.setPosition(xCoordinate, gameRef.blockSize * level); + wall.bottomPlatformLevel = level + 1; + + if (gameRef.isTooNearOtherObstacles(wall.sprite.toRect())) { + return false; + } + + objects[level].add(wall); + gameRef.add(wall.sprite); + if (platform != null) { + platform.removeChildren.add(() { + objects[level].remove(wall); + wall.remove(); + }); + } + return false; + } + } +} diff --git a/lib/wire_holder.dart b/lib/wire_holder.dart index 09cef9d..0111ba8 100644 --- a/lib/wire_holder.dart +++ b/lib/wire_holder.dart @@ -1,72 +1,72 @@ -import 'package:firo_runner/holder.dart'; -import 'package:firo_runner/platform.dart'; -import 'package:flame/components.dart'; - -import 'package:firo_runner/wire.dart'; -import 'package:firo_runner/main.dart'; - -class WireHolder extends Holder { - late List wire; - - @override - Future load() async { - wire = await loadListSprites("wire", "wire", 12); - } - - List getWire() { - return wire; - } - - bool generateWire(MyGame gameRef, int level, - {bool force = false, double xPosition = 0}) { - if (objects[level].isNotEmpty) { - return false; - } - - if (random.nextInt(100) > 100) { - return true; - } else { - int nearestPlatform = getNearestPlatform(level); - - Platform? platform = - gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); - if (platform != null && platform.prohibitObstacles) { - return false; - } - double xCoordinate = -100; - - if (level == 0) { - xCoordinate = gameRef.size.x; - } else if (platform != null) { - xCoordinate = platform.sprite.x; - } else { - return false; - } - - Wire wire = Wire(gameRef); - wire.sprite.renderFlipX = true; - if (level % 3 == 0) { - wire.sprite.renderFlipY = true; - wire.setPosition( - xCoordinate, gameRef.blockSize * level - 2 * gameRef.blockSize / 7); - } else { - wire.setPosition( - xCoordinate, gameRef.blockSize * level + gameRef.blockSize / 10); - } - - if (gameRef.isTooNearOtherObstacles(wire.sprite.toRect())) { - return false; - } - - objects[level].add(wire); - gameRef.add(wire.sprite); - if (platform != null) { - platform.removeChildren.add(() { - objects[level].remove(wire); - wire.remove(); - }); - } - return false; - } - } -} +import 'package:firo_runner/holder.dart'; +import 'package:firo_runner/platform.dart'; +import 'package:flame/components.dart'; + +import 'package:firo_runner/wire.dart'; +import 'package:firo_runner/main.dart'; + +class WireHolder extends Holder { + late List wire; + + @override + Future load() async { + wire = await loadListSprites("wire", "wire", 12); + } + + List getWire() { + return wire; + } + + bool generateWire(MyGame gameRef, int level, + {bool force = false, double xPosition = 0}) { + if (objects[level].isNotEmpty) { + return false; + } + + if (random.nextInt(100) > 100) { + return true; + } else { + int nearestPlatform = getNearestPlatform(level); + + Platform? platform = + gameRef.platformHolder.getPlatformOffScreen(nearestPlatform); + if (platform != null && platform.prohibitObstacles) { + return false; + } + double xCoordinate = -100; + + if (level == 0) { + xCoordinate = gameRef.size.x; + } else if (platform != null) { + xCoordinate = platform.sprite.x; + } else { + return false; + } + + Wire wire = Wire(gameRef); + wire.sprite.renderFlipX = true; + if (level % 3 == 0) { + wire.sprite.renderFlipY = true; + wire.setPosition( + xCoordinate, gameRef.blockSize * level - 2 * gameRef.blockSize / 7); + } else { + wire.setPosition( + xCoordinate, gameRef.blockSize * level + gameRef.blockSize / 10); + } + + if (gameRef.isTooNearOtherObstacles(wire.sprite.toRect())) { + return false; + } + + objects[level].add(wire); + gameRef.add(wire.sprite); + if (platform != null) { + platform.removeChildren.add(() { + objects[level].remove(wire); + wire.remove(); + }); + } + return false; + } + } +} diff --git a/pubspec.lock b/pubspec.lock index 21e665b..1704357 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,383 +1,383 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - archive: - dependency: transitive - description: - name: archive - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.5" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.3.0" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.8.1" - audioplayers: - dependency: transitive - description: - name: audioplayers - url: "https://pub.dartlang.org" - source: hosted - version: "0.19.1" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - charcode: - dependency: transitive - description: - name: charcode - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.1" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.15.0" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.1" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - ffi: - dependency: transitive - description: - name: ffi - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.2" - flame: - dependency: "direct main" - description: - name: flame - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0-releasecandidate.13" - flame_audio: - dependency: "direct main" - description: - name: flame_audio - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0-rc.1" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_launcher_icons: - dependency: "direct dev" - description: - name: flutter_launcher_icons - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.2" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - flutter_web_plugins: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - http: - dependency: "direct main" - description: - name: http - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.3" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.0" - image: - dependency: transitive - description: - name: image - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.7" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.3" - lints: - dependency: transitive - description: - name: lints - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.10" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.7.0" - ordered_set: - dependency: transitive - description: - name: ordered_set - url: "https://pub.dartlang.org" - source: hosted - version: "3.2.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.0" - path_provider: - dependency: transitive - description: - name: path_provider - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - path_provider_linux: - dependency: transitive - description: - name: path_provider_linux - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_macos: - dependency: transitive - description: - name: path_provider_macos - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - path_provider_platform_interface: - dependency: transitive - description: - name: path_provider_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - path_provider_windows: - dependency: transitive - description: - name: path_provider_windows - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.3" - pedantic: - dependency: transitive - description: - name: pedantic - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - petitparser: - dependency: transitive - description: - name: petitparser - url: "https://pub.dartlang.org" - source: hosted - version: "4.3.0" - platform: - dependency: transitive - description: - name: platform - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - process: - dependency: transitive - description: - name: process - url: "https://pub.dartlang.org" - source: hosted - version: "4.2.3" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.1" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - synchronized: - dependency: transitive - description: - name: synchronized - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.4.2" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.0" - uuid: - dependency: transitive - description: - name: uuid - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.4" - vector_math: - dependency: transitive - description: - name: vector_math - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - win32: - dependency: transitive - description: - name: win32 - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.9" - xdg_directories: - dependency: transitive - description: - name: xdg_directories - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0" - xml: - dependency: transitive - description: - name: xml - url: "https://pub.dartlang.org" - source: hosted - version: "5.3.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.0" -sdks: - dart: ">=2.14.0 <3.0.0" - flutter: ">=2.0.0" +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + archive: + dependency: transitive + description: + name: archive + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.5" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.3.0" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.8.1" + audioplayers: + dependency: transitive + description: + name: audioplayers + url: "https://pub.dartlang.org" + source: hosted + version: "0.19.1" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + characters: + dependency: transitive + description: + name: characters + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + charcode: + dependency: transitive + description: + name: charcode + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.1" + clock: + dependency: transitive + description: + name: clock + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.15.0" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.1" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + fake_async: + dependency: transitive + description: + name: fake_async + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + ffi: + dependency: transitive + description: + name: ffi + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.2" + flame: + dependency: "direct main" + description: + name: flame + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0-releasecandidate.13" + flame_audio: + dependency: "direct main" + description: + name: flame_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0-rc.1" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.2" + flutter_lints: + dependency: "direct dev" + description: + name: flutter_lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + http: + dependency: "direct main" + description: + name: http + url: "https://pub.dartlang.org" + source: hosted + version: "0.13.3" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.0" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.7" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.3" + lints: + dependency: transitive + description: + name: lints + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.10" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.0" + ordered_set: + dependency: transitive + description: + name: ordered_set + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.0" + path_provider: + dependency: transitive + description: + name: path_provider + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path_provider_macos: + dependency: transitive + description: + name: path_provider_macos + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.3" + pedantic: + dependency: transitive + description: + name: pedantic + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "4.3.0" + platform: + dependency: transitive + description: + name: platform + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.1" + process: + dependency: transitive + description: + name: process + url: "https://pub.dartlang.org" + source: hosted + version: "4.2.3" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.1" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.0" + synchronized: + dependency: transitive + description: + name: synchronized + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.2" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.0" + uuid: + dependency: transitive + description: + name: uuid + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.4" + vector_math: + dependency: transitive + description: + name: vector_math + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + win32: + dependency: transitive + description: + name: win32 + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.9" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.0" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "5.3.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" +sdks: + dart: ">=2.14.0 <3.0.0" + flutter: ">=2.0.0" diff --git a/pubspec.yaml b/pubspec.yaml index fc6db01..8038e0b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,88 +1,88 @@ -name: firo_runner -description: An infitite runner game powered by Firo. - -# The following line prevents the package from being accidentally published to -# pub.dev using `pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -# The following defines the version and build number for your application. -# A version number is three numbers separated by dots, like 1.2.43 -# followed by an optional build number separated by a +. -# Both the version and the builder number may be overridden in flutter -# build by specifying --build-name and --build-number, respectively. -# In Android, build-name is used as versionName while build-number used as versionCode. -# Read more about Android versioning at https://developer.android.com/studio/publish/versioning -# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. -# Read more about iOS versioning at -# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.0+1 - -environment: - sdk: ">=2.12.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - flame: "^1.0.0-releasecandidate.11" - flame_audio: "^1.0.0-rc.1" - http: ^0.13.3 - - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.2 - -flutter_icons: - android: "launcher_icon" - ios: true - image_path: "assets/icon/head-logo.png" - -dev_dependencies: - flutter_lints: ^1.0.4 - flutter_test: - sdk: flutter - flutter_launcher_icons: "^0.9.2" - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - assets: - - assets/images/ - - assets/audio/ - - assets/audio/sfx/ - - assets/images/runner/run/ - - assets/images/runner/fall/ - - assets/images/runner/satellite/ - - assets/images/runner/death2/ - - assets/images/runner/death1/ - - assets/images/runner/jump/ - - assets/images/runner/attack1/ - - assets/images/runner/attack2/ - - assets/images/runner/attack3/ - - assets/images/runner/duck1/ - - assets/images/runner/duck2/ - - assets/images/runner/duck3/ - - assets/images/runner/hover1/ - - assets/images/runner/hover2/ - - assets/images/runner/hover3/ - - assets/images/bug/ - - assets/images/coin/ - - assets/images/debris/ - - assets/images/firework/ - - assets/images/platform/ - - assets/images/wall/ - - assets/images/wire/ - - fonts: - - family: Codystar - fonts: - - asset: assets/fonts/Codystar-Regular.ttf - +name: firo_runner +description: An infitite runner game powered by Firo. + +# The following line prevents the package from being accidentally published to +# pub.dev using `pub publish`. This is preferred for private packages. +publish_to: 'none' # Remove this line if you wish to publish to pub.dev + +# The following defines the version and build number for your application. +# A version number is three numbers separated by dots, like 1.2.43 +# followed by an optional build number separated by a +. +# Both the version and the builder number may be overridden in flutter +# build by specifying --build-name and --build-number, respectively. +# In Android, build-name is used as versionName while build-number used as versionCode. +# Read more about Android versioning at https://developer.android.com/studio/publish/versioning +# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. +# Read more about iOS versioning at +# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html +version: 1.0.0+1 + +environment: + sdk: ">=2.12.0 <3.0.0" + +dependencies: + flutter: + sdk: flutter + flame: "^1.0.0-releasecandidate.11" + flame_audio: "^1.0.0-rc.1" + http: ^0.13.3 + + + # The following adds the Cupertino Icons font to your application. + # Use with the CupertinoIcons class for iOS style icons. + cupertino_icons: ^1.0.2 + +flutter_icons: + android: "launcher_icon" + ios: true + image_path: "assets/icon/head-logo.png" + +dev_dependencies: + flutter_lints: ^1.0.4 + flutter_test: + sdk: flutter + flutter_launcher_icons: "^0.9.2" + +# For information on the generic Dart part of this file, see the +# following page: https://dart.dev/tools/pub/pubspec + +# The following section is specific to Flutter. +flutter: + + # The following line ensures that the Material Icons font is + # included with your application, so that you can use the icons in + # the material Icons class. + uses-material-design: true + + assets: + - assets/images/ + - assets/audio/ + - assets/audio/sfx/ + - assets/images/runner/run/ + - assets/images/runner/fall/ + - assets/images/runner/satellite/ + - assets/images/runner/death2/ + - assets/images/runner/death1/ + - assets/images/runner/jump/ + - assets/images/runner/attack1/ + - assets/images/runner/attack2/ + - assets/images/runner/attack3/ + - assets/images/runner/duck1/ + - assets/images/runner/duck2/ + - assets/images/runner/duck3/ + - assets/images/runner/hover1/ + - assets/images/runner/hover2/ + - assets/images/runner/hover3/ + - assets/images/bug/ + - assets/images/coin/ + - assets/images/debris/ + - assets/images/firework/ + - assets/images/platform/ + - assets/images/wall/ + - assets/images/wire/ + + fonts: + - family: Codystar + fonts: + - asset: assets/fonts/Codystar-Regular.ttf +