Exemplo n.º 1
0
        void DrawMainMenu()
        {
            DrawUtil.FillTexture(_displayTexture, new Color(0, 0, 0));
            DrawUtil.DrawSpriteAlpha(menuTexture, _displayTexture, 0, 0, 64, 64, 0, 0);

            int soundOff = 0;

            if (SoundMgr.Singleton.IsOn)
            {
                soundOff = 2;
            }
            else
            {
                soundOff = 1;
            }
            DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 7 * soundOff, 30, 7, 34, 14);

            int dispOff = 0;

            switch (DiffMgr.Singleton.Difficulty)
            {
            case Difficulty.Easy:
                dispOff = 3;
                break;

            case Difficulty.Normal:
                dispOff = 2;
                break;

            case Difficulty.Hard:
                dispOff = 1;
                break;

            case Difficulty.Extreme:
                dispOff = 0;
                break;
            }
            DrawUtil.DrawSpriteAlpha(diffTexture, _displayTexture, 0, 7 * dispOff, 25, 7, 28, 21);

            DrawMenuCursor();
            _displayTexture.Apply();
        }
Exemplo n.º 2
0
        public void Draw(Texture2D destTexture)
        {
            var tx = 0;
            var ty = 0;

            foreach (DotRecord dr in _dots)
            {
                if (dr.isEnergizer)
                {
                    tx = 40;
                    ty = 16;
                }
                else
                {
                    tx = 56;
                    ty = 16;
                }
                DrawUtil.DrawSpriteAlpha(_spritesheet, destTexture, tx, ty, 8, 8, dr.x, dr.y);
            }
        }
Exemplo n.º 3
0
        private void DrawMenuCursor()
        {
            var  cursorY = 0;
            bool fancy   = false;

            switch (_menuCursorRow)
            {
            case 0: // play
                cursorY = 34;
                fancy   = true;
                break;

            case 1: // diff
                cursorY = 21;
                break;

            case 2: // sound
                cursorY = 14;
                break;

            case 3: // about
                cursorY = 4;
                break;
            }

            if (!fancy)
            {
                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 0, 7, 7, 0, cursorY);
            }
            else
            {
                var _menuCursorLoopLength = 0.85f;
                var wrap  = _menuCursorElapsed / _menuCursorLoopLength;
                var m01   = wrap - Mathf.FloorToInt(wrap);
                var width = 12;
                var steps = Mathf.FloorToInt(width * m01);

                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 0, 0, 7, 7, 20 - width + steps, cursorY);
                DrawUtil.DrawSpriteAlpha(widgetsTexture, _displayTexture, 7, 0, 7, 7, 39 + width - steps, cursorY);
            }
        }
Exemplo n.º 4
0
 void DrawTitle()
 {
     DrawUtil.FillTexture(_displayTexture, new Color(0, 0, 0));
     DrawUtil.DrawSpriteOpaque(titleTexture, _displayTexture, 0, 0, 64, 64, 4, 24);
     _displayTexture.Apply();
 }
Exemplo n.º 5
0
 void DrawWizard()
 {
     DrawUtil.DrawSpriteOpaque(wizardTexture, _displayTexture, 0, 0, 64, 64, 0, 0);
     _displayTexture.Apply();
 }
Exemplo n.º 6
0
        void DrawBigMaze()
        {
            DrawUtil.FillTexture(_displayTexture, new Color(0.25f, 0.25f, 0.75f));

            Color wallColor = new Color(0.5f, 0.5f, 1.0f);
            Color openColor = new Color(0, 0, 0);

            var window = 13;

            for (int dx = -window; dx <= window; ++dx)
            {
                int mx = bigMapX + dx;
                for (int dy = -window; dy <= window; ++dy)
                {
                    int my = bigMapY + dy;

                    var px = 32 + 2 * dx;
                    var py = 32 - 2 * dy;

                    DrawUtil.SetPixel(_displayTexture, px, py, openColor);

                    if (BigMapManager.BigMapMgrSingleton.GetHasCleared(mx, my))
                    {
                        DrawUtil.SetPixel(_displayTexture, px, py, new Color(0, 1, 0));
                    }

                    if ((dx == 0) && (dy == 0))
                    {
                        DrawUtil.SetPixel(_displayTexture, px, py, new Color(1, 1, 0));
                    }

                    DrawUtil.SetPixel(_displayTexture, px - 1, py - 1, wallColor);
                    DrawUtil.SetPixel(_displayTexture, px - 1, py + 1, wallColor);
                    DrawUtil.SetPixel(_displayTexture, px + 1, py - 1, wallColor);
                    DrawUtil.SetPixel(_displayTexture, px + 1, py + 1, wallColor);

                    Color passageColor;
                    Color dbgColor;

                    if (BigMapManager.BigMapMgrSingleton.CanMove(mx, my, MovementDirection.NORTH, out dbgColor))
                    {
                        passageColor = openColor;
                    }
                    else
                    {
                        passageColor = wallColor;
                    }
                    DrawUtil.SetPixel(_displayTexture, px, py + 1, passageColor);

                    if (BigMapManager.BigMapMgrSingleton.CanMove(mx, my, MovementDirection.EAST, out dbgColor))
                    {
                        passageColor = openColor;
                    }
                    else
                    {
                        passageColor = wallColor;
                    }
                    DrawUtil.SetPixel(_displayTexture, px + 1, py, passageColor);

                    if (BigMapManager.BigMapMgrSingleton.CanMove(mx, my, MovementDirection.SOUTH, out dbgColor))
                    {
                        passageColor = openColor;
                    }
                    else
                    {
                        passageColor = wallColor;
                    }
                    DrawUtil.SetPixel(_displayTexture, px, py - 1, passageColor);

                    if (BigMapManager.BigMapMgrSingleton.CanMove(mx, my, MovementDirection.WEST, out dbgColor))
                    {
                        passageColor = openColor;
                    }
                    else
                    {
                        passageColor = wallColor;
                    }
                    DrawUtil.SetPixel(_displayTexture, px - 1, py, passageColor);
                }
            }
        }
Exemplo n.º 7
0
 private void DrawGameOver()
 {
     DrawSmallMaze();
     DrawUtil.DrawSpriteAlpha(gameOverTexture, _displayTexture, 0, 0, 25, 15, 20, 25);
     _displayTexture.Apply();
 }
Exemplo n.º 8
0
 void DrawSpriteAlpha(int spriteX, int spriteY, int spriteWidth, int spriteHeight,
                      int destX, int destY)
 {
     DrawUtil.DrawSpriteAlpha(spriteSheet, _displayTexture,
                              spriteX, spriteY, spriteWidth, spriteHeight, destX, destY);
 }