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 df15181..b35aecb 100644 --- a/GoldWars/GoldWars/Game/GameScene.swift +++ b/GoldWars/GoldWars/Game/GameScene.swift @@ -36,6 +36,14 @@ class GameScene: SKScene { } } + 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 touchDown(atPoint pos : CGPoint) { diff --git a/GoldWars/GoldWars/Info.plist b/GoldWars/GoldWars/Info.plist index 870f784..53cfd47 100644 --- a/GoldWars/GoldWars/Info.plist +++ b/GoldWars/GoldWars/Info.plist @@ -38,8 +38,6 @@ UISupportedInterfaceOrientations~ipad - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight