Esempio n. 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);
            }
        }
Esempio n. 2
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera;

            switch (type)
            {
            case Map.SPIKE_LEFT:
                video.Draw(48, 0, 16, 16, 0, 0, p.X, p.Y);
                break;

            case Map.SPIKE_UP:
                video.Draw(48, 0, 16, 16, 0, 1, p.X, p.Y);
                break;

            case Map.SPIKE_RIGHT:
                video.Draw(48, 0, 16, 16, 0, 2, p.X, p.Y);
                break;

            case Map.SPIKE_DOWN:
                video.Draw(48, 0, 16, 16, 0, 3, p.X, p.Y);
                break;

            default:
                video.Draw(32, 0, 16, 16, 0, 0, p.X, p.Y);
                break;
            }
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 public void Draw(MafiaVideo video)
 {
     IntVector p = (IntVector)position;
     if (type == MAFIA)
     {
         video.Draw(0, 16, 16, 32, 0, animation, p.X, p.Y);
     }
     else if (type == COIN)
     {
         video.Draw(0, 48, 16, 16, 0, animation, p.X, p.Y);
     }
 }
Esempio n. 5
0
        public void Draw(MafiaVideo video)
        {
            IntVector p = (IntVector)position;

            if (type == MAFIA)
            {
                video.Draw(0, 16, 16, 32, 0, animation, p.X, p.Y);
            }
            else if (type == COIN)
            {
                video.Draw(0, 48, 16, 16, 0, animation, p.X, p.Y);
            }
        }
Esempio n. 6
0
        private void DrawStageNumber(MafiaVideo video)
        {
            int number = stageIndex + 1;

            if (number < 10)
            {
                video.Draw(0, 160, 16, 16, 0, number, Mafia.SCREEN_WIDTH / 2 - 8, Mafia.SCREEN_HEIGHT / 2 - 8);
            }
            else
            {
                video.Draw(0, 160, 16, 16, 0, (number / 10) % 10, Mafia.SCREEN_WIDTH / 2 - 8 - 8, Mafia.SCREEN_HEIGHT / 2 - 8);
                video.Draw(0, 160, 16, 16, 0, number % 10, Mafia.SCREEN_WIDTH / 2 - 8 + 8, Mafia.SCREEN_HEIGHT / 2 - 8);
            }
        }
Esempio n. 7
0
File: Tiun.cs Progetto: sinshu/mafia
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera)) return;
     IntVector p = (IntVector)Position - camera;
     if (type == TIUN)
     {
         video.Draw(0, 112, 16, 16, 0, 7 - (life / 2) % 8, p.X, p.Y);
     }
     else if (type == KIRA)
     {
         video.Draw(0, 112, 16, 16, 1, 7 - (life / 2) % 8, p.X, p.Y);
     }
     else if (type == MOKU)
     {
         video.Draw(0, 112, 16, 16, 2, 7 - (life / 2) % 8, p.X, p.Y);
     }
 }
