Пример #1
0
        public void Draw(MafiaVideo video)
        {
            for (int row = -1; row < Mafia.SCREEN_HEIGHT / Mafia.BLOCK_WIDTH; row++)
            {
                for (int col = -1; col < Mafia.SCREEN_WIDTH / Mafia.BLOCK_WIDTH; col++)
                {
                    video.Draw(16, 0, 16, 16, 0, 0, col * Mafia.BLOCK_WIDTH, row * Mafia.BLOCK_WIDTH + ((int)Math.Round(32 * Math.Sin(Math.PI * timer / 180.0)) + 1024) % 16);
                }
            }

            for (int i = 0; i < 128; i++)
            {
                double x = Mafia.SCREEN_WIDTH / 2 - 128 + titleWaveWidth * Math.Cos(Math.PI * i / 32.0 + Math.PI * timer / 24.0 + Math.PI) + 3;
                int y = Mafia.SCREEN_HEIGHT / 2 - 64 + 3;
                video.DrawColor(0, 384, 256, 1, i, 0, (int)Math.Round(x), y + i, Color.FromArgb(128, Color.Black));
            }

            for (int i = 0; i < NUM_OBJECTS; i++)
            {
                objects[i].Draw(video);
            }

            for (int i = 0; i < 128; i++)
            {
                double x = Mafia.SCREEN_WIDTH / 2 - 128 + titleWaveWidth * Math.Cos(Math.PI * i / 32.0 + Math.PI * timer / 24.0) - 1;
                int y = Mafia.SCREEN_HEIGHT / 2 - 64 - 1;
                video.Draw(0, 384, 256, 1, i, 0, (int)Math.Round(x), y + i);
            }
        }
Пример #2
0
        public void Draw(MafiaVideo video)
        {
            for (int row = -1; row < Mafia.SCREEN_HEIGHT / Mafia.BLOCK_WIDTH; row++)
            {
                for (int col = -1; col < Mafia.SCREEN_WIDTH / Mafia.BLOCK_WIDTH; col++)
                {
                    video.Draw(16, 0, 16, 16, 0, 0, col * Mafia.BLOCK_WIDTH, row * Mafia.BLOCK_WIDTH + ((int)Math.Round(32 * Math.Sin(Math.PI * timer / 180.0)) + 1024) % 16);
                }
            }

            for (int i = 0; i < 128; i++)
            {
                double x = Mafia.SCREEN_WIDTH / 2 - 128 + titleWaveWidth * Math.Cos(Math.PI * i / 32.0 + Math.PI * timer / 24.0 + Math.PI) + 3;
                int    y = Mafia.SCREEN_HEIGHT / 2 - 64 + 3;
                video.DrawColor(0, 384, 256, 1, i, 0, (int)Math.Round(x), y + i, Color.FromArgb(128, Color.Black));
            }

            for (int i = 0; i < NUM_OBJECTS; i++)
            {
                objects[i].Draw(video);
            }

            for (int i = 0; i < 128; i++)
            {
                double x = Mafia.SCREEN_WIDTH / 2 - 128 + titleWaveWidth * Math.Cos(Math.PI * i / 32.0 + Math.PI * timer / 24.0) - 1;
                int    y = Mafia.SCREEN_HEIGHT / 2 - 64 - 1;
                video.Draw(0, 384, 256, 1, i, 0, (int)Math.Round(x), y + i);
            }
        }
