From 8dfb2744161ffa87974abfa24a78e6dc1ca03083 Mon Sep 17 00:00:00 2001 From: Marcel Schwarz Date: Sat, 18 Apr 2020 15:23:38 +0200 Subject: [PATCH] Remove sample code --- GoldWars/GoldWars/Actions.sks | Bin 1892 -> 0 bytes GoldWars/GoldWars/GameScene.sks | Bin 4694 -> 4056 bytes GoldWars/GoldWars/GameScene.swift | 73 ++++-------------------------- 3 files changed, 9 insertions(+), 64 deletions(-) delete mode 100644 GoldWars/GoldWars/Actions.sks diff --git a/GoldWars/GoldWars/Actions.sks b/GoldWars/GoldWars/Actions.sks deleted file mode 100644 index 053052001e4f4fd4d597c1c74f1ab1919ec27642..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1892 zcmZ`)Yj6`)6uz&eFQ92@dGy_G5(=enKp96$L5ff*(6lru;IeI&c1yYm*-fOibnb+L ziXbnkh*;Vbc~r*AOL@vLhztS(Eh-2K3jT3q#^DDlI*vCFpjFt+-Fx=z-gC}(zVF^t zIc&13<>Xv}2or9=_dl5RZpo?2cEzl>SJg??nrhLD&gxp3xy$sL-4PAo%Jy#ExRB7O z=;0$qjm{X8nUz1WVA9l@TDfkqtzNM^URk~7t+ngczrESpxqbJc!$*#v{qo#bm#=+y z{YJT7aoKFWVc`)22kRh)+mNN=`{lyd%r-RrS+&|N#FSadQUV85ii(Z)Lojir=Xgp25sf#I^mi%JG^u!s( zDK90>ESWVseojKEiRVofW{c67zTjnHp|OhRCDS|~Hp#}|yCp#v&7R6cXN{zpHl6qjc~w zO^^60c+l0=&Y0pK8ex^M=H}##Nny8TJxiRbRvFNpBGyahfGMdJrec2&I#rk3Y$`7F z3(;I+n&saXPvL;~aj>kJao}0*@fbZkzslsVHh?CDCI!(X(?pugej#l5uqHea4dM%e z66;^_hK+3V6gr(^gLi|QA=uPf$*Pr>xFn@o>U_uL?(_Iqi|;ZmzHivZr&D84a(X5? z1Iyk=+z&g+B=nU9kANsdi(Vlc;w};)px&M>h$e%Kt=8c|UIN$CZ z!@_0y!zDj4-1!TP&S_4&%h7q>Ck6S(A!oZEoOf^keleoobaeyEEu6&wVy4H$NJL0wCxjOH9R5gJdlX z9-cinZ~gdFxgaZx>}5{7U86Y^vM-}R96L}lK^}Mp*ntZ)ffle9w1UlG3)l+UKs(q4 zy1`zs9~=aqg2UhhxCE|&+u$zv6A~B+<6$C9hN+N;1~?Lqf*Eiud>$6TX>d9$fpee< zmct5I2baSY@HO}bd=svLYvFph5pIHQa3|aYyWw8AA0C9a;I9ax5Htj(pbRtx%|SA9 zqZYIdwW7^v3)+g>P&@LX?Pv$ug}Trl^bz_P?L!C9C+HA5f{vlj&>3_I^`PtM4!Vo( zqu(*YAvhYxV;+yhId}rL;zhU?*I^r0umd}>hTV86Zp2Nv8B^@REqEn<9k0Tx@h04c z+wpFE03XID@#pv~zJjmf+xR~I13$oj<9`Ssh!8S>gpw!{N0Lbz(Gw#{Ck12%5s5+^ z#7Q*bCQC^pX(G*p5)Wx1Ye*}3k9f%ra-5tXC&?*tnw%kL$vJX?TqKuCFS$W}Cclt- zP%{{=8& BT4?|P diff --git a/GoldWars/GoldWars/GameScene.sks b/GoldWars/GoldWars/GameScene.sks index 4fe4d9f41e763cb136277f8a00e3f7ce3ea3daa1..693e11deb0f4e118617e2dd603eec366ae7f3704 100644 GIT binary patch delta 2548 zcmZ`)3sh9c8UAMP+_`%n;3B^8fryBRfCv&nQ9(dd1W{Cw7}teeWy531?gA1*cdUvg zF^XjZIHdO*F=wHX3X5sx~nawWf&}H3>~@V`^*DV^8etE;en>>74W5nfd1R z&-eZF-wSbn7~MH|5fluph--GZJx*7{@;IBjy2dGbOX9q)#)>#s)q{>|uV)}gN0-$y zprowG(dw}0_D?zwGgN5MVIU0Q7yt_*{0GD5`lj=2PWTL-d(bi$kr)Ig9z-J^LJQWS z6_4UEJdQ1R0$Z^So$%u+9KvB7!OJ*`U*k2L#BcEy-o_cci}!FI7jOw55<*Ob5e>JA zPNK+gGJ=dGV@NC+M`B1knMBga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KeJgz@U63wGm!&JxRT*SK7Uf=YvYaAk%Gb$-a;aPSgWca`^* zQ_A0!Gs-`dkCjiAua)!4x5{_Q1?7@*S-GNIb%IlHicZ-XOLnF>Q=Qq)5zahkfpeU* z#_4kgogL0q&h^f7&Wp|;U74F-R;`w+U(llddBsF>xk==>m%3Kt}7~2 zRke@WS4~wj)$7#ZYMxr47OG>_aq5lgP3i=7ntF>mNA;?U)ed!~x=xL&52)X$7u8D| z#xy|_HCap2+*)s~kCvjPYZ=-wZIm`ntI+0XbG3O|oz|wU)MDByZHxAt_PX|=_KEhD z_MLV?yQE##u4q?vhpy-@Jy}oF`|AVsbbXjUN-xu==yP?i?$b@ZP4CoK>l^i5`V0Ci z`kVS&`aAkD{gnQpZl2b^)W6dIsehwiGQg0G-bO!TfHBC(FoqbzjNwL}QDBrCb;dGd rg%LCEHXbr|8wZS!jL(hp#s%Y&aoMyzL=A^>6y diff --git a/GoldWars/GoldWars/GameScene.swift b/GoldWars/GoldWars/GameScene.swift index fa462af..6cc99d3 100644 --- a/GoldWars/GoldWars/GameScene.swift +++ b/GoldWars/GoldWars/GameScene.swift @@ -15,96 +15,41 @@ class GameScene: SKScene { var graphs = [String : GKGraph]() private var lastUpdateTime : TimeInterval = 0 - private var label : SKLabelNode? - private var spinnyNode : SKShapeNode? override func sceneDidLoad() { - - self.lastUpdateTime = 0 - // Get label node from scene and store it for use later - self.label = self.childNode(withName: "//helloLabel") as? SKLabelNode - if let label = self.label { - label.alpha = 0.0 - label.run(SKAction.fadeIn(withDuration: 2.0)) - } - - // Create shape node to use during mouse interaction - let w = (self.size.width + self.size.height) * 0.05 - self.spinnyNode = SKShapeNode.init(rectOf: CGSize.init(width: w, height: w), cornerRadius: w * 0.3) - - if let spinnyNode = self.spinnyNode { - spinnyNode.lineWidth = 2.5 - - spinnyNode.run(SKAction.repeatForever(SKAction.rotate(byAngle: CGFloat(Double.pi), duration: 1))) - spinnyNode.run(SKAction.sequence([SKAction.wait(forDuration: 0.5), - SKAction.fadeOut(withDuration: 0.5), - SKAction.removeFromParent()])) - } } - func touchDown(atPoint pos : CGPoint) { - if let n = self.spinnyNode?.copy() as! SKShapeNode? { - n.position = pos - n.strokeColor = SKColor.green - self.addChild(n) - } + } func touchMoved(toPoint pos : CGPoint) { - if let n = self.spinnyNode?.copy() as! SKShapeNode? { - n.position = pos - n.strokeColor = SKColor.blue - self.addChild(n) - } + } func touchUp(atPoint pos : CGPoint) { - if let n = self.spinnyNode?.copy() as! SKShapeNode? { - n.position = pos - n.strokeColor = SKColor.red - self.addChild(n) - } + } override func touchesBegan(_ touches: Set, with event: UIEvent?) { - if let label = self.label { - label.run(SKAction.init(named: "Pulse")!, withKey: "fadeInOut") - } - - for t in touches { self.touchDown(atPoint: t.location(in: self)) } + } override func touchesMoved(_ touches: Set, with event: UIEvent?) { - for t in touches { self.touchMoved(toPoint: t.location(in: self)) } + } override func touchesEnded(_ touches: Set, with event: UIEvent?) { - for t in touches { self.touchUp(atPoint: t.location(in: self)) } + } override func touchesCancelled(_ touches: Set, with event: UIEvent?) { - for t in touches { self.touchUp(atPoint: t.location(in: self)) } + } - + override func update(_ currentTime: TimeInterval) { - // Called before each frame is rendered - - // Initialize _lastUpdateTime if it has not already been - if (self.lastUpdateTime == 0) { - self.lastUpdateTime = currentTime - } - - // Calculate time since last update - let dt = currentTime - self.lastUpdateTime - - // Update entities - for entity in self.entities { - entity.update(deltaTime: dt) - } - - self.lastUpdateTime = currentTime + } }