Example #1
0
        public void Draw(GraphicsDevice graphics)
        {
            game.Draw(graphics);

            if (numTicks < 16)
            {
                graphics.FillScreen(0, 0, 0, 255 - numTicks * 16);
            }

            if (numTicks == 165)
            {
                graphics.FillScreen(255, 255, 255, 255);
            }

            if (numTicks > 180)
            {
                for (int i = 0; i < 3; i++)
                {
                    graphics.DrawImageAdd(GameImage.Message, 256, 32, i, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 + 112 + 32 * i, (i <= 1 || !arcadeMode) ? 255 : 32);
                }
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, (Settings.SCREEN_WIDTH - 256) / 2 - 32 + 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, (Settings.SCREEN_WIDTH - 256) / 2 + 256 - 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }

            if (exitCount > 0)
            {
                if (exitCount < 16)
                {
                    graphics.FillScreen(0, 0, 0, 16 * exitCount);
                }
                else
                {
                    graphics.FillScreen(0, 0, 0, 255);
                }
            }
        }
Example #2
0
 public override void DrawSomething(GraphicsDevice graphics)
 {
     if (showTitle)
     {
         graphics.DrawImage(GameImage.Title, 512, 256, (Settings.SCREEN_WIDTH - 512) / 2 - IntCameraX + 16, (Settings.SCREEN_HEIGHT - 256) / 2 - IntCameraY + 16);
     }
 }
Example #3
0
 public override void DrawSomething(GraphicsDevice graphics)
 {
     if (showTitle)
     {
         graphics.DrawImage(GameImage.Title, 512, 256, (Settings.SCREEN_WIDTH - 512) / 2 - IntCameraX + 16, (Settings.SCREEN_HEIGHT - 256) / 2 - IntCameraY + 16);
     }
 }
Example #4
0
        public override void Draw(GraphicsDevice graphics)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY;

            graphics.DrawImage(GameImage.Item, 32, 32, 4, animation / 2, drawX, drawY);
        }
Example #5
0
        public void Draw(GraphicsDevice graphics, int r, int g, int b)
        {
            int topRow    = game.IntCameraY / Settings.BLOCK_WDITH;
            int bottomRow = (game.IntCameraY + Settings.SCREEN_HEIGHT) / Settings.BLOCK_WDITH;
            int leftCol   = game.IntCameraX / Settings.BLOCK_WDITH;
            int rightCol  = (game.IntCameraX + Settings.SCREEN_WIDTH) / Settings.BLOCK_WDITH;

            for (int row = topRow; row <= bottomRow; row++)
            {
                for (int col = leftCol; col <= rightCol; col++)
                {
                    int block = this[row, col];
                    if (block > 0)
                    {
                        int drawX      = col * Settings.BLOCK_WDITH - game.IntCameraX;
                        int drawY      = row * Settings.BLOCK_WDITH - game.IntCameraY;
                        int textureRow = block / 8;
                        int textureCol = block % 8;
                        if (block != 16)
                        {
                            graphics.DrawImage(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, r, g, b);
                        }
                        else
                        {
                            graphics.DrawImageAlpha(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, 128, r, g, b);
                        }
                    }
                }
            }
        }
Example #6
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background4, 1024, 512, IntBackgroundX, IntBackgroundY, 64, 64, 64);
     for (int i = 0; i < 512; i++)
     {
         int y = (int)Math.Round(16 * Math.Sin(2 * Math.PI * (i + 0.5 * Ticks) / 128));
         int color = i + 2 * Ticks;
         graphics.DrawImageAdd(GameImage.Aurora, 2, 256, 0, i, IntBackgroundX + 2 * i, y, 128, GetAuroraColorR(color), GetAuroraColorG(color), GetAuroraColorB(color));
     }
 }
Example #7
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background4, 1024, 512, IntBackgroundX, IntBackgroundY, 64, 64, 64);
     for (int i = 0; i < 512; i++)
     {
         int y     = (int)Math.Round(16 * Math.Sin(2 * Math.PI * (i + 0.5 * Ticks) / 128));
         int color = i + 2 * Ticks;
         graphics.DrawImageAdd(GameImage.Aurora, 2, 256, 0, i, IntBackgroundX + 2 * i, y, 128, GetAuroraColorR(color), GetAuroraColorG(color), GetAuroraColorB(color));
     }
 }
