review changes
This commit is contained in:
parent
adf01db4bf
commit
bddad86674
@ -30,8 +30,7 @@ class SliderNode :SKNode {
|
|||||||
sliderLine.fillColor = SKColor.white
|
sliderLine.fillColor = SKColor.white
|
||||||
sliderLine.zPosition = 4
|
sliderLine.zPosition = 4
|
||||||
|
|
||||||
|
hiddenKnob = SliderKnob(circleOfRadius: 58 )
|
||||||
hiddenKnob = SliderKnob(circleOfRadius: 60)
|
|
||||||
hiddenKnob.min = position.x - width / 2
|
hiddenKnob.min = position.x - width / 2
|
||||||
hiddenKnob.max = position.x + width / 2
|
hiddenKnob.max = position.x + width / 2
|
||||||
hiddenKnob.fillColor = SKColor.red
|
hiddenKnob.fillColor = SKColor.red
|
||||||
@ -52,7 +51,6 @@ class SliderNode :SKNode {
|
|||||||
fatalError("init(coder:) has not been implemented")
|
fatalError("init(coder:) has not been implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class SliderKnob: SKShapeNode {
|
class SliderKnob: SKShapeNode {
|
||||||
|
@ -53,11 +53,11 @@ class Modal: GKEntity{
|
|||||||
switch modaltype {
|
switch modaltype {
|
||||||
case .BaseAttack:
|
case .BaseAttack:
|
||||||
header = SKLabelNode(text: "Angriff")
|
header = SKLabelNode(text: "Angriff")
|
||||||
body = SKLabelNode(text: "Schicke \(unitCount / 2)\nEinheiten")
|
body = SKLabelNode(text: "\(unitCount / 2) Einheiten")
|
||||||
footer = SKLabelNode()
|
footer = SKLabelNode()
|
||||||
case .BaseMoveOwnUnits:
|
case .BaseMoveOwnUnits:
|
||||||
header = SKLabelNode(text: "Formation")
|
header = SKLabelNode(text: "Formation")
|
||||||
body = SKLabelNode(text: "Sende \(unitCount / 2)\nEinheiten")
|
body = SKLabelNode(text: "\(unitCount / 2) Einheiten")
|
||||||
footer = SKLabelNode()
|
footer = SKLabelNode()
|
||||||
case .PauseGame:
|
case .PauseGame:
|
||||||
header = SKLabelNode(text: "Pause")
|
header = SKLabelNode(text: "Pause")
|
||||||
@ -71,7 +71,7 @@ class Modal: GKEntity{
|
|||||||
self.header.fontSize = 40
|
self.header.fontSize = 40
|
||||||
self.header.zPosition = 5
|
self.header.zPosition = 5
|
||||||
|
|
||||||
self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y - 20)
|
self.body.position = CGPoint(x: anchorPoint.x, y: anchorPoint.y + 15)
|
||||||
self.body.numberOfLines = 2
|
self.body.numberOfLines = 2
|
||||||
self.body.preferredMaxLayoutWidth = 390
|
self.body.preferredMaxLayoutWidth = 390
|
||||||
self.body.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.center
|
self.body.horizontalAlignmentMode = SKLabelHorizontalAlignmentMode.center
|
||||||
@ -86,17 +86,14 @@ class Modal: GKEntity{
|
|||||||
|
|
||||||
super.init()
|
super.init()
|
||||||
|
|
||||||
switch modaltype{
|
|
||||||
case .BaseAttack, .BaseMoveOwnUnits:
|
let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden"
|
||||||
let text = (modaltype == .BaseAttack) ? "Angriff" : "Senden"
|
addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 15)))
|
||||||
addComponent(SliderComponent(width: 300, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 50)))
|
addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 95), isEnabled: true, onButtonPress: {
|
||||||
addComponent(ButtonComponent(textureName: "yellow_button04", text: text, position: CGPoint(x: anchorPoint.x , y: anchorPoint.y - 105), isEnabled: true, onButtonPress: {
|
self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation!, gameScene: gameScene, collisionBase: collisionBase)
|
||||||
self.sendUnits(currentDraggedBase: currentDraggedBase, touchLocation: touchLocation!, gameScene: gameScene, collisionBase: collisionBase)
|
EntityManager.gameEMInstance.removeModal()
|
||||||
EntityManager.gameEMInstance.removeModal()
|
}))
|
||||||
}))
|
|
||||||
default:
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
required init?(coder: NSCoder) {
|
required init?(coder: NSCoder) {
|
||||||
|
@ -120,7 +120,7 @@ class GameScene: SKScene{
|
|||||||
} else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount {
|
} else if Int(GameScene.sendUnits) == currentDraggedBase?.unitCount {
|
||||||
GameScene.sendUnits -= 1
|
GameScene.sendUnits -= 1
|
||||||
}
|
}
|
||||||
modal.body.text = "Schicke \(GameScene.sendUnits) Einheiten "
|
modal.body.text = "\(GameScene.sendUnits) Einheiten "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user