adding colours of maple for P2

dev_views_Game
reregnault 1 year ago
parent 1eba7c0638
commit df25251a09

@ -13,4 +13,5 @@ public struct Colors {
static let Button = Color("ButtonColor") static let Button = Color("ButtonColor")
static let MeepleP1 = UIColor(named: "MeepleP1") static let MeepleP1 = UIColor(named: "MeepleP1")
static let TextButton = Color("ButtonTextColor") static let TextButton = Color("ButtonTextColor")
static let MeepleP2 = UIColor(named: "MeepleP2")
} }

@ -23,9 +23,9 @@
"color-space" : "srgb", "color-space" : "srgb",
"components" : { "components" : {
"alpha" : "1.000", "alpha" : "1.000",
"blue" : "1.000", "blue" : "0.765",
"green" : "1.000", "green" : "0.855",
"red" : "1.000" "red" : "0.000"
} }
}, },
"idiom" : "universal" "idiom" : "universal"

@ -0,0 +1,38 @@
{
"colors" : [
{
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.150",
"red" : "0.150"
}
},
"idiom" : "universal"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"color" : {
"color-space" : "srgb",
"components" : {
"alpha" : "1.000",
"blue" : "1.000",
"green" : "0.150",
"red" : "0.150"
}
},
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

@ -22,7 +22,7 @@ struct TopGameBoard: View {
.foregroundColor(.white) .foregroundColor(.white)
} }
.padding() .padding()
.background(Color.red) .background(Color(gameVM.currentPlayerColor))
.cornerRadius(10) .cornerRadius(10)
Spacer().frame(height: 20) Spacer().frame(height: 20)

@ -29,14 +29,14 @@ class GameScene : SKScene {
.elephant: SpriteMeeple(imageNamed: AppImages.Elephant, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP1!, imageRotation: 180), .elephant: SpriteMeeple(imageNamed: AppImages.Elephant, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP1!, imageRotation: 180),
], ],
.player2: [ .player2: [
.rat: SpriteMeeple(imageNamed: AppImages.Rat, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .rat: SpriteMeeple(imageNamed: AppImages.Rat, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.cat: SpriteMeeple(imageNamed: AppImages.Cat, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .cat: SpriteMeeple(imageNamed: AppImages.Cat, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.dog: SpriteMeeple(imageNamed: AppImages.Dog, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .dog: SpriteMeeple(imageNamed: AppImages.Dog, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.wolf: SpriteMeeple(imageNamed: AppImages.Wolf, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .wolf: SpriteMeeple(imageNamed: AppImages.Wolf, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.leopard: SpriteMeeple(imageNamed: AppImages.Leopard, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .leopard: SpriteMeeple(imageNamed: AppImages.Leopard, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.lion: SpriteMeeple(imageNamed: AppImages.Lion, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .lion: SpriteMeeple(imageNamed: AppImages.Lion, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.tiger: SpriteMeeple(imageNamed: AppImages.Tigger, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .tiger: SpriteMeeple(imageNamed: AppImages.Tigger, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
.elephant: SpriteMeeple(imageNamed: AppImages.Elephant, size: CGSize(width: 100, height: 100), backgroundColor: .blue), .elephant: SpriteMeeple(imageNamed: AppImages.Elephant, size: CGSize(width: 100, height: 100), backgroundColor: Colors.MeepleP2!),
], ],
] ]

@ -6,6 +6,7 @@
// //
import Foundation import Foundation
import SwiftUI
import DouShouQiModel import DouShouQiModel
class PlayingGameVM: ObservableObject { class PlayingGameVM: ObservableObject {
@ -33,6 +34,10 @@ class PlayingGameVM: ObservableObject {
} }
} }
public var currentPlayerColor: UIColor {
return game.rules.getNextPlayer() == .player1 ? Colors.MeepleP1! : Colors.MeepleP2!
}
// Inits // Inits
init(withGame game: Game) { init(withGame game: Game) {
self.game = game self.game = game

Loading…
Cancel
Save