Example #8
0
 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX - 8;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY - 8;
     if (animation < 48)
     {
         graphics.DrawImage(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 64, 64, 64);
     }
     else
     {
         graphics.DrawImageAlpha(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 255 - 16 * (animation - 48), 64, 64, 64);
     }
 }
Example #9
0
 public void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     if (visible)
     {
         if (fadeCount < 64)
         {
             graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 0, drawX, drawY, 4 * fadeCount);
             graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 1, drawX, drawY, 4 * fadeCount);
         }
         else if (slideCount < 20)
         {
             graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
             graphics.DrawImage2(GameImage.Block, 76 + slideCount, 196, 20 - slideCount, 60, drawX + 12, drawY + 4);
             graphics.DrawImage2(GameImage.Block, 96, 196, 20 - slideCount, 60, drawX + 32 + slideCount, drawY + 4);
         }
         else
         {
             graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
         }
     }
 }
Example #10
0
        public override void Draw(GraphicsDevice graphics)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX - 8;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY - 8;

            if (animation < 48)
            {
                graphics.DrawImage(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 64, 64, 64);
            }
            else
            {
                graphics.DrawImageAlpha(GameImage.Debris, 16, 16, type, animation / 2 % 8, drawX, drawY, 255 - 16 * (animation - 48), 64, 64, 64);
            }
        }
Example #11
0
        public void Draw(GraphicsDevice graphics)
        {
            graphics.FillScreen(0, 0, 0, 192);

            graphics.DrawImageAdd(GameImage.Message, 256, 32, 3, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 - 80, 255);

            if (currentStageIndex + 1 < 10)
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, currentStageIndex + 1, (Settings.SCREEN_WIDTH - 32) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }
            else
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) / 10, (Settings.SCREEN_WIDTH - 64) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) % 10, (Settings.SCREEN_WIDTH - 64) / 2 + 32, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }

            if (currentStageIndex > 0)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, Settings.SCREEN_WIDTH / 2 - 80, Settings.SCREEN_HEIGHT / 2 - 16);
            }
            if (currentStageIndex + 1 < numUnlockedStages)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH / 2 + 48, Settings.SCREEN_HEIGHT / 2 - 16);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }
        }
Example #12
0
        public void Draw(GraphicsDevice graphics)
        {
            int drawX = (int)Math.Round(position.X) - game.IntCameraX;
            int drawY = (int)Math.Round(position.Y) - game.IntCameraY;

            if (visible)
            {
                if (fadeCount < 64)
                {
                    graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 0, drawX, drawY, 4 * fadeCount);
                    graphics.DrawImageAlpha(GameImage.Block, 64, 64, 3, 1, drawX, drawY, 4 * fadeCount);
                }
                else if (slideCount < 20)
                {
                    graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
                    graphics.DrawImage2(GameImage.Block, 76 + slideCount, 196, 20 - slideCount, 60, drawX + 12, drawY + 4);
                    graphics.DrawImage2(GameImage.Block, 96, 196, 20 - slideCount, 60, drawX + 32 + slideCount, drawY + 4);
                }
                else
                {
                    graphics.DrawImage(GameImage.Block, 64, 64, 3, 0, drawX, drawY);
                }
            }
        }
Example #13
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background1, 1024, 512, IntBackgroundX, IntBackgroundY, 32 + (255 - skyColorCount) * 7 / 8, 32 + (255 - skyColorCount) * 3 / 8, 32);
 }
Example #14
0
        public override void DrawBackground(GraphicsDevice graphics)
        {
            int color = 64 + skyColorCount / 4;

            graphics.DrawImage(GameImage.Background2, 1024, 512, IntBackgroundX, IntBackgroundY, color, color, color);
        }
Example #15
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background2, 1024, 512, IntBackgroundX, IntBackgroundY);
 }
