Add function to button

This commit is contained in:
Daniel Steckert 2020-05-31 21:36:55 +02:00 committed by Aldin Duraki
parent c68ed6ea97
commit c0153d43d4
2 changed files with 3 additions and 2 deletions

View File

@ -15,6 +15,7 @@ class Base: GKEntity{
var unitCount: Int
var hasAttackBoost = false
var hasDefenseBoost = false
var hasSpyBoost = false
var adjacencyList: Array<Base>
var changeOwnership: Bool
var ownershipPlayer: GKPlayer?

View File

@ -56,10 +56,10 @@ class HUD: GKEntity {
isEnabled: true,
position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.75, y: EntityManager.gameEMInstance.scene.size.height * 0.1),
onButtonPress: {
print("Not implemented")
EntityManager.gameEMInstance.getBasesByTeam(for: .team2).forEach({base in base.hasSpyBoost = true})
GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.first.time", increasePercentComplete: 100)
GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.spy.ten", increasePercentComplete: 10)
}
}
)
defSkill = SingeClickButtonNode(
textureName: "yellow_circle",