diff --git a/Shitty Volume Switcher.xcodeproj/project.pbxproj b/Shitty Volume Switcher.xcodeproj/project.pbxproj index 30926e7..6835da4 100644 --- a/Shitty Volume Switcher.xcodeproj/project.pbxproj +++ b/Shitty Volume Switcher.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Shitty Volume Switcher.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 503FC2C523906B5500B8095B /* SVS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SVS.app; sourceTree = BUILT_PRODUCTS_DIR; }; 503FC2C823906B5500B8095B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 503FC2CA23906B5500B8095B /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = ""; }; 503FC2CE23906B5500B8095B /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = ""; }; @@ -26,6 +26,7 @@ 503FC2D523906B5800B8095B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 503FC2D823906B5800B8095B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 503FC2DA23906B5800B8095B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 509975CE239563BE004C3CAF /* SVS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SVS.entitlements; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -50,7 +51,7 @@ 503FC2C623906B5500B8095B /* Products */ = { isa = PBXGroup; children = ( - 503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */, + 503FC2C523906B5500B8095B /* SVS.app */, ); name = Products; sourceTree = ""; @@ -58,6 +59,7 @@ 503FC2C723906B5500B8095B /* Shitty Volume Switcher */ = { isa = PBXGroup; children = ( + 509975CE239563BE004C3CAF /* SVS.entitlements */, 503FC2C823906B5500B8095B /* AppDelegate.swift */, 503FC2CA23906B5500B8095B /* GameScene.sks */, 503FC2CE23906B5500B8095B /* GameScene.swift */, @@ -87,7 +89,7 @@ ); name = "Shitty Volume Switcher"; productName = "Shitty Volume Switcher"; - productReference = 503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */; + productReference = 503FC2C523906B5500B8095B /* SVS.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -288,6 +290,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Shitty Volume Switcher/SVS.entitlements"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = T87U8Q4BB3; INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist"; @@ -296,7 +299,8 @@ "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = SVS; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -306,6 +310,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_ENTITLEMENTS = "Shitty Volume Switcher/SVS.entitlements"; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = T87U8Q4BB3; INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist"; @@ -314,7 +319,8 @@ "@executable_path/Frameworks", ); PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher"; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = SVS; + SUPPORTS_MACCATALYST = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Contents.json b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d6..87e7b45 100644 --- a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,93 +1,111 @@ { "images" : [ - { - "idiom" : "iphone", + { "size" : "20x20", - "scale" : "2x" + "idiom": "iphone", + "filename" : "Untitled-1-20@2x.png", + "scale": "2x" }, - { - "idiom" : "iphone", + { "size" : "20x20", - "scale" : "3x" + "idiom": "iphone", + "filename" : "Untitled-1-20@3x.png", + "scale": "3x" + }, + { + "size" : "20x20", + "idiom": "ipad", + "filename" : "Untitled-1-20.png", + "scale": "1x" + }, + { + "size" : "20x20", + "idiom": "ipad", + "filename" : "Untitled-1-20@2x.png", + "scale": "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Untitled-1-29@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "29x29", + "idiom" : "iphone", + "filename" : "Untitled-1-29@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Untitled-1-40@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "40x40", + "idiom" : "iphone", + "filename" : "Untitled-1-40@3x.png", "scale" : "3x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Untitled-1-60@2x.png", "scale" : "2x" }, { - "idiom" : "iphone", "size" : "60x60", + "idiom" : "iphone", + "filename" : "Untitled-1-60@3x.png", "scale" : "3x" }, { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "Untitled-1-29.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "29x29", + "idiom" : "ipad", + "filename" : "Untitled-1-29@2x.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "Untitled-1-40.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "40x40", + "idiom" : "ipad", + "filename" : "Untitled-1-40@2x.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "Untitled-1-76.png", "scale" : "1x" }, { - "idiom" : "ipad", "size" : "76x76", + "idiom" : "ipad", + "filename" : "Untitled-1-76@2x.png", "scale" : "2x" }, { - "idiom" : "ipad", "size" : "83.5x83.5", + "idiom" : "ipad", + "filename" : "Untitled-1-83.5@2x.png", "scale" : "2x" }, { - "idiom" : "ios-marketing", "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "Untitled-1-1024.png", "scale" : "1x" } ], @@ -95,4 +113,4 @@ "version" : 1, "author" : "xcode" } -} \ No newline at end of file +} diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-1024.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-1024.png new file mode 100644 index 0000000..86df40f Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-1024.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20.png new file mode 100644 index 0000000..61366ca Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@2x.png new file mode 100644 index 0000000..138b203 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@2x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@3x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@3x.png new file mode 100644 index 0000000..d389a6f Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-20@3x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29.png new file mode 100644 index 0000000..77a5d4c Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@2x.png new file mode 100644 index 0000000..4c3e4f6 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@2x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@3x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@3x.png new file mode 100644 index 0000000..228eb7e Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-29@3x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40.png new file mode 100644 index 0000000..138b203 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@2x.png new file mode 100644 index 0000000..bc9dd8f Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@2x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@3x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@3x.png new file mode 100644 index 0000000..ef95c04 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-40@3x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@2x.png new file mode 100644 index 0000000..ef95c04 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@2x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@3x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@3x.png new file mode 100644 index 0000000..755aa72 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-60@3x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76.png new file mode 100644 index 0000000..54da6c6 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76@2x.png new file mode 100644 index 0000000..54423a2 Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-76@2x.png differ diff --git a/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-83.5@2x.png b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-83.5@2x.png new file mode 100644 index 0000000..d39a3eb Binary files /dev/null and b/Shitty Volume Switcher/Assets.xcassets/AppIcon.appiconset/Untitled-1-83.5@2x.png differ diff --git a/Shitty Volume Switcher/GameScene.sks b/Shitty Volume Switcher/GameScene.sks index 7490b42..d230cad 100644 Binary files a/Shitty Volume Switcher/GameScene.sks and b/Shitty Volume Switcher/GameScene.sks differ diff --git a/Shitty Volume Switcher/GameScene.swift b/Shitty Volume Switcher/GameScene.swift index 33f013d..bc3ad45 100644 --- a/Shitty Volume Switcher/GameScene.swift +++ b/Shitty Volume Switcher/GameScene.swift @@ -46,11 +46,17 @@ class GameScene: SKScene, SKPhysicsContactDelegate { physicsWorld.gravity = .zero + spawnBall(CGPoint(x: 0, y: 0)) + + + } + + func spawnBall(_ location: CGPoint!){ ball = SKSpriteNode(imageNamed: "ball") ball.setScale(2.5) ball.physicsBody = SKPhysicsBody(circleOfRadius: ball.size.width / 2.0) - ball.physicsBody?.restitution = 0.7 - ball.position = CGPoint(x: 0, y: 0) + ball.physicsBody?.restitution = 0.95 + ball.position = location ball.physicsBody?.categoryBitMask = ballCategory ball.zPosition = 5 addChild(ball) @@ -59,7 +65,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate { func didBegin(_ contact: SKPhysicsContact) { let contactNode = contact.bodyA.node as! SKSpriteNode MPVolumeView.setVolume(Float(contact.bodyA.contactTestBitMask)/31) - let scale = SKAction.scale(by: 0.7, duration: 0.15) + let scale = SKAction.scale(by: 0.7, duration: 0.07) let reverseScale = scale.reversed() let actions = [scale, reverseScale] let sequence = SKAction.sequence(actions) @@ -73,12 +79,15 @@ class GameScene: SKScene, SKPhysicsContactDelegate { // } } + + -// override func touchesBegan(_ touches: Set, with event: UIEvent?) { -// guard let touch = touches.first else { return } -// let location = touch.location(in: self) -// lastTouchPosition = location -// } + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + guard let touch = touches.first else { return } + let touchLocation = touch.location(in: self) + spawnBall(touchLocation) + + } // // for t in touches { self.touchDown(atPoint: t.location(in: self)) } // } @@ -91,12 +100,11 @@ class GameScene: SKScene, SKPhysicsContactDelegate { // override func touchesEnded(_ touches: Set, with event: UIEvent?) { // lastTouchPosition = nil - let touch = touches.first - let touchLocation = touch!.location(in: self) - // Check if the location of the touch is within the button's bounds - if button.contains(touchLocation) { - MPVolumeView.setVolume(0.5) - } +// let touch = touches.first +// let touchLocation = touch!.location(in: self) +// if button.contains(touchLocation) { +// MPVolumeView.setVolume(0.5) +// } } // // override func touchesCancelled(_ touches: Set, with event: UIEvent?) { @@ -107,7 +115,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate { override func update(_ currentTime: TimeInterval) { // Called before each frame is rendered if let accelerometerData = motionManager.accelerometerData { - physicsWorld.gravity = CGVector(dx: accelerometerData.acceleration.y * 10, dy: accelerometerData.acceleration.x * -10) + physicsWorld.gravity = CGVector(dx: accelerometerData.acceleration.y * 15, dy: accelerometerData.acceleration.x * -15) } } diff --git a/Shitty Volume Switcher/SVS.entitlements b/Shitty Volume Switcher/SVS.entitlements new file mode 100644 index 0000000..ee95ab7 --- /dev/null +++ b/Shitty Volume Switcher/SVS.entitlements @@ -0,0 +1,10 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.network.client + + +