コード例 #1
0
        private void DrawBomb(Context context, Bomb bomb)
        {
            float drawX = bomb.GetPx();
            float drawY = bomb.GetPy();

            AnimationInstance anim = bomb.currentAnimation;
            anim.Draw(context, drawX, drawY + 0.5f * cellHeight, bomb.IsBlocked ? Color.Red : Color.White);

            if (CVars.g_drawBombDir.boolValue)
            {
                TextureImage dirImage = dirLookup[bomb.direction];
                context.DrawImage(dirImage, drawX - 0.5f * dirImage.GetWidth(), drawY - 0.5f * dirImage.GetHeight());
            }

            context.DrawRect(bomb.cx * cellWidth, bomb.cy * cellHeight, cellWidth, cellHeight, Color.White);
            context.DrawRect(bomb.px - 0.5f * cellWidth, bomb.py - 0.5f * cellHeight, cellWidth, cellHeight, Color.Red);
        }