diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png new file mode 100644 index 0000000..1137158 Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Backgorund.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png new file mode 100644 index 0000000..0bc9d0f Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@2x.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png new file mode 100644 index 0000000..064e40c Binary files /dev/null and b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Background@3x.png differ diff --git a/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json new file mode 100644 index 0000000..1029a8b --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/Background.imageset/Contents.json @@ -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 + } +} diff --git a/GoldWars/GoldWars/Game/GameScene.swift b/GoldWars/GoldWars/Game/GameScene.swift index 71a2ac5..00b152a 100644 --- a/GoldWars/GoldWars/Game/GameScene.swift +++ b/GoldWars/GoldWars/Game/GameScene.swift @@ -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)