Esempio n. 8
0
 public void Draw(MafiaVideo video)
 {
     video.FillScreen(Color.FromArgb(128, Color.Black));
     video.DrawStringCenter("ステージをえらんでください", 1, -63, Color.Black);
     video.DrawStringCenter("ステージをえらんでください", 0, -64, Color.White);
     if (stageIndex != 0)
     {
         video.Draw(176, 160, 8, 16, 0, 0, Mafia.SCREEN_WIDTH / 2 - 24, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
     if (stageIndex != stages.Length - 1)
     {
         video.Draw(176, 160, 8, 16, 0, 1, Mafia.SCREEN_WIDTH / 2 + 16, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
     DrawStageNumber(video);
     video.DrawStringCenter(stages[stageIndex].Title, 1, 25, Color.Black);
     video.DrawStringCenter(stages[stageIndex].Title, 0, 24, Color.White);
 }
Esempio n. 9
0
 public void Draw(MafiaVideo video)
 {
     video.FillScreen(Color.FromArgb(128, Color.Black));
     video.DrawStringCenter("�X�e�[�W������ł�������", 1, -63, Color.Black);
     video.DrawStringCenter("�X�e�[�W������ł�������", 0, -64, Color.White);
     if (stageIndex != 0)
     {
         video.Draw(176, 160, 8, 16, 0, 0, Mafia.SCREEN_WIDTH / 2 - 24, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
     if (stageIndex != stages.Length - 1)
     {
         video.Draw(176, 160, 8, 16, 0, 1, Mafia.SCREEN_WIDTH / 2 + 16, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
     DrawStageNumber(video);
     video.DrawStringCenter(stages[stageIndex].Title, 1, 25, Color.Black);
     video.DrawStringCenter(stages[stageIndex].Title, 0, 24, Color.White);
 }
Esempio n. 10
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);
         }
     }
 }
Esempio n. 11
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera;

            video.Draw(176, 64, 8, 48, 0, 0, p.X, p.Y);
        }
Esempio n. 12
0
        public void Draw(MafiaVideo video, IntVector camera)
        {
            int topRow    = camera.Y / Mafia.BLOCK_WIDTH;
            int bottomRow = (camera.Y + Mafia.SCREEN_HEIGHT) / Mafia.BLOCK_WIDTH;
            int leftCol   = camera.X / Mafia.BLOCK_WIDTH;
            int rightCol  = (camera.X + Mafia.SCREEN_WIDTH) / Mafia.BLOCK_WIDTH;

            int numRows = Mafia.SCREEN_HEIGHT / Mafia.BLOCK_WIDTH;
            int numCols = Mafia.SCREEN_WIDTH / Mafia.BLOCK_WIDTH;

            for (int row = 0; row <= numRows; row++)
            {
                for (int col = 0; col <= numCols; col++)
                {
                    video.Draw(16, 0, 16, 16, 0, 0, col * Mafia.BLOCK_WIDTH - (camera.X / 2) % 16, row * Mafia.BLOCK_WIDTH - (camera.Y / 2) % 16);
                }
            }

            for (int row = topRow; row <= bottomRow; row++)
            {
                for (int col = leftCol; col <= rightCol; col++)
                {
                    IntVector p = new IntVector(col * Mafia.BLOCK_WIDTH - camera.X, row * Mafia.BLOCK_WIDTH - camera.Y);
                    switch (this[row, col])
                    {
                    case NONE:
                        break;

                    case Map.SPIKE_LEFT:
                        video.Draw(48, 0, 16, 16, 0, 0, p.X, p.Y);
                        break;

                    case Map.SPIKE_UP:
                        video.Draw(48, 0, 16, 16, 0, 1, p.X, p.Y);
                        break;

                    case Map.SPIKE_RIGHT:
                        video.Draw(48, 0, 16, 16, 0, 2, p.X, p.Y);
                        break;

                    case Map.SPIKE_DOWN:
                        video.Draw(48, 0, 16, 16, 0, 3, p.X, p.Y);
                        break;

                    case LIFT_RETURN:
                        break;

                    case DOOR_SLIDE:
                        video.Draw(112, 0, 16, 16, 0, 0, p.X, p.Y);
                        break;

                    default:
                        video.Draw(32, 0, 16, 16, 0, 0, p.X, p.Y);
                        break;
                    }
                }
            }
        }
Esempio n. 13
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera, 0, 0, 16, 0))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera - new IntVector(0, 16);

            video.Draw(0, 64, 16, 32, 0, animation, p.X, p.Y);
        }
Esempio n. 14
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera, 0, 0, 2, 0))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera - new IntVector(0, 12);

            video.Draw(128, 0, 16, 16, 0, pressed ? 1 : 0, p.X, p.Y);
        }
Esempio n. 15
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera;

            video.Draw(0, 48, 16, 16, 0, animation, p.X, p.Y);
        }
Esempio n. 16
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera))
            {
                return;
            }
            IntVector p = (IntVector)Position - camera;

            if (type == TIUN)
            {
                video.Draw(0, 112, 16, 16, 0, 7 - (life / 2) % 8, p.X, p.Y);
            }
            else if (type == KIRA)
            {
                video.Draw(0, 112, 16, 16, 1, 7 - (life / 2) % 8, p.X, p.Y);
            }
            else if (type == MOKU)
            {
                video.Draw(0, 112, 16, 16, 2, 7 - (life / 2) % 8, p.X, p.Y);
            }
        }
Esempio n. 17
0
        public override void Draw(MafiaVideo video, IntVector camera)
        {
            if (!ShouldDraw(camera))
            {
                return;
            }
            if (missed)
            {
                return;
            }
            IntVector p = (IntVector)Position - camera;

            switch (Direction)
            {
            case LEFT:
                video.Draw(0, 16, 16, 32, 0, Animation, p.X, p.Y);
                break;

            case RIGHT:
                video.Draw(128, 16, 16, 32, 0, Animation, p.X, p.Y);
                break;
            }
        }
Esempio n. 18
0
File: Coin.cs Progetto: sinshu/mafia
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera)) return;
     IntVector p = (IntVector)Position - camera;
     video.Draw(0, 48, 16, 16, 0, animation, p.X, p.Y);
 }
Esempio n. 19
0
File: Door.cs Progetto: sinshu/mafia
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera)) return;
     IntVector p = (IntVector)Position - camera;
     video.Draw(176, 64, 8, 48, 0, 0, p.X, p.Y);
 }
