Exemple #1
0
        public void updateGame(int ellapsedTIme)
        {
            if (GameState.Running.Equals(State))
            {

                if (mission.Finished)
                {
                    Score = Score + mission.GetFinishedScore();
                    mission = nextMission();
                }

                if (mission.Failed || car.Destroyed)
                {
                    State = GameState.Failed;
                }

                Rectangle bounds = new Rectangle(0, 0, gameSize.Width, gameSize.Height);
                car.Move(bounds);
                mission.Update(ellapsedTIme);

            }
        }
Exemple #2
0
 public void Initialize(Form parent,Size dim)
 {
     if (!initialized)
     {
         Score = 0;
         initialized = true;
         size = new Size(dim.Width, dim.Height);
         loadMap();
         mission=nextMission();
     }
 }