Esempio n. 1
0
        public Game()
        {
            doRestartGame();
            countdownNumbers = new FixedSprite[]
            {
                new FixedSprite(Properties.Resources.picturetopeople_org_0cf714287edb63347deadeb1e3837903751eee8a5dc2a163c2.ToFrame(), new[] { 0d, 0d }, new[] { 0d, 0d }),
                new FixedSprite(Properties.Resources.picturetopeople_org_bccd4c9d1aa31d837572a2198667964f12e060ba01f8b92bd5.ToFrame(), new[] { 0d, 0d }, new[] { 0d, 0d }),
                new FixedSprite(Properties.Resources.picturetopeople_org_87b38ae0fb2ab421460c1fdbebb1fdfe4405f36ebf905e8f55.ToFrame(), new[] { 0d, 0d }, new[] { 0d, 0d }),
                new FixedSprite(Properties.Resources.picturetopeople_org_16c24f4d0d65ad5a3ce6a81c2c7d3cf64478694fe4516c6271.ToFrame(), new[] { 0d, 0d }, new[] { 0d, 0d })
            };

            foreach (FixedSprite s in countdownNumbers)
            {
                s.centreOnCanvas(width, height);
            }

            playerSelectionVM = new PlayerSelectionVM(puterScripts.Count(), Properties.Resources.black_vehicles);

            players = new ObservableCollection <TPlayer>();
            players.CollectionChanged += (s, e) =>
            {
                RaisePropertyChanged("players");
                RaisePropertyChanged("humanPlayers");
                RaisePropertyChanged("puterPlayers");
            };
        }
Esempio n. 2
0
        public override RacePlayer createPlayerFromSelection(PlayerSelectionVM playerSelectionVM)
        {
            bool   isPuter = playerSelectionVM.selectedPuterLevelZeroIsHuman > 0;
            string script  = isPuter ? puterScripts[playerSelectionVM.selectedPuterLevelZeroIsHuman - 1] : string.Empty;

            if (!isPuter && !keyActions.Any())
            {
                return(null);
            }

            Key[] keys = isPuter ? null : keyActions.Pop();

            RacePlayer newPlayer = new RacePlayer(playerSelectionVM.selectedColor.todrawingcolor(),
                                                  playerSelectionVM.rotatingSprite.bitmapList.ToList(),
                                                  playerStartingPoint(players.Count), 5,
                                                  script, keys, isPuter);

            return(newPlayer);
        }
Esempio n. 3
0
 /// <summary>
 /// returns null if no keys are available
 /// </summary>
 /// <param name="playerSelectionVM"></param>
 /// <returns></returns>
 public abstract TPlayer createPlayerFromSelection(PlayerSelectionVM playerSelectionVM);