diff --git a/Sprites MBP/Sprites MBP.xcodeproj/project.pbxproj b/Sprites MBP/Sprites MBP.xcodeproj/project.pbxproj new file mode 100644 index 0000000..7c9142d --- /dev/null +++ b/Sprites MBP/Sprites MBP.xcodeproj/project.pbxproj @@ -0,0 +1,343 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + 84570472219B760B0086349C /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84570471219B760B0086349C /* AppDelegate.swift */; }; + 84570474219B760B0086349C /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84570473219B760B0086349C /* ViewController.swift */; }; + 84570477219B760B0086349C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 84570475219B760B0086349C /* Main.storyboard */; }; + 84570479219B76100086349C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 84570478219B76100086349C /* Assets.xcassets */; }; + 8457047C219B76100086349C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8457047A219B76100086349C /* LaunchScreen.storyboard */; }; + 84570484219B78830086349C /* CustomScene.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84570483219B78830086349C /* CustomScene.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 8457046E219B760B0086349C /* Sprites MBP.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Sprites MBP.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 84570471219B760B0086349C /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 84570473219B760B0086349C /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 84570476219B760B0086349C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 84570478219B76100086349C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 8457047B219B76100086349C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 8457047D219B76100086349C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 84570483219B78830086349C /* CustomScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomScene.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 8457046B219B760B0086349C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 84570465219B760B0086349C = { + isa = PBXGroup; + children = ( + 84570470219B760B0086349C /* Sprites MBP */, + 8457046F219B760B0086349C /* Products */, + ); + sourceTree = ""; + }; + 8457046F219B760B0086349C /* Products */ = { + isa = PBXGroup; + children = ( + 8457046E219B760B0086349C /* Sprites MBP.app */, + ); + name = Products; + sourceTree = ""; + }; + 84570470219B760B0086349C /* Sprites MBP */ = { + isa = PBXGroup; + children = ( + 84570471219B760B0086349C /* AppDelegate.swift */, + 84570473219B760B0086349C /* ViewController.swift */, + 84570483219B78830086349C /* CustomScene.swift */, + 84570475219B760B0086349C /* Main.storyboard */, + 84570478219B76100086349C /* Assets.xcassets */, + 8457047A219B76100086349C /* LaunchScreen.storyboard */, + 8457047D219B76100086349C /* Info.plist */, + ); + path = "Sprites MBP"; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 8457046D219B760B0086349C /* Sprites MBP */ = { + isa = PBXNativeTarget; + buildConfigurationList = 84570480219B76100086349C /* Build configuration list for PBXNativeTarget "Sprites MBP" */; + buildPhases = ( + 8457046A219B760B0086349C /* Sources */, + 8457046B219B760B0086349C /* Frameworks */, + 8457046C219B760B0086349C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "Sprites MBP"; + productName = "Sprites MBP"; + productReference = 8457046E219B760B0086349C /* Sprites MBP.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 84570466219B760B0086349C /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 1010; + LastUpgradeCheck = 1010; + ORGANIZATIONNAME = "Audrey Welch"; + TargetAttributes = { + 8457046D219B760B0086349C = { + CreatedOnToolsVersion = 10.1; + }; + }; + }; + buildConfigurationList = 84570469219B760B0086349C /* Build configuration list for PBXProject "Sprites MBP" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 84570465219B760B0086349C; + productRefGroup = 8457046F219B760B0086349C /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 8457046D219B760B0086349C /* Sprites MBP */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 8457046C219B760B0086349C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 8457047C219B76100086349C /* LaunchScreen.storyboard in Resources */, + 84570479219B76100086349C /* Assets.xcassets in Resources */, + 84570477219B760B0086349C /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 8457046A219B760B0086349C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 84570474219B760B0086349C /* ViewController.swift in Sources */, + 84570472219B760B0086349C /* AppDelegate.swift in Sources */, + 84570484219B78830086349C /* CustomScene.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + 84570475219B760B0086349C /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 84570476219B760B0086349C /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 8457047A219B76100086349C /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 8457047B219B76100086349C /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 8457047E219B76100086349C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 8457047F219B76100086349C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "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 = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 12.1; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SDKROOT = iphoneos; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 84570481219B76100086349C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Sprites MBP/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.audreywelch.Sprites-MBP"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 84570482219B76100086349C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = "Sprites MBP/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "com.audreywelch.Sprites-MBP"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.2; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 84570469219B760B0086349C /* Build configuration list for PBXProject "Sprites MBP" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 8457047E219B76100086349C /* Debug */, + 8457047F219B76100086349C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 84570480219B76100086349C /* Build configuration list for PBXNativeTarget "Sprites MBP" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 84570481219B76100086349C /* Debug */, + 84570482219B76100086349C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 84570466219B760B0086349C /* Project object */; +} diff --git a/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..45a6bbe --- /dev/null +++ b/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Sprites MBP/Sprites MBP.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Sprites MBP/Sprites MBP/AppDelegate.swift b/Sprites MBP/Sprites MBP/AppDelegate.swift new file mode 100644 index 0000000..d24de16 --- /dev/null +++ b/Sprites MBP/Sprites MBP/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Sprites MBP +// +// Created by Audrey Seversen on 11/13/18. +// Copyright © 2018 Audrey Welch. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Sprites MBP/Sprites MBP/Assets.xcassets/AppIcon.appiconset/Contents.json b/Sprites MBP/Sprites MBP/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Sprites MBP/Sprites MBP/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprites MBP/Sprites MBP/Assets.xcassets/Contents.json b/Sprites MBP/Sprites MBP/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Sprites MBP/Sprites MBP/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Sprites MBP/Sprites MBP/Base.lproj/LaunchScreen.storyboard b/Sprites MBP/Sprites MBP/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..bfa3612 --- /dev/null +++ b/Sprites MBP/Sprites MBP/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites MBP/Sprites MBP/Base.lproj/Main.storyboard b/Sprites MBP/Sprites MBP/Base.lproj/Main.storyboard new file mode 100644 index 0000000..fd07089 --- /dev/null +++ b/Sprites MBP/Sprites MBP/Base.lproj/Main.storyboard @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Sprites MBP/Sprites MBP/CustomScene.swift b/Sprites MBP/Sprites MBP/CustomScene.swift new file mode 100644 index 0000000..00ff936 --- /dev/null +++ b/Sprites MBP/Sprites MBP/CustomScene.swift @@ -0,0 +1,50 @@ +// +// CustomScene.swift +// Sprites MBP +// + +import Foundation +import UIKit +import SpriteKit + +class CustomScene: SKScene { + + public override func touchesBegan(_ touches: Set, with event: UIEvent?) { + guard !touches.isEmpty, let touch = touches.first + else { return } + + // Work with your touch here + // size of node + let node = SKShapeNode(circleOfRadius: 8) + + // color of node + node.fillColor = .red + + // placement of node + node.position = CGPoint(x: frame.midX, y: frame.midY) + //node.position = touch.location(in: self) + addChild(node) + + // randomize color of node each time it's touched + let red = CGFloat.random(in: 0.5...1.0) + let green = CGFloat.random(in: 0.5...1.0) + let blue = CGFloat.random(in: 0.5...1.0) + + let newColor = UIColor(displayP3Red: red, green: green, blue: blue, alpha: 1.0) + node.fillColor = newColor + + // zoom and unzoom node when touched + let zoomAction = SKAction.scale(by: 1.3, duration: 0.3) + let unzoomAction = SKAction.scale(to: 1.0, duration: 0.1) + + // create move action + let position = touch.location(in: self) + let actionDuration = 1.0 + let moveAction = SKAction.move(to: position, duration: actionDuration) + + // put all zooming and moving actions into a sequence to happen consecutively + let sequenceAction = SKAction.sequence([zoomAction, moveAction, unzoomAction]) + // run the sequence + node.run(sequenceAction) + } +} diff --git a/Sprites MBP/Sprites MBP/Info.plist b/Sprites MBP/Sprites MBP/Info.plist new file mode 100644 index 0000000..89d7858 --- /dev/null +++ b/Sprites MBP/Sprites MBP/Info.plist @@ -0,0 +1,43 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Sprites MBP/Sprites MBP/ViewController.swift b/Sprites MBP/Sprites MBP/ViewController.swift new file mode 100644 index 0000000..c26fdf9 --- /dev/null +++ b/Sprites MBP/Sprites MBP/ViewController.swift @@ -0,0 +1,32 @@ +// +// ViewController.swift +// Sprites MBP + + +import UIKit +import SpriteKit + + +class ViewController: UIViewController { + + @IBOutlet weak var skview: SKView! + + // assign the variable skscene to the type of CustomScene (if it contains anything) and set it to nil + var skscene: CustomScene? = nil + + // add the scene into the view when it is opened + override func viewDidAppear(_ animated: Bool) { + super.viewDidAppear(animated) + + skscene = CustomScene(size: view.bounds.size) + skview.presentScene(skscene) + } + + override func viewDidLoad() { + super.viewDidLoad() + + } + + +} + diff --git a/iOS Development Tools - Sprites - MBP.rtf b/iOS Development Tools - Sprites - MBP.rtf new file mode 100644 index 0000000..cc2a8e6 --- /dev/null +++ b/iOS Development Tools - Sprites - MBP.rtf @@ -0,0 +1,42 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1561\cocoasubrtf600 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +{\*\expandedcolortbl;;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 + +\f0\b\fs28 \cf0 Module Challenge: iOS Development Tools - Sprites +\fs24 \ + +\fs26 [ Week 1 of Mastery-Based Partnership ]\ +\ + +\fs24 Why do we use version control? Under what circumstances would you need version control features and why?\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qr\partightenfactor0 + +\b0 \cf0 >> We use version control because it does 3 things that are all very important . First, it adds a safety net to our code - we can go back to an earlier version of a project if we need to. Second, it allows for collaboration. If you are working in a large group, you can coordinate changes. And finally, it lets you try things out and work on them before adding them to your project or your commit. You would use version control features in any of the previous situations - if you need to delete a version of something or merge the previous two versions, or restore old versions. You would use it if you are working independently, but on the same issues as a larger group. And you would use it to try out code by creating branches that make a separate and safe environment where you are isolated in what you\'92re working on. +\b \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 +\cf0 \ +What are the navigator, editor, and inspectors areas in Xcode? What are their roles and how do you use them?\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qr\partightenfactor0 + +\b0 \cf0 >> Navigator: the navigators bar is on the far left side of the Xcode screen and it contains different navigators that help with your project. The \'93Project\'94 navigator manages all of the files in the project, allowing you to move between them, add/delete files, and launch them to display on the screen. The \'93Search\'94 navigator helps you find strings among the files in the project. The \'93Issue\'94 navigator will show warnings or errors that come up when building/running your project.\ +>> Editor: the Editor area is where all of the coding takes place. When you click on a file in the project navigator section, it opens the contents of that file in the Editor. \ +>> Inspector: the inspectors bar contains different inspectors that allow you to change and manipulate the user interface of the application being built. The \'93Attributes Inspector\'94 allows you to change physical attributes of your user interface. The \'93Identity Inspector\'94 shows the information about the class and identity of the views. The \'93Size Inspector\'94 allows you to change the size of the objects you are working with. +\b \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 +\cf0 \ +How do you center a view in Interface Builder? How do you stretch one?\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qr\partightenfactor0 + +\b0 \cf0 >> You can center a view in Interface Builder by first selecting the view, then going to the Align bar at the bottom and selecting both \'93Horizontally in Container\'94 and \'93Vertically in Container\'94, and then selecting \'93Add 2 Constraints.\'94 You can stretch a view by selecting the view, then going to the Tie Fighter, or the \'93Add New Constraints\'94 bar at the bottom and changing all four of the Spacing to Nearest Neighbor to 0, then selecting \'93Add 4 Constraints.\'94 +\b \ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 +\cf0 \ +What is SpriteKit and why do people use it?\ +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\qr\partightenfactor0 + +\b0 \cf0 >> SpriteKit is a class that contains graphics that are animated. People use them to add interesting visual animations to apps or games. +\b \ +} \ No newline at end of file