Example #16
0
        public bool DrawWhereEnemyIs(GraphicsDevice graphics)
        {
            double minRange = double.MaxValue;
            Thing  target   = null;
            ThingScreenPosition targetPos = ThingScreenPosition.InScreen;

            foreach (Thing enemy in enemies)
            {
                ThingScreenPosition sp = GetScreenPosition(enemy.Center);
                if (sp == ThingScreenPosition.InScreen)
                {
                    return(false);
                }
                if (enemy is AtField || enemy is EggMachine)
                {
                    continue;
                }
                Vector d     = enemy.Center - player.Center;
                double range = d.X * d.X + d.Y * d.Y;
                if (range < minRange)
                {
                    minRange  = range;
                    target    = enemy;
                    targetPos = sp;
                }
            }
            if (target != null)
            {
                Vector focus = target.Center - camera;
                switch (targetPos)
                {
                case ThingScreenPosition.Left:
                    if (focus.Y < 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, 0);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, 0);
                    }
                    else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, Settings.SCREEN_HEIGHT - 32);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, Settings.SCREEN_HEIGHT - 32);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, (int)Math.Round(focus.Y) - 16);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, (int)Math.Round(focus.Y) - 16);
                    }
                    return(true);

                case ThingScreenPosition.LeftUpper:
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 1, 0, 0);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, 32);
                    return(true);

                case ThingScreenPosition.Upper:
                    if (focus.X < 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, 0, 0);
                    }
                    else if (focus.X > Settings.SCREEN_WIDTH - 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, Settings.SCREEN_WIDTH - 32, 0);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, (int)Math.Round(focus.X) - 16, 0);
                    }
                    if (focus.X < 32)
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 0, 32);
                    }
                    else if (focus.X > Settings.SCREEN_WIDTH - 32)
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 64, 32);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, (int)Math.Round(focus.X) - 32, 32);
                    }
                    return(true);

                case ThingScreenPosition.RightUpper:
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 3, Settings.SCREEN_WIDTH - 32, 0);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, 32);
                    return(true);

                case ThingScreenPosition.Right:
                    if (focus.Y < 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, 0);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, 0);
                    }
                    else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 32);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, (int)Math.Round(focus.Y) - 16);
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, (int)Math.Round(focus.Y) - 16);
                    }
                    return(true);

                case ThingScreenPosition.RightLower:
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 5, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 64);
                    return(true);

                case ThingScreenPosition.Lower:
                    if (focus.X < 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, 0, Settings.SCREEN_HEIGHT - 32);
                    }
                    else if (focus.X > Settings.SCREEN_WIDTH - 16)
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, (int)Math.Round(focus.X) - 16, Settings.SCREEN_HEIGHT - 32);
                    }
                    if (focus.X < 32)
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 0, Settings.SCREEN_HEIGHT - 64);
                    }
                    else if (focus.X > Settings.SCREEN_WIDTH - 32)
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 64, Settings.SCREEN_HEIGHT - 64);
                    }
                    else
                    {
                        graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, (int)Math.Round(focus.X) - 32, Settings.SCREEN_HEIGHT - 64);
                    }
                    return(true);

                case ThingScreenPosition.LeftLower:
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 7, 0, Settings.SCREEN_HEIGHT - 32);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, Settings.SCREEN_HEIGHT - 64);
                    return(true);
                }
            }
            return(false);
        }
Example #17
0
 public bool DrawWhereEnemyIs(GraphicsDevice graphics)
 {
     double minRange = double.MaxValue;
     Thing target = null;
     ThingScreenPosition targetPos = ThingScreenPosition.InScreen;
     foreach (Thing enemy in enemies)
     {
         ThingScreenPosition sp = GetScreenPosition(enemy.Center);
         if (sp == ThingScreenPosition.InScreen)
         {
             return false;
         }
         if (enemy is AtField || enemy is EggMachine)
         {
             continue;
         }
         Vector d = enemy.Center - player.Center;
         double range = d.X * d.X + d.Y * d.Y;
         if (range < minRange)
         {
             minRange = range;
             target = enemy;
             targetPos = sp;
         }
     }
     if (target != null)
     {
         Vector focus = target.Center - camera;
         switch (targetPos)
         {
             case ThingScreenPosition.Left:
                 if (focus.Y < 16)
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, 0);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, 0);
                 }
                 else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, Settings.SCREEN_HEIGHT - 32);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, Settings.SCREEN_HEIGHT - 32);
                 }
                 else
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, (int)Math.Round(focus.Y) - 16);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, (int)Math.Round(focus.Y) - 16);
                 }
                 return true;
             case ThingScreenPosition.LeftUpper:
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 1, 0, 0);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, 32);
                 return true;
             case ThingScreenPosition.Upper:
                 if (focus.X < 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, 0, 0);
                 else if (focus.X > Settings.SCREEN_WIDTH - 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, Settings.SCREEN_WIDTH - 32, 0);
                 else graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, (int)Math.Round(focus.X) - 16, 0);
                 if (focus.X < 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 0, 32);
                 else if (focus.X > Settings.SCREEN_WIDTH - 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 64, 32);
                 else graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, (int)Math.Round(focus.X) - 32, 32);
                 return true;
             case ThingScreenPosition.RightUpper:
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 3, Settings.SCREEN_WIDTH - 32, 0);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, 32);
                 return true;
             case ThingScreenPosition.Right:
                 if (focus.Y < 16)
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, 0);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, 0);
                 }
                 else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 32);
                 }
                 else
                 {
                     graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, (int)Math.Round(focus.Y) - 16);
                     graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, (int)Math.Round(focus.Y) - 16);
                 }
                 return true;
             case ThingScreenPosition.RightLower:
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 5, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 64);
                 return true;
             case ThingScreenPosition.Lower:
                 if (focus.X < 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, 0, Settings.SCREEN_HEIGHT - 32);
                 else if (focus.X > Settings.SCREEN_WIDTH - 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                 else graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, (int)Math.Round(focus.X) - 16, Settings.SCREEN_HEIGHT - 32);
                 if (focus.X < 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 0, Settings.SCREEN_HEIGHT - 64);
                 else if (focus.X > Settings.SCREEN_WIDTH - 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, Settings.SCREEN_WIDTH - 64, Settings.SCREEN_HEIGHT - 64);
                 else graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, (int)Math.Round(focus.X) - 32, Settings.SCREEN_HEIGHT - 64);
                 return true;
             case ThingScreenPosition.LeftLower:
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 7, 0, Settings.SCREEN_HEIGHT - 32);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 0, 32, Settings.SCREEN_HEIGHT - 64);
                 return true;
         }
     }
     return false;
 }
