예제 #1
0
 public static TargetsManager CreateTargets()
 {
     if (_target == null)
     {
         _target = new TargetsManager( );
     }
     return(_target);
 }
        private void PerformCollisionAction()
        {
            var           targets = TargetsManager.CreateTargets();
            PlayerManager player  = PlayerManager.CreatePlayerManager();
            int           row     = CollisionManager.GetCollisionManager().RowNumber;
            int           column  = CollisionManager.GetCollisionManager().ColumnNumber;

            Destroy(row, column, targets, player);
        }
예제 #3
0
 public void RenderWholeWorld()
 {
     try {
         Device.Clear(ClearFlags.Target, DeviceColor, 0, 1);
         Device.BeginScene();
         TargetsManager.CreateTargets().RenderTarget();
         StickManager.GetStick().RenderStick();
         PlayerManager.CreatePlayerManager().PlayerRender(Device);
         ScoreManager.GetScoreManager().RenderScore(Device);
         HangingMoodie.CreatehHangingMoodie().Render();
         Device.EndScene();
         Device.Present();
     }catch (Exception) { };
 }
        void Destroy(int row, int column, TargetsManager targets, PlayerManager player)
        {
            if (row >= 0 && column >= 0 && column < targets.MoodieList[0].Count &&
                targets.MoodieList[row][column].getShowFlag() == true &&
                targets.MoodieList[row][column].GetType() == player.GetType())
            {
                targets.MoodieList[row][column].DisableShowFlag();
                ScoreManager.GetScoreManager().Update();
                Destroy(row, column - 1, targets, player);
                Destroy(row, column + 1, targets, player);
                Destroy(row - 1, column, targets, player);

                if (row != targets.MoodieList.Count - 1)
                {
                    Destroy(row + 1, column, targets, player);
                }
            }
        }
예제 #5
0
        public void PlayerUpdate()
        {
            var          targets = TargetsManager.CreateTargets().MoodieList;
            StickManager stick   = StickManager.GetStick();
            double       yAngle  = Math.Sin(stick.rotationAngle - Math.PI / 2);
            double       xAngle  = Math.Cos(stick.rotationAngle - Math.PI / 2);

            if (!isWall() && !_wall)
            {
                SetPlayerX((int)((GetPlayerX()) + (25 * xAngle)));
                SetPlayerY((int)((GetPlayerY()) + (25 * yAngle)));
            }
            else
            {
                SetPlayerX((int)((GetPlayerX()) - (25 * xAngle)));
                SetPlayerY((int)((GetPlayerY()) + (25 * yAngle)));
            }
            if (targets[targets.Count - 1][0].GetYCoordinate() >= GetPlayerY() - 36)
            {
                CollisionManager.GetCollisionManager().HandleCollision();
            }
        }
예제 #6
0
 private CollisionManager()
 {
     player  = PlayerManager.CreatePlayerManager();
     targets = TargetsManager.CreateTargets();
 }