Exemplo n.º 1
0
 private void GameView_VisibleChanged(object sender, EventArgs e)
 {
     if (this.Visible == true)
     {
         ChangeTimer.Start();
         fpsTimer.Start();
         CreditFlashTimer.Start();
         lblHighScore.Text = scoreUtil.getTopScore().ToString();
         this.Focus();
     }
     else
     {
         ChangeTimer.Stop();
         fpsTimer.Stop();
         CreditFlashTimer.Stop();
     }
 }
Exemplo n.º 2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            Image busstop   = Properties.Resources.p_BusStop /*@"p_BusStop.png"*/;
            Image passenger = Properties.Resources.p_Passenger /*(@"p_Passenger.png")*/;
            Image bus       = Properties.Resources.p_Bus /*(@"p_Bus.png")*/;

            town          = new Town(Width, Height);
            draw          = new DrawField(town);
            town.BusStops = new List <BusStop>();
            town.BusStops.Add(new BusStop(busstop.Width, busstop.Height, Width, Height));
            town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height));
            town.BusStops.Add(new BusStop(Width / 2 - busstop.Width + busstop.Width / 3, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height));
            town.RandomBusesAndPassengers();

            draw = new DrawField(town, busstop, bus, passenger);
            DrawTimer.Start();
            ChangeTimer.Start();
        }
Exemplo n.º 3
0
 public void ShowStartScreen()
 {
     SpaceInvadersLabel.Visible = true;
     InsertCoinLabel.Visible    = true;
     StartScreenActive          = true;
     lblScore.Visible           = false;
     lblScoreTitle.Visible      = true;
     lblLevel.Visible           = false;
     lblLevelNumber.Visible     = false;
     lblLifes.Visible           = false;
     lblLifesLabel.Visible      = false;
     lblScoreScroll.Visible     = true;
     if (credit.Credits > 0)
     {
         lblHitSpace.Visible = true;
     }
     CreditFlashTimer.Enabled = true;
     ChangeTimer.Start();
 }
Exemplo n.º 4
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            Image busstop   = Properties.Resources.p_Conveer; /*@"p_BusStop.png"*/;
            Image passenger = Properties.Resources.p_Mechanic /*(@"p_Passenger.png")*/;
            Image bus       = Properties.Resources.p_Pogruz /*(@"p_Bus.png")*/;
            Image revolt    = Properties.Resources.mark;

            town          = new Town(Width, Height);
            draw          = new DrawField(town);
            town.BusStops = new List <Conveer>();
            town.BusStops.Add(new Conveer(busstop.Width, busstop.Height, Width, Height));
            town.BusStops.Add(new Conveer(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height));
            town.BusStops.Add(new Conveer(busstop.Width, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height));
            town.BusStops.Add(new Conveer(Width - busstop.Width * 2 - busstop.Width / 2, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height));
            town.RandomBusesAndPassengers();

            draw = new DrawField(town, busstop, bus, passenger, revolt);
            DrawTimer.Start();
            ChangeTimer.Start();
        }
Exemplo n.º 5
0
 /**
  * Removes start screen elements
  */
 public void EraseStartScreen()
 {
     if (this.Visible == false)
     {
         logic.SwitchForms();
     }
     SpaceInvadersLabel.Visible = false;
     InsertCoinLabel.Visible    = false;
     StartScreenActive          = false;
     lblScore.Visible           = true;
     lblScoreTitle.Visible      = true;
     lblLevel.Visible           = true;
     lblLevelNumber.Visible     = true;
     lblLifes.Visible           = true;
     lblLifesLabel.Visible      = true;
     lblScoreScroll.Visible     = false;
     lblHitSpace.Visible        = false;
     CreditFlashTimer.Enabled   = false;
     ChangeTimer.Stop();
 }
Exemplo n.º 6
0
 private void ReloadModelBttn_Click(object sender, EventArgs e)
 {
     DrawTimer.Dispose();
     ChangeTimer.Dispose();
     town.Dispose();
     Image busstop = Properties.Resources.p_BusStop /*@"p_BusStop.png"*/;
     Image passenger = Properties.Resources.p_Passenger/*(@"p_Passenger.png")*/;
     Image bus = Properties.Resources.p_Bus/*(@"p_Bus.png")*/;
     Image revolt = Properties.Resources.mark;
     town = new Town(Width, Height);
     draw = new DrawField(town);
     town.BusStops = new List<BusStop>();
     town.BusStops.Add(new BusStop(busstop.Width, busstop.Height, Width, Height));
     town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, busstop.Height, Width, Height));
     town.BusStops.Add(new BusStop(busstop.Width, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height));
     town.BusStops.Add(new BusStop(Width - busstop.Width * 2 - busstop.Width / 2, Height - busstop.Height - 50 - busstop.Height / 2, Width, Height));
     town.RandomBusesAndPassengers();
     draw = new DrawField(town, busstop, bus, passenger, revolt);
     DrawTimer.Start();
     ChangeTimer.Start();
 }
Exemplo n.º 7
0
        void OnStartChange()
        {
            if (ChangeActive)
            {
                ChangeTimer.Stop();
                ChangeActive = false;
                RaisePropertyChanged(nameof(ChangeButtonText));
                return;
            }

            ChangeActive         = true;
            ChangeTimer.Interval = TimeSpan.FromMilliseconds(RefreshInterval);
            RaisePropertyChanged(nameof(ChangeButtonText));

            ChangeTimer.Tick += (s, e) =>
            {
                foreach (var person in People)
                {
                    person.Worth = RandomCash();
                }
                RaisePropertyChanged(nameof(People));
            };
            ChangeTimer.Start();
        }
Exemplo n.º 8
0
 // Use this for initialization
 void Start()
 {
     turn  = 1;
     timer = GameObject.FindObjectOfType <ChangeTimer>();
 }