Example #18
0
 public bool DrawWhereExitIs(GraphicsDevice graphics)
 {
     Vector focus = door.Center - camera;
     ThingScreenPosition sp = GetScreenPosition(door.Center);
     switch (sp)
     {
         case ThingScreenPosition.Left:
             if (focus.Y < 16)
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, 0);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, 0);
             }
             else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, Settings.SCREEN_HEIGHT - 32);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, Settings.SCREEN_HEIGHT - 32);
             }
             else
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, (int)Math.Round(focus.Y) - 16);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, (int)Math.Round(focus.Y) - 16);
             }
             return true;
         case ThingScreenPosition.LeftUpper:
             graphics.DrawImage(GameImage.Hud, 32, 32, 0, 1, 0, 0);
             graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, 32);
             return true;
         case ThingScreenPosition.Upper:
             if (focus.X < 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, 0, 0);
             else if (focus.X > Settings.SCREEN_WIDTH - 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, Settings.SCREEN_WIDTH - 32, 0);
             else graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, (int)Math.Round(focus.X) - 16, 0);
             if (focus.X < 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 0, 32);
             else if (focus.X > Settings.SCREEN_WIDTH - 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 64, 32);
             else graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, (int)Math.Round(focus.X) - 32, 32);
             return true;
         case ThingScreenPosition.RightUpper:
             graphics.DrawImage(GameImage.Hud, 32, 32, 0, 3, Settings.SCREEN_WIDTH - 32, 0);
             graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, 32);
             return true;
         case ThingScreenPosition.Right:
             if (focus.Y < 16)
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, 0);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, 0);
             }
             else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 32);
             }
             else
             {
                 graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, (int)Math.Round(focus.Y) - 16);
                 graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, (int)Math.Round(focus.Y) - 16);
             }
             return true;
         case ThingScreenPosition.RightLower:
             graphics.DrawImage(GameImage.Hud, 32, 32, 0, 5, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
             graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 64);
             return true;
         case ThingScreenPosition.Lower:
             if (focus.X < 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, 0, Settings.SCREEN_HEIGHT - 32);
             else if (focus.X > Settings.SCREEN_WIDTH - 16) graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
             else graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, (int)Math.Round(focus.X) - 16, Settings.SCREEN_HEIGHT - 32);
             if (focus.X < 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 0, Settings.SCREEN_HEIGHT - 64);
             else if (focus.X > Settings.SCREEN_WIDTH - 32) graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 64, Settings.SCREEN_HEIGHT - 64);
             else graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, (int)Math.Round(focus.X) - 32, Settings.SCREEN_HEIGHT - 64);
             return true;
         case ThingScreenPosition.LeftLower:
             graphics.DrawImage(GameImage.Hud, 32, 32, 0, 7, 0, Settings.SCREEN_HEIGHT - 32);
             graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, Settings.SCREEN_HEIGHT - 64);
             return true;
     }
     return false;
 }