Пример #3
0
 public void Draw(MafiaVideo video)
 {
     map.Draw(video, (IntVector)camera);
     things.Draw(video, (IntVector)camera);
     if (!player.Missed)
     {
         if (currentNumCoins == 0)
         {
             // video.Draw(0, 320, 128, 64, 0, 0, Mafia.SCREEN_WIDTH / 2 - 64, Mafia.SCREEN_HEIGHT / 2 - 32);
             double waveWidth = 0;
             if (clearTimer < 60)
             {
                 waveWidth = (60 - clearTimer) / 2;
             }
             for (int i = 0; i < 64; i++)
             {
                 double x = Mafia.SCREEN_WIDTH / 2 - 64 + waveWidth * Math.Cos(Math.PI * i / 16.0 + Math.PI * clearTimer / 12.0 + Math.PI) + 2;
                 int    y = Mafia.SCREEN_HEIGHT / 2 - 32;
                 video.DrawColor(0, 320, 128, 1, i, 0, (int)Math.Round(x), y + i + 2, Color.FromArgb(128, Color.Black));
             }
             for (int i = 0; i < 64; i++)
             {
                 double x = Mafia.SCREEN_WIDTH / 2 - 64 + waveWidth * Math.Cos(Math.PI * i / 16.0 + Math.PI * clearTimer / 12.0);
                 int    y = Mafia.SCREEN_HEIGHT / 2 - 32;
                 video.Draw(0, 320, 128, 1, i, 0, (int)Math.Round(x), y + i);
             }
         }
         else
         {
             if (gameTimer < 300)
             {
                 video.DrawStringCenter(title, 1, 1, Color.Black);
                 video.DrawStringCenter(title, 0, 0, Color.White);
             }
             else
             {
                 video.DrawString(title, 9, 9, Color.Black);
                 video.DrawString(title, 8, 8, Color.White);
             }
             video.Draw(0, 160, 16, 16, 0, (firstNumCoins - currentNumCoins) % 10, Mafia.SCREEN_WIDTH - 48, Mafia.SCREEN_HEIGHT - 16);
             video.Draw(0, 160, 16, 16, 0, 10, Mafia.SCREEN_WIDTH - 32, Mafia.SCREEN_HEIGHT - 16);
             video.Draw(0, 160, 16, 16, 0, firstNumCoins % 10, Mafia.SCREEN_WIDTH - 16, Mafia.SCREEN_HEIGHT - 16);
         }
     }
 }
Пример #4
0
 public void Draw(MafiaVideo video)
 {
     map.Draw(video, (IntVector)camera);
     things.Draw(video, (IntVector)camera);
     if (!player.Missed)
     {
         if (currentNumCoins == 0)
         {
             // video.Draw(0, 320, 128, 64, 0, 0, Mafia.SCREEN_WIDTH / 2 - 64, Mafia.SCREEN_HEIGHT / 2 - 32);
             double waveWidth = 0;
             if (clearTimer < 60)
             {
                 waveWidth = (60 - clearTimer) / 2;
             }
             for (int i = 0; i < 64; i++)
             {
                 double x = Mafia.SCREEN_WIDTH / 2 - 64 + waveWidth * Math.Cos(Math.PI * i / 16.0 + Math.PI * clearTimer / 12.0 + Math.PI) + 2;
                 int y = Mafia.SCREEN_HEIGHT / 2 - 32;
                 video.DrawColor(0, 320, 128, 1, i, 0, (int)Math.Round(x), y + i + 2, Color.FromArgb(128, Color.Black));
             }
             for (int i = 0; i < 64; i++)
             {
                 double x = Mafia.SCREEN_WIDTH / 2 - 64 + waveWidth * Math.Cos(Math.PI * i / 16.0 + Math.PI * clearTimer / 12.0);
                 int y = Mafia.SCREEN_HEIGHT / 2 - 32;
                 video.Draw(0, 320, 128, 1, i, 0, (int)Math.Round(x), y + i);
             }
         }
         else
         {
             if (gameTimer < 300)
             {
                 video.DrawStringCenter(title, 1, 1, Color.Black);
                 video.DrawStringCenter(title, 0, 0, Color.White);
             }
             else
             {
                 video.DrawString(title, 9, 9, Color.Black);
                 video.DrawString(title, 8, 8, Color.White);
             }
             video.Draw(0, 160, 16, 16, 0, (firstNumCoins - currentNumCoins) % 10, Mafia.SCREEN_WIDTH - 48, Mafia.SCREEN_HEIGHT - 16);
             video.Draw(0, 160, 16, 16, 0, 10, Mafia.SCREEN_WIDTH - 32, Mafia.SCREEN_HEIGHT - 16);
             video.Draw(0, 160, 16, 16, 0, firstNumCoins % 10, Mafia.SCREEN_WIDTH - 16, Mafia.SCREEN_HEIGHT - 16);
         }
     }
 }