diff --git a/GoldWars/GoldWars/Scenes/GameScene.swift b/GoldWars/GoldWars/Scenes/GameScene.swift index 9bb380c..c2f1d1a 100644 --- a/GoldWars/GoldWars/Scenes/GameScene.swift +++ b/GoldWars/GoldWars/Scenes/GameScene.swift @@ -16,7 +16,7 @@ class GameScene: SKScene{ var isMoveTouch = false var currentDraggedBase : Base? - static var sendUnits: CGFloat = 0 + static var sendUnits: Int = 0 var collisionBase: Base? override func sceneDidLoad() { @@ -113,7 +113,7 @@ class GameScene: SKScene{ touchLocation: touchLocation, collisionBase: collisionBase) ) - GameScene.sendUnits = CGFloat(currentDraggedBase!.unitCount / 2) + GameScene.sendUnits = Int(currentDraggedBase!.unitCount / 2) } } } @@ -123,7 +123,7 @@ class GameScene: SKScene{ for e in entityManager.entities{ if let modal = e as? Modal { if modal.type == ModalType.BaseAttack || modal.type == ModalType.BaseMoveOwnUnits { - GameScene.sendUnits = ((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up) + GameScene.sendUnits = Int(((e.component(ofType: SliderComponent.self)?.sliderNode.getValue ?? 0) * CGFloat((e as! Modal).unitCount)).rounded(.up)) //TODO: refactor this quick and dirty fix if GameScene.sendUnits == 0 {