Example #19
0
        public bool DrawWhereExitIs(GraphicsDevice graphics)
        {
            Vector focus           = door.Center - camera;
            ThingScreenPosition sp = GetScreenPosition(door.Center);

            switch (sp)
            {
            case ThingScreenPosition.Left:
                if (focus.Y < 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, 0);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, 0);
                }
                else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, Settings.SCREEN_HEIGHT - 32);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, Settings.SCREEN_HEIGHT - 32);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, 0, (int)Math.Round(focus.Y) - 16);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, (int)Math.Round(focus.Y) - 16);
                }
                return(true);

            case ThingScreenPosition.LeftUpper:
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 1, 0, 0);
                graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, 32);
                return(true);

            case ThingScreenPosition.Upper:
                if (focus.X < 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, 0, 0);
                }
                else if (focus.X > Settings.SCREEN_WIDTH - 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, Settings.SCREEN_WIDTH - 32, 0);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 2, (int)Math.Round(focus.X) - 16, 0);
                }
                if (focus.X < 32)
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 0, 32);
                }
                else if (focus.X > Settings.SCREEN_WIDTH - 32)
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 64, 32);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, (int)Math.Round(focus.X) - 32, 32);
                }
                return(true);

            case ThingScreenPosition.RightUpper:
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 3, Settings.SCREEN_WIDTH - 32, 0);
                graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, 32);
                return(true);

            case ThingScreenPosition.Right:
                if (focus.Y < 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, 0);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, 0);
                }
                else if (focus.Y > Settings.SCREEN_HEIGHT - 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 32);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH - 32, (int)Math.Round(focus.Y) - 16);
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, (int)Math.Round(focus.Y) - 16);
                }
                return(true);

            case ThingScreenPosition.RightLower:
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 5, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 96, Settings.SCREEN_HEIGHT - 64);
                return(true);

            case ThingScreenPosition.Lower:
                if (focus.X < 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, 0, Settings.SCREEN_HEIGHT - 32);
                }
                else if (focus.X > Settings.SCREEN_WIDTH - 16)
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, Settings.SCREEN_WIDTH - 32, Settings.SCREEN_HEIGHT - 32);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 32, 32, 0, 6, (int)Math.Round(focus.X) - 16, Settings.SCREEN_HEIGHT - 32);
                }
                if (focus.X < 32)
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 0, Settings.SCREEN_HEIGHT - 64);
                }
                else if (focus.X > Settings.SCREEN_WIDTH - 32)
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, Settings.SCREEN_WIDTH - 64, Settings.SCREEN_HEIGHT - 64);
                }
                else
                {
                    graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, (int)Math.Round(focus.X) - 32, Settings.SCREEN_HEIGHT - 64);
                }
                return(true);

            case ThingScreenPosition.LeftLower:
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 7, 0, Settings.SCREEN_HEIGHT - 32);
                graphics.DrawImage(GameImage.Hud, 64, 32, 1, 1, 32, Settings.SCREEN_HEIGHT - 64);
                return(true);
            }
            return(false);
        }
Example #20
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background1, 1024, 512, IntBackgroundX, IntBackgroundY, 32 + (255 - skyColorCount) * 7 / 8, 32 + (255 - skyColorCount) * 3 / 8, 32);
 }
Example #21
0
File: Map.cs Project: sinshu/chaos
        public void Draw(GraphicsDevice graphics, int r, int g, int b)
        {
            int topRow = game.IntCameraY / Settings.BLOCK_WDITH;
            int bottomRow = (game.IntCameraY + Settings.SCREEN_HEIGHT) / Settings.BLOCK_WDITH;
            int leftCol = game.IntCameraX / Settings.BLOCK_WDITH;
            int rightCol = (game.IntCameraX + Settings.SCREEN_WIDTH) / Settings.BLOCK_WDITH;

            for (int row = topRow; row <= bottomRow; row++)
            {
                for (int col = leftCol; col <= rightCol; col++)
                {
                    int block = this[row, col];
                    if (block > 0)
                    {
                        int drawX = col * Settings.BLOCK_WDITH - game.IntCameraX;
                        int drawY = row * Settings.BLOCK_WDITH - game.IntCameraY;
                        int textureRow = block / 8;
                        int textureCol = block % 8;
                        if (block != 16)
                        {
                            graphics.DrawImage(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, r, g, b);
                        }
                        else
                        {
                            graphics.DrawImageAlpha(GameImage.Block, Settings.BLOCK_WDITH, Settings.BLOCK_WDITH, textureRow, textureCol, drawX, drawY, 128, r, g, b);
                        }
                    }
                }
            }
        }
