Пример #1
0
 public void Draw(MafiaVideo video, IntVector camera)
 {
     foreach (Thing thing in list)
     {
         thing.Draw(video, camera);
     }
 }
Пример #2
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);
     }
 }
Пример #3
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);
 }
Пример #4
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);
 }
Пример #5
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;
                    }
                }
            }
        }
Пример #6
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);
 }
Пример #7
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);
 }
Пример #8
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;
     }
 }
Пример #9
0
 protected bool ShouldDraw(IntVector camera, int left, int right, int top, int bottom)
 {
     return Left - left < camera.X + Mafia.SCREEN_WIDTH && camera.X < Right + right && Top - top < camera.Y + Mafia.SCREEN_HEIGHT && camera.Y < Bottom + bottom;
 }
Пример #10
0
 protected bool ShouldDraw(IntVector camera)
 {
     return Left < camera.X + Mafia.SCREEN_WIDTH && camera.X < Right && Top < camera.Y + Mafia.SCREEN_HEIGHT && camera.Y < Bottom;
 }
Пример #11
0
 public abstract void Draw(MafiaVideo video, IntVector camera);
Пример #12
0
 public abstract void Draw(MafiaVideo video, IntVector camera);
Пример #13
0
 protected bool ShouldDraw(IntVector camera, int left, int right, int top, int bottom)
 {
     return(Left - left < camera.X + Mafia.SCREEN_WIDTH && camera.X < Right + right && Top - top < camera.Y + Mafia.SCREEN_HEIGHT && camera.Y < Bottom + bottom);
 }
Пример #14
0
 protected bool ShouldDraw(IntVector camera)
 {
     return(Left < camera.X + Mafia.SCREEN_WIDTH && camera.X < Right && Top < camera.Y + Mafia.SCREEN_HEIGHT && camera.Y < Bottom);
 }
Пример #15
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;
     }
 }