This commit is contained in:
Max Hunt 2020-01-10 14:47:22 +00:00
parent 8aaa013fc6
commit 6bc4f4f705
20 changed files with 93 additions and 51 deletions

View File

@ -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 = "<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>"; };
@ -26,6 +26,7 @@
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>"; };
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 */
/* Begin PBXFrameworksBuildPhase section */
@ -50,7 +51,7 @@
503FC2C623906B5500B8095B /* Products */ = {
isa = PBXGroup;
children = (
503FC2C523906B5500B8095B /* Shitty Volume Switcher.app */,
503FC2C523906B5500B8095B /* SVS.app */,
);
name = Products;
sourceTree = "<group>";
@ -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";
};

View File

@ -1,93 +1,111 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "20x20",
"idiom": "iphone",
"filename" : "Untitled-1-20@2x.png",
"scale": "2x"
},
{
"idiom" : "iphone",
"size" : "20x20",
"idiom": "iphone",
"filename" : "Untitled-1-20@3x.png",
"scale": "3x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"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",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"filename" : "Untitled-1-29@2x.png",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"size" : "40x40",
"filename" : "Untitled-1-29@3x.png",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Untitled-1-40@2x.png",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "Untitled-1-40@3x.png",
"scale" : "3x"
},
{
"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"
}
],

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

View File

@ -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)
@ -74,11 +80,14 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
}
// override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
// guard let touch = touches.first else { return }
// let location = touch.location(in: self)
// lastTouchPosition = location
// }
override func touchesBegan(_ touches: Set<UITouch>, 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<UITouch>, 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<UITouch>, 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)
}
}

View 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>