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 unitCount: Int
var hasAttackBoost = false var hasAttackBoost = false
var hasDefenseBoost = false var hasDefenseBoost = false
var hasSpyBoost = false
var adjacencyList: Array<Base> var adjacencyList: Array<Base>
var changeOwnership: Bool var changeOwnership: Bool
var ownershipPlayer: GKPlayer? var ownershipPlayer: GKPlayer?

View File

@ -56,7 +56,7 @@ class HUD: GKEntity {
isEnabled: true, isEnabled: true,
position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.75, y: EntityManager.gameEMInstance.scene.size.height * 0.1), position: CGPoint(x: EntityManager.gameEMInstance.scene.size.width * 0.75, y: EntityManager.gameEMInstance.scene.size.height * 0.1),
onButtonPress: { 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.first.time", increasePercentComplete: 100)
GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.spy.ten", increasePercentComplete: 10) GameCenterManager.sharedInstance.addAchievementProgress(identifier: "de.hft.stuttgart.ip2.goldwars.skill.spy.ten", increasePercentComplete: 10)
} }