Пример #1
0
 public void Restart()
 {
     state = GameState.Waiting;
     SetScore(0);
     stick = new Stick();
     stick.SetAngle(-90);
     CreateNewPlatform();
     hero.Position.X     = heroPlatform.Position.X + heroPlatform.Width - Hero.Width - Stick.Width - GameForm.OffsetBeforeStick;
     hero.Position.Y     = GameForm.ClientHeight - heroPlatform.Height - Hero.Height;
     stick.StartingPoint = new Point(hero.Position.X + Hero.Width + GameForm.OffsetBeforeStick, hero.Position.Y + Hero.Height);
     stick.EndingPoint   = new Point(hero.Position.X + Hero.Width + GameForm.OffsetBeforeStick, hero.Position.Y + Hero.Height);
 }
Пример #2
0
        public void Start()
        {
            Random random = new Random();

            heroPlatform    = new Platform(100, PlayingHeight, 0, GameForm.ClientHeight - PlayingHeight);
            anotherPlatform = new Platform(randomWidth, heroPlatform.Height,
                                           random.Next(heroPlatform.Position.X + heroPlatform.Width + 10,
                                                       GameForm.ClientWidth - randomWidth),
                                           GameForm.ClientHeight - heroPlatform.Height);
            doubleScorePlatform = new Platform(DoubleScorePlatformWidth, DoubleScorePlatformHeight,
                                               anotherPlatform.Position.X + anotherPlatform.Width / 2 - DoubleScorePlatformWidth / 2, anotherPlatform.Position.Y);
            stick = new Stick();
            hero  = new Hero();
        }