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:
commit
fdbce8e56d
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 149 KiB |
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 423 KiB |
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png
vendored
Normal file
BIN
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 849 KiB |
23
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json
vendored
Normal file
23
GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json
vendored
Normal 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
|
||||
}
|
||||
}
|
@ -54,6 +54,14 @@ class GameScene: SKScene, SKPhysicsContactDelegate {
|
||||
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() {
|
||||
bases[5].physicsBody = SKPhysicsBody(circleOfRadius: 20)
|
||||
|
Loading…
Reference in New Issue
Block a user