Esempio n. 1
0
 public Input(FigureBehavior _fb)
 {
     Behavior   = _fb;
     Movement   = Behavior.Movement;
     StopMovent = Behavior.StopMovement;
     Attack     = Behavior.Attack;
     StopAttack = Behavior.StopAttack;
     StopSkill  = Behavior.StopSkill;
     Skill      = Behavior.UseSkill;
 }
Esempio n. 2
0
 void OnFigureCollision(Figure a, Figure b)
 {
     if (figures.Contains(a) && figures.Contains(b))
     {
         figures.Remove(a);
         figures.Remove(b);
         FigureBehavior behavior = a.behavior;
         if (b.angleCount > a.angleCount)
         {
             behavior = b.behavior;
         }
         builder.CreateFigure(builders[behavior], a.angleCount + b.angleCount, (a.transform.position + b.transform.position) / 2);
     }
 }
Esempio n. 3
0
        public void GameLogic()
        {
            // _countFrameSkip = 1;

            /*if (_gameContainer.RenderedFrame == null)
             * {
             *  _gameContainer.SetRenderFrame();
             * }*/
            Frame lastFrame = _gameContainer.RenderedFrame;

            if (_currentFigure == null)
            {
                _currentFigure = _figureQueue.Dequeue();
                SubscribeFigureBehavior();
                RefillQueue();
            }
            else
            {
                DeleteLastFigure();
            }

            bool isBottomReached = false;

            if (_countFrameSkip >= _currentFrameSkip)
            {
                isBottomReached = FigureBehavior.MoveDown(_currentFigure, _gameContainer);
                _countFrameSkip = 1;
            }
            else
            {
                _countFrameSkip++;
            }

            lastFrame.CombineWith(_currentFigure.Position.X, _currentFigure.Position.Y, _currentFigure.Pixels);

            _gameContainer.SetRenderFrame(lastFrame);
            _gameContainer.RenderFrame();

            if (isBottomReached)
            {
                UnSubscribeFigureBehavior();
                _currentFigure = null;
            }
        }
Esempio n. 4
0
 private void OnRightArrowClick(object sender, EventArgs e)
 {
     FigureBehavior.MoveRight(_currentFigure, _gameContainer);
 }
Esempio n. 5
0
 public OthersInput(FigureBehavior _fb) : base(_fb)
 {
 }
Esempio n. 6
0
 public AIInput(FigureBehavior _fb) : base(_fb)
 {
 }
Esempio n. 7
0
 public PlayerInput(FigureBehavior _fb) : base(_fb)
 {
 }