public Game(Vector2D spawnPos1, Vector2D spawnPos2) { var damageDice = new Texture("Resource/DamageDice.png"); var spawnData = new[] { new Rectangle(spawnPos1, 32, 32), new Rectangle(spawnPos2, 32, 32) }; var colors = new[] { Palette.White, Palette.Green }; for (int i = 0; i < 2; i++) { var diceList = Texture.LoadDivision($"Resource/DiceList{i + 1}.png", 5, 1).ToList(); diceList.Add(damageDice); players[i] = new DicePlayer(spawnData[i], diceList, colors[i]); } item = new BulletItem(gameField); Data.MainMusic.Play(PlayType.Loop); }
public void testInit() { _rollResultChances = new Dictionary <int, double>(); _invalidResultChances = new Dictionary <int, double>(); //Initialize the rollChances _rollResultChances.Add(1, 0.0); _rollResultChances.Add(2, 0.2); _rollResultChances.Add(3, 0.3); _rollResultChances.Add(4, 0.5); _rollResultChances.Add(5, 0.0); _rollResultChances.Add(6, 0.2); _invalidResultChances.Add(7, 0.5); _invalidResultChances.Add(8, 0.2); _invalidResultChances.Add(9, 0.3); _cardPlayer = new CardPlayer("test first name", "test last name"); _dicePlayerWithFixedChances = new DicePlayer("test first name", "test last name", 4, 6); _dicePlayerWithRollChances = new DicePlayer("Nick", "Taramas", _rollResultChances); _dicePlayerWithInvalidRollChances = new DicePlayer("Nick", "Taramas", _invalidResultChances); _cardDicePlayer = new CardDicePlayer("test first name", "test last name", _rollResultChances); _deckersMeeting = new DeckersMeeting(); }
public int Roll(DicePlayer player) { return(player.Roll()); }