Update
@ -17,7 +17,7 @@
|
|||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
/* Begin PBXFileReference 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 = "<group>"; };
|
503FC2C823906B5500B8095B /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
503FC2CA23906B5500B8095B /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = "<group>"; };
|
503FC2CA23906B5500B8095B /* GameScene.sks */ = {isa = PBXFileReference; lastKnownFileType = file.sks; path = GameScene.sks; sourceTree = "<group>"; };
|
||||||
503FC2CE23906B5500B8095B /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; };
|
503FC2CE23906B5500B8095B /* GameScene.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameScene.swift; sourceTree = "<group>"; };
|
||||||
@ -26,6 +26,7 @@
|
|||||||
503FC2D523906B5800B8095B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
503FC2D523906B5800B8095B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
503FC2D823906B5800B8095B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
503FC2D823906B5800B8095B /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
503FC2DA23906B5800B8095B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
503FC2DA23906B5800B8095B /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
509975CE239563BE004C3CAF /* SVS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = SVS.entitlements; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
/* Begin PBXFrameworksBuildPhase section */
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
@ -50,7 +51,7 @@
|
|||||||
503FC2C623906B5500B8095B /* Products */ = {
|
503FC2C623906B5500B8095B /* Products */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */,
|
503FC2C523906B5500B8095B /* SVS.app */,
|
||||||
);
|
);
|
||||||
name = Products;
|
name = Products;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@ -58,6 +59,7 @@
|
|||||||
503FC2C723906B5500B8095B /* Shitty Volume Switcher */ = {
|
503FC2C723906B5500B8095B /* Shitty Volume Switcher */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
|
509975CE239563BE004C3CAF /* SVS.entitlements */,
|
||||||
503FC2C823906B5500B8095B /* AppDelegate.swift */,
|
503FC2C823906B5500B8095B /* AppDelegate.swift */,
|
||||||
503FC2CA23906B5500B8095B /* GameScene.sks */,
|
503FC2CA23906B5500B8095B /* GameScene.sks */,
|
||||||
503FC2CE23906B5500B8095B /* GameScene.swift */,
|
503FC2CE23906B5500B8095B /* GameScene.swift */,
|
||||||
@ -87,7 +89,7 @@
|
|||||||
);
|
);
|
||||||
name = "Shitty Volume Switcher";
|
name = "Shitty Volume Switcher";
|
||||||
productName = "Shitty Volume Switcher";
|
productName = "Shitty Volume Switcher";
|
||||||
productReference = 503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */;
|
productReference = 503FC2C523906B5500B8095B /* SVS.app */;
|
||||||
productType = "com.apple.product-type.application";
|
productType = "com.apple.product-type.application";
|
||||||
};
|
};
|
||||||
/* End PBXNativeTarget section */
|
/* End PBXNativeTarget section */
|
||||||
@ -288,6 +290,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = "Shitty Volume Switcher/SVS.entitlements";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = T87U8Q4BB3;
|
DEVELOPMENT_TEAM = T87U8Q4BB3;
|
||||||
INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist";
|
INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist";
|
||||||
@ -296,7 +299,8 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher";
|
PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = SVS;
|
||||||
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
};
|
};
|
||||||
@ -306,6 +310,7 @@
|
|||||||
isa = XCBuildConfiguration;
|
isa = XCBuildConfiguration;
|
||||||
buildSettings = {
|
buildSettings = {
|
||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CODE_SIGN_ENTITLEMENTS = "Shitty Volume Switcher/SVS.entitlements";
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
DEVELOPMENT_TEAM = T87U8Q4BB3;
|
DEVELOPMENT_TEAM = T87U8Q4BB3;
|
||||||
INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist";
|
INFOPLIST_FILE = "Shitty Volume Switcher/Info.plist";
|
||||||
@ -314,7 +319,8 @@
|
|||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher";
|
PRODUCT_BUNDLE_IDENTIFIER = "edu.smt.Shitty-Volume-Switcher";
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = SVS;
|
||||||
|
SUPPORTS_MACCATALYST = NO;
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
TARGETED_DEVICE_FAMILY = "1,2";
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,93 +1,111 @@
|
|||||||
{
|
{
|
||||||
"images" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "20x20",
|
"size" : "20x20",
|
||||||
"scale" : "2x"
|
"idiom": "iphone",
|
||||||
|
"filename" : "Untitled-1-20@2x.png",
|
||||||
|
"scale": "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "20x20",
|
"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",
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-29@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-29@3x.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-40@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-40@3x.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "60x60",
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-60@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "iphone",
|
|
||||||
"size" : "60x60",
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Untitled-1-60@3x.png",
|
||||||
"scale" : "3x"
|
"scale" : "3x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "20x20",
|
|
||||||
"scale" : "1x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "20x20",
|
|
||||||
"scale" : "2x"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-29.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "29x29",
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-29@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-40.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "40x40",
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-40@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "76x76",
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-76.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "76x76",
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-76@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ipad",
|
|
||||||
"size" : "83.5x83.5",
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Untitled-1-83.5@2x.png",
|
||||||
"scale" : "2x"
|
"scale" : "2x"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"idiom" : "ios-marketing",
|
|
||||||
"size" : "1024x1024",
|
"size" : "1024x1024",
|
||||||
|
"idiom" : "ios-marketing",
|
||||||
|
"filename" : "Untitled-1-1024.png",
|
||||||
"scale" : "1x"
|
"scale" : "1x"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -95,4 +113,4 @@
|
|||||||
"version" : 1,
|
"version" : 1,
|
||||||
"author" : "xcode"
|
"author" : "xcode"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
@ -46,11 +46,17 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
|
|
||||||
physicsWorld.gravity = .zero
|
physicsWorld.gravity = .zero
|
||||||
|
|
||||||
|
spawnBall(CGPoint(x: 0, y: 0))
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func spawnBall(_ location: CGPoint!){
|
||||||
ball = SKSpriteNode(imageNamed: "ball")
|
ball = SKSpriteNode(imageNamed: "ball")
|
||||||
ball.setScale(2.5)
|
ball.setScale(2.5)
|
||||||
ball.physicsBody = SKPhysicsBody(circleOfRadius: ball.size.width / 2.0)
|
ball.physicsBody = SKPhysicsBody(circleOfRadius: ball.size.width / 2.0)
|
||||||
ball.physicsBody?.restitution = 0.7
|
ball.physicsBody?.restitution = 0.95
|
||||||
ball.position = CGPoint(x: 0, y: 0)
|
ball.position = location
|
||||||
ball.physicsBody?.categoryBitMask = ballCategory
|
ball.physicsBody?.categoryBitMask = ballCategory
|
||||||
ball.zPosition = 5
|
ball.zPosition = 5
|
||||||
addChild(ball)
|
addChild(ball)
|
||||||
@ -59,7 +65,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
func didBegin(_ contact: SKPhysicsContact) {
|
func didBegin(_ contact: SKPhysicsContact) {
|
||||||
let contactNode = contact.bodyA.node as! SKSpriteNode
|
let contactNode = contact.bodyA.node as! SKSpriteNode
|
||||||
MPVolumeView.setVolume(Float(contact.bodyA.contactTestBitMask)/31)
|
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 reverseScale = scale.reversed()
|
||||||
let actions = [scale, reverseScale]
|
let actions = [scale, reverseScale]
|
||||||
let sequence = SKAction.sequence(actions)
|
let sequence = SKAction.sequence(actions)
|
||||||
@ -73,12 +79,15 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
// guard let touch = touches.first else { return }
|
guard let touch = touches.first else { return }
|
||||||
// let location = touch.location(in: self)
|
let touchLocation = touch.location(in: self)
|
||||||
// lastTouchPosition = location
|
spawnBall(touchLocation)
|
||||||
// }
|
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// for t in touches { self.touchDown(atPoint: t.location(in: self)) }
|
// for t in touches { self.touchDown(atPoint: t.location(in: self)) }
|
||||||
// }
|
// }
|
||||||
@ -91,12 +100,11 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
//
|
//
|
||||||
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
override func touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
// lastTouchPosition = nil
|
// lastTouchPosition = nil
|
||||||
let touch = touches.first
|
// let touch = touches.first
|
||||||
let touchLocation = touch!.location(in: self)
|
// let touchLocation = touch!.location(in: self)
|
||||||
// Check if the location of the touch is within the button's bounds
|
// if button.contains(touchLocation) {
|
||||||
if button.contains(touchLocation) {
|
// MPVolumeView.setVolume(0.5)
|
||||||
MPVolumeView.setVolume(0.5)
|
// }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
// override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
|
// override func touchesCancelled(_ touches: Set<UITouch>, with event: UIEvent?) {
|
||||||
@ -107,7 +115,7 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
|||||||
override func update(_ currentTime: TimeInterval) {
|
override func update(_ currentTime: TimeInterval) {
|
||||||
// Called before each frame is rendered
|
// Called before each frame is rendered
|
||||||
if let accelerometerData = motionManager.accelerometerData {
|
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)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
10
Shitty Volume Switcher/SVS.entitlements
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>com.apple.security.app-sandbox</key>
|
||||||
|
<true/>
|
||||||
|
<key>com.apple.security.network.client</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||