Merge branch '11-view-background' into 'development'

Background add

Closes #11

See merge request marcel.schwarz/software-projekt-2!18
This commit is contained in:
Aldin Duraki 2020-04-22 14:49:41 +00:00
commit fdbce8e56d
5 changed files with 31 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 KiB

View File

@ -0,0 +1,23 @@
{
"images" : [
{
"filename" : "Backgorund.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Background@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Background@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@ -54,6 +54,14 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
addPhysicsBodyToBase() addPhysicsBodyToBase()
} }
override func didMove(to view: SKView) {
let background = SKSpriteNode(imageNamed: "Background")
background.position = CGPoint(x: self.size.width / 2, y: self.size.height / 2)
background.zPosition = -1
background.size = self.size
self.addChild(background)
}
func addPhysicsBodyToBase() { func addPhysicsBodyToBase() {
bases[5].physicsBody = SKPhysicsBody(circleOfRadius: 20) bases[5].physicsBody = SKPhysicsBody(circleOfRadius: 20)