Example #22
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     int color = 192 + skyColorCount / 4;
     graphics.DrawImage(GameImage.Background2, 1024, 512, IntBackgroundX, IntBackgroundY, color, color, color);
 }
Example #23
0
 public override void Draw(GraphicsDevice graphics)
 {
     int drawX = (int)Math.Round(position.X) - game.IntCameraX;
     int drawY = (int)Math.Round(position.Y) - game.IntCameraY;
     graphics.DrawImage(GameImage.Item, 32, 32, 0, animation / 2, drawX, drawY);
 }
Example #24
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background1, 1024, 512, IntBackgroundX, IntBackgroundY, 255, 128 + (255 - skyColorCount) / 2, 255 - (skyColorCount * 7 / 8));
 }
Example #25
0
        public void Draw(GraphicsDevice graphics)
        {
            game.Draw(graphics);

            if (numTicks < 16)
            {
                graphics.FillScreen(0, 0, 0, 255 - numTicks * 16);
            }

            if (numTicks == 165)
            {
                graphics.FillScreen(255, 255, 255, 255);
            }

            if (numTicks > 180)
            {
                for (int i = 0; i < 3; i++)
                {
                    graphics.DrawImageAdd(GameImage.Message, 256, 32, i, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 + 112 + 32 * i, (i <= 1 || !arcadeMode) ? 255 : 32);
                }
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, (Settings.SCREEN_WIDTH - 256) / 2 - 32 + 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, (Settings.SCREEN_WIDTH - 256) / 2 + 256 - 48, Settings.SCREEN_HEIGHT / 2 + 112 + currentSelectIndex * 32);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }

            if (exitCount > 0)
            {
                if (exitCount < 16)
                {
                    graphics.FillScreen(0, 0, 0, 16 * exitCount);
                }
                else
                {
                    graphics.FillScreen(0, 0, 0, 255);
                }
            }
        }
Example #26
0
        public void Draw(GraphicsDevice graphics)
        {
            graphics.FillScreen(0, 0, 0, 192);

            graphics.DrawImageAdd(GameImage.Message, 256, 32, 3, 0, (Settings.SCREEN_WIDTH - 256) / 2, Settings.SCREEN_HEIGHT / 2 - 80, 255);

            if (currentStageIndex + 1 < 10)
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, currentStageIndex + 1, (Settings.SCREEN_WIDTH - 32) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }
            else
            {
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) / 10, (Settings.SCREEN_WIDTH - 64) / 2, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
                graphics.DrawImageAdd(GameImage.Number, 32, 64, 0, (currentStageIndex + 1) % 10, (Settings.SCREEN_WIDTH - 64) / 2 + 32, (Settings.SCREEN_HEIGHT - 64) / 2, 255);
            }

            if (currentStageIndex > 0)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 0, Settings.SCREEN_WIDTH / 2 - 80, Settings.SCREEN_HEIGHT / 2 - 16);
            }
            if (currentStageIndex + 1 < numUnlockedStages)
            {
                graphics.DrawImage(GameImage.Hud, 32, 32, 0, 4, Settings.SCREEN_WIDTH / 2 + 48, Settings.SCREEN_HEIGHT / 2 - 16);
            }

            if (gotoGameCount > 0)
            {
                if (gotoGameCount < 16)
                {
                    graphics.FillScreen(255, 255, 255, 16 * gotoGameCount);
                }
                else
                {
                    graphics.FillScreen(255, 255, 255, 255);
                }
            }
        }
Example #27
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     int color = 64 + (255 - skyColorCount) * 3 / 4;
     graphics.DrawImage(GameImage.Background4, 1024, 512, IntBackgroundX, IntBackgroundY, color, color, color);
 }
Example #28
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background4, 1024, 512, IntBackgroundX, IntBackgroundY);
 }
Example #29
0
 public override void DrawBackground(GraphicsDevice graphics)
 {
     graphics.DrawImage(GameImage.Background1, 1024, 512, IntBackgroundX, IntBackgroundY, 255, 128 + (255 - skyColorCount) / 2, 255 - (skyColorCount * 7 / 8));
 }