From d8d80b8eb7b946d386dd286e7bf427bd160612e7 Mon Sep 17 00:00:00 2001 From: 127-Z3R0 <81heti1bif@hft-stuttgart.de> Date: Fri, 1 May 2020 23:43:37 +0200 Subject: [PATCH 1/3] add asset SkyBackground and Components --- GoldWars/GoldWars.xcodeproj/project.pbxproj | 8 +++++ .../SkyBackground.imageset/Contents.json | 21 +++++++++++++ .../SkyBackground.imageset/SkyBackground.jpg | Bin 0 -> 20973 bytes .../Components/BackgroundComponent.swift | 29 ++++++++++++++++++ .../GoldWars/Components/BackgroundNode.swift | 28 +++++++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json create mode 100644 GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground.jpg create mode 100644 GoldWars/GoldWars/Components/BackgroundComponent.swift create mode 100644 GoldWars/GoldWars/Components/BackgroundNode.swift diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 41c82b9..8d513d0 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -33,6 +33,8 @@ 9EC86B9F245C88A300796EF3 /* Modal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC86B9E245C88A300796EF3 /* Modal.swift */; }; 9EC86BA6245C8AD000796EF3 /* ModalType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC86BA5245C8AD000796EF3 /* ModalType.swift */; }; ABA03DA0244BD54F00A66916 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA03D9F244BD54F00A66916 /* Base.swift */; }; + C0BB0378245CCF4D00EEAC81 /* BackgroundNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */; }; + C0BB037A245CCF6300EEAC81 /* BackgroundComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -86,6 +88,8 @@ 9EC86BA5245C8AD000796EF3 /* ModalType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalType.swift; sourceTree = ""; }; 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GoldWars.entitlements; sourceTree = ""; }; ABA03D9F244BD54F00A66916 /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = ""; }; + C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundNode.swift; sourceTree = ""; }; + C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundComponent.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -181,6 +185,8 @@ 9E78ACBD245CC9C000526FF7 /* AtkBoostSkillComponent.swift */, 9E78ACC3245CCA3600526FF7 /* SpySkillComponent.swift */, 9E78ACC1245CC9EE00526FF7 /* DefBoostSkillComponent.swift */, + C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */, + C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */, ); path = Components; sourceTree = ""; @@ -375,7 +381,9 @@ 110360D9244B101A008610AF /* GameScene.swift in Sources */, 116060F7245C57D2004E5A36 /* EntityManager.swift in Sources */, 9E78ACBA245CBDAF00526FF7 /* HUD.swift in Sources */, + C0BB0378245CCF4D00EEAC81 /* BackgroundNode.swift in Sources */, 11738A3B24508F68004426F1 /* Unit.swift in Sources */, + C0BB037A245CCF6300EEAC81 /* BackgroundComponent.swift in Sources */, 11036113244B3E30008610AF /* MenuScene.swift in Sources */, 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */, 9EA3ABED245C8143006BC61D /* ModalBackgroundComponent.swift in Sources */, diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json b/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json new file mode 100644 index 0000000..231694f --- /dev/null +++ b/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "filename" : "SkyBackground.jpg", + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground.jpg b/GoldWars/GoldWars/Assets.xcassets/SkyBackground.imageset/SkyBackground.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8b499d5d4e9254516ad6279bcbd1bd94841015e3 GIT binary patch literal 20973 zcmeHO2UJwan!X*N$vKPANCrVtlY@X{5s6JkBsMKMBS{by6i^TZl$<4rl9S{lN)9R@ zIV&JEIczhtZ)SG)yf-h+oISgir*3~#xK;mOU;Xu0)%A4jbP6C-S5{L7Kp+sHg8c`a z&JY=@DJoiA*U?f|yQ+lE001J@t0*UDFc|ZF!T(&VLOP$bZ6M^XMFLeGC$+XXV}`&$r@Yctj{jij@DtxDj z(e(V9_G{f=)0{H^KpcbB&EsFwZYBaiWf%a^efl+xEe!xj?*c$Y?{DOxIpd4Hhlh*g zrAyx4-ux&VEB-Tu{t|w-z%M2LI`~a{{Aca`qC5B%8(T}yTORN;rCK@Pa`tqCySrFg z*}(b!JBk14iofaBZ~Adj$Hvyi&Bh7almV7yC?`AYa64I}JW$R~aFo+u8{vPl+Hd-B z27l%?7EorL08|$I09h{;0QuSjKq(0Uh-nHo2lUIhUBx#5&SoBxdGTl7V=*@Wr{{lp zfTOX0g56Pe@Uvt^9X+^}r<>Oq#?Fbe2M$00kOEWy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%C(VwOw)<}v<7!^YOQU6nJm1y>TpygZIQ|jv9LVr=wXVVWcU$gSTU`7;@M}o zx2~RexlYaTOM~+KQJW3&Qi+=R=(bpTvL$b=yUD0xe#WaW?F``J=|EC{9Erk6t&Ytw z`|WpLULB Date: Fri, 1 May 2020 23:57:23 +0200 Subject: [PATCH 2/3] added moving cloudy background --- GoldWars/GoldWars.xcodeproj/project.pbxproj | 8 ----- .../Components/BackgroundComponent.swift | 29 ------------------- .../GoldWars/Components/BackgroundNode.swift | 28 ------------------ GoldWars/GoldWars/Scenes/GameScene.swift | 27 ++++++++++++++++- 4 files changed, 26 insertions(+), 66 deletions(-) delete mode 100644 GoldWars/GoldWars/Components/BackgroundComponent.swift delete mode 100644 GoldWars/GoldWars/Components/BackgroundNode.swift diff --git a/GoldWars/GoldWars.xcodeproj/project.pbxproj b/GoldWars/GoldWars.xcodeproj/project.pbxproj index 8d513d0..41c82b9 100644 --- a/GoldWars/GoldWars.xcodeproj/project.pbxproj +++ b/GoldWars/GoldWars.xcodeproj/project.pbxproj @@ -33,8 +33,6 @@ 9EC86B9F245C88A300796EF3 /* Modal.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC86B9E245C88A300796EF3 /* Modal.swift */; }; 9EC86BA6245C8AD000796EF3 /* ModalType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9EC86BA5245C8AD000796EF3 /* ModalType.swift */; }; ABA03DA0244BD54F00A66916 /* Base.swift in Sources */ = {isa = PBXBuildFile; fileRef = ABA03D9F244BD54F00A66916 /* Base.swift */; }; - C0BB0378245CCF4D00EEAC81 /* BackgroundNode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */; }; - C0BB037A245CCF6300EEAC81 /* BackgroundComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -88,8 +86,6 @@ 9EC86BA5245C8AD000796EF3 /* ModalType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModalType.swift; sourceTree = ""; }; 9ECD3699245C91F7008DEEBD /* GoldWars.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = GoldWars.entitlements; sourceTree = ""; }; ABA03D9F244BD54F00A66916 /* Base.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Base.swift; sourceTree = ""; }; - C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundNode.swift; sourceTree = ""; }; - C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundComponent.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -185,8 +181,6 @@ 9E78ACBD245CC9C000526FF7 /* AtkBoostSkillComponent.swift */, 9E78ACC3245CCA3600526FF7 /* SpySkillComponent.swift */, 9E78ACC1245CC9EE00526FF7 /* DefBoostSkillComponent.swift */, - C0BB0377245CCF4D00EEAC81 /* BackgroundNode.swift */, - C0BB0379245CCF6300EEAC81 /* BackgroundComponent.swift */, ); path = Components; sourceTree = ""; @@ -381,9 +375,7 @@ 110360D9244B101A008610AF /* GameScene.swift in Sources */, 116060F7245C57D2004E5A36 /* EntityManager.swift in Sources */, 9E78ACBA245CBDAF00526FF7 /* HUD.swift in Sources */, - C0BB0378245CCF4D00EEAC81 /* BackgroundNode.swift in Sources */, 11738A3B24508F68004426F1 /* Unit.swift in Sources */, - C0BB037A245CCF6300EEAC81 /* BackgroundComponent.swift in Sources */, 11036113244B3E30008610AF /* MenuScene.swift in Sources */, 9EA3ABE9245C6DAA006BC61D /* DefaultBaseComponent.swift in Sources */, 9EA3ABED245C8143006BC61D /* ModalBackgroundComponent.swift in Sources */, diff --git a/GoldWars/GoldWars/Components/BackgroundComponent.swift b/GoldWars/GoldWars/Components/BackgroundComponent.swift deleted file mode 100644 index 8c8d3a8..0000000 --- a/GoldWars/GoldWars/Components/BackgroundComponent.swift +++ /dev/null @@ -1,29 +0,0 @@ -// -// BackgroundComponent.swift -// GoldWars -// -// Created by Tim Herbst on 01.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import UIKit -import GameplayKit -import SpriteKit - -class BackgroundComponent: GKComponent { - var sky: BackgroundNode - - init(size: CGSize, anchorPoint: CGPoint) { - super.init() - self.sky = BackgroundNode(imageNamed: "cloud") - self.sky.name = "clouds" - self.sky.size = CGSize(width: size.width, height: size.height) - self.sky.position = CGPoint(x: CGFloat(i) * sky.size.width , y: anchorPoint.y / 2) - - - } - - required init?(coder: NSCoder) { - fatalError("init(coder:) has not been implemented") - } -} diff --git a/GoldWars/GoldWars/Components/BackgroundNode.swift b/GoldWars/GoldWars/Components/BackgroundNode.swift deleted file mode 100644 index 74d61e8..0000000 --- a/GoldWars/GoldWars/Components/BackgroundNode.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// BackgroundNode.swift -// GoldWars -// -// Created by Tim Herbst on 01.05.20. -// Copyright © 2020 SP2. All rights reserved. -// - -import UIKit -import SpriteKit - -class BackgroundNode: SKSpriteNode { - - func update(_ currentTime: TimeInterval) { - scrollBackground() - } - - func scrollBackground(){ - self.enumerateChildNodes(withName: "clouds", using: ({ - (node, error) in - node.position.x -= 2 - print("node position x = \(node.position.x)") - if node.position.x < -(self.scene?.size.width)! { - node.position.x += (self.scene?.size.width)! * 3 - } - })) - } -} diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index b941b7d..4f8477c 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -18,8 +18,21 @@ class GameScene: SKScene{ entityManager.add(Base(textureName: "Base", team: .team1)) entityManager.add(Base(textureName: "Base", team: .team2)) entityManager.add(HUD(size: self.size)) - initMap() + createBackground() + + } + + func createBackground() { + for i in 0...2 { + let sky = SKSpriteNode(imageNamed: "SkyBackground") + sky.name = "clouds" + sky.zPosition = -1 + sky.size = CGSize(width: (self.scene?.size.width)!, height: (self.scene?.size.height)!) + sky.position = CGPoint(x: CGFloat(i) * sky.size.width , y: (self.frame.size.height / 2)) + + self.addChild(sky) + } } // TODO: Issue #24 create Map generation Service @@ -116,4 +129,16 @@ class GameScene: SKScene{ } } + override func update(_ currentTime: TimeInterval) { + self.enumerateChildNodes(withName: "clouds", using: ({ + (node, error) in + // 1 + node.position.x -= 2 + print("node position x = \(node.position.x)") + // 2 + if node.position.x < -(self.scene?.size.width)! { + node.position.x += (self.scene?.size.width)! * 3 + } + })) + } } From 5b7c5039e14ad29ba130367c7a9b3e63528db9f7 Mon Sep 17 00:00:00 2001 From: Niko Jochim Date: Sat, 2 May 2020 00:14:21 +0200 Subject: [PATCH 3/3] add background to menu-scene --- GoldWars/GoldWars/GameViewController.swift | 3 ++- GoldWars/GoldWars/Scenes/GameScene.swift | 3 --- GoldWars/GoldWars/Scenes/MenuScene.sks | Bin 8253 -> 8154 bytes GoldWars/GoldWars/Scenes/MenuScene.swift | 25 ++++++++++++++++++++- 4 files changed, 26 insertions(+), 5 deletions(-) diff --git a/GoldWars/GoldWars/GameViewController.swift b/GoldWars/GoldWars/GameViewController.swift index 2f7d3d6..29f521d 100644 --- a/GoldWars/GoldWars/GameViewController.swift +++ b/GoldWars/GoldWars/GameViewController.swift @@ -17,7 +17,8 @@ class GameViewController: UIViewController { if let view = self.view as! SKView? { if let scene = SKScene(fileNamed: "MenuScene") { - //scene.scaleMode = .aspectFill + scene.size = self.view.bounds.size + scene.scaleMode = .aspectFill view.presentScene(scene) //TODO: create dev profile or remove on delivery view.showsFPS = true diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index 4f8477c..8a2f2d4 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -132,10 +132,7 @@ class GameScene: SKScene{ override func update(_ currentTime: TimeInterval) { self.enumerateChildNodes(withName: "clouds", using: ({ (node, error) in - // 1 node.position.x -= 2 - print("node position x = \(node.position.x)") - // 2 if node.position.x < -(self.scene?.size.width)! { node.position.x += (self.scene?.size.width)! * 3 } diff --git a/GoldWars/GoldWars/Scenes/MenuScene.sks b/GoldWars/GoldWars/Scenes/MenuScene.sks index 4eb9991a14933fbd3987919cff165479fea8779a..487cd23a7a2dcd5f44cbf4f673bb5d5095227c64 100644 GIT binary patch delta 4359 zcmcIm2~-qE8m_9D9;WS?p6Z#NK12j0Y81g4hHH|Iq7oCMfI2E3C~}NQKtN8F;1uzW z7&YUCR|tw4jVHz!V>~vOxzuQO*BmZpce9C@Y&Ndh&Fxk<;7Z=Uef##kg;!NwfB#+c z|KI=BSM_qrheOvKu+)>s2_%civV-`^wI?F2>%c~^2{eMuU_02gwmm5@7KX!dunf+H zRj?Y)hYMgGTnOvoVz>k@hbv(NTn*R2b?_y43Z8~%;4AQT_!fK{o`)A;8~g+OBm6V` z47S4?@GtOdcnf|5zlGnSFcg6zQ6JP74L}1?G)hO~(0JrSlh9N&4P~Ln(IT`AtwasI z&}Os+ZAIHq6M6>igc+y>9YBZCG4uj@sr4lM6pgDQAta0#h=~9apbd~p(u>^*`0)Iw%p}(Xur?RlLBsj!$PsAlq3!=eOAlO9kB~T73zUMr+uGOK7R+;0=9wbtaRVMY#l2; z4O&`26L8UX+xeWOxlHPHw97@~jEQ7M)BYBlOjdR_)a zH2Pw24U~XVq7Wt)ACp_$f#j#4 zrHO=g)aG+=ea4+K=q1_#KBq;hXGLpxhs!qbbu-x3+RR?lQi&)1Ns1nb7Je_{qCKEA z^3Z+|4R0XUf=t!J24pxHppz_`xaoV1f?5KDF(R>@DZqF=g?qIW-N%;#(V3!ylONr;tj6h#gJMpPjY{7A0M0axDMhF!c3}l4~lTt>6L>^ z;j$^d(G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++ b/GoldWars/GoldWars/Scenes/MenuScene.swift @@ -13,7 +13,20 @@ class MenuScene: SKScene { var startGameButtonNode:SKSpriteNode! var settingsButtonNode:SKSpriteNode! - + override func sceneDidLoad() { + for i in 0...2 { + let sky = SKSpriteNode(imageNamed: "SkyBackground") + sky.name = "clouds" + sky.zPosition = -1 + sky.size = CGSize(width: self.size.width, height: self.size.height) + sky.position = CGPoint(x: CGFloat(i) * sky.size.width , y: (self.frame.size.height / 2)) + + self.addChild(sky) + } + } + + + override func touchesBegan(_ touches: Set, with event: UIEvent?) { guard let touch = touches.first else { return @@ -33,4 +46,14 @@ class MenuScene: SKScene { } } + override func update(_ currentTime: TimeInterval) { + self.enumerateChildNodes(withName: "clouds", using: ({ + (node, error) in + node.position.x -= 2 + if node.position.x < -(self.scene?.size.width)! { + node.position.x += (self.scene?.size.width)! * 3 + } + })) + } + }