Esempio n. 20
0
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera)) return;
     if (missed) return;
     IntVector p = (IntVector)Position - camera;
     switch (Direction)
     {
         case LEFT:
             video.Draw(0, 16, 16, 32, 0, Animation, p.X, p.Y);
             break;
         case RIGHT:
             video.Draw(128, 16, 16, 32, 0, Animation, p.X, p.Y);
             break;
     }
 }
Esempio n. 21
0
File: Map.cs Progetto: sinshu/mafia
        public void Draw(MafiaVideo video, IntVector camera)
        {
            int topRow = camera.Y / Mafia.BLOCK_WIDTH;
            int bottomRow = (camera.Y + Mafia.SCREEN_HEIGHT) / Mafia.BLOCK_WIDTH;
            int leftCol = camera.X / Mafia.BLOCK_WIDTH;
            int rightCol = (camera.X + Mafia.SCREEN_WIDTH) / Mafia.BLOCK_WIDTH;

            int numRows = Mafia.SCREEN_HEIGHT / Mafia.BLOCK_WIDTH;
            int numCols = Mafia.SCREEN_WIDTH / Mafia.BLOCK_WIDTH;

            for (int row = 0; row <= numRows; row++)
            {
                for (int col = 0; col <= numCols; col++)
                {
                    video.Draw(16, 0, 16, 16, 0, 0, col * Mafia.BLOCK_WIDTH - (camera.X / 2) % 16, row * Mafia.BLOCK_WIDTH - (camera.Y / 2) % 16);
                }
            }

            for (int row = topRow; row <= bottomRow; row++)
            {
                for (int col = leftCol; col <= rightCol; col++)
                {
                    IntVector p = new IntVector(col * Mafia.BLOCK_WIDTH - camera.X, row * Mafia.BLOCK_WIDTH - camera.Y);
                    switch (this[row, col])
                    {
                        case NONE:
                            break;
                        case Map.SPIKE_LEFT:
                            video.Draw(48, 0, 16, 16, 0, 0, p.X, p.Y);
                            break;
                        case Map.SPIKE_UP:
                            video.Draw(48, 0, 16, 16, 0, 1, p.X, p.Y);
                            break;
                        case Map.SPIKE_RIGHT:
                            video.Draw(48, 0, 16, 16, 0, 2, p.X, p.Y);
                            break;
                        case Map.SPIKE_DOWN:
                            video.Draw(48, 0, 16, 16, 0, 3, p.X, p.Y);
                            break;
                        case LIFT_RETURN:
                            break;
                        case DOOR_SLIDE:
                            video.Draw(112, 0, 16, 16, 0, 0, p.X, p.Y);
                            break;
                        default:
                            video.Draw(32, 0, 16, 16, 0, 0, p.X, p.Y);
                            break;
                    }
                }
            }
        }
Esempio n. 22
0
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera)) return;
     IntVector p = (IntVector)Position - camera;
     switch (type)
     {
         case Map.SPIKE_LEFT:
             video.Draw(48, 0, 16, 16, 0, 0, p.X, p.Y);
             break;
         case Map.SPIKE_UP:
             video.Draw(48, 0, 16, 16, 0, 1, p.X, p.Y);
             break;
         case Map.SPIKE_RIGHT:
             video.Draw(48, 0, 16, 16, 0, 2, p.X, p.Y);
             break;
         case Map.SPIKE_DOWN:
             video.Draw(48, 0, 16, 16, 0, 3, p.X, p.Y);
             break;
         default:
             video.Draw(32, 0, 16, 16, 0, 0, p.X, p.Y);
             break;
     }
 }
Esempio n. 23
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);
         }
     }
 }
Esempio n. 24
0
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera, 0, 0, 16, 0)) return;
     IntVector p = (IntVector)Position - camera - new IntVector(0, 16);
     video.Draw(0, 64, 16, 32, 0, animation, p.X, p.Y);
 }
Esempio n. 25
0
 public override void Draw(MafiaVideo video, IntVector camera)
 {
     if (!ShouldDraw(camera, 0, 0, 2, 0)) return;
     IntVector p = (IntVector)Position - camera - new IntVector(0, 12);
     video.Draw(128, 0, 16, 16, 0, pressed ? 1 : 0, p.X, p.Y);
 }
Esempio n. 26
0
 private void DrawStageNumber(MafiaVideo video)
 {
     int number = stageIndex + 1;
     if (number < 10)
     {
         video.Draw(0, 160, 16, 16, 0, number, Mafia.SCREEN_WIDTH / 2 - 8, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
     else
     {
         video.Draw(0, 160, 16, 16, 0, (number / 10) % 10, Mafia.SCREEN_WIDTH / 2 - 8 - 8, Mafia.SCREEN_HEIGHT / 2 - 8);
         video.Draw(0, 160, 16, 16, 0, number % 10, Mafia.SCREEN_WIDTH / 2 - 8 + 8, Mafia.SCREEN_HEIGHT / 2 - 8);
     }
 }