piece.cs

来自「Line2008 by Do Minh Duc」· CS 代码 · 共 57 行

CS
57
字号
/**********************************/
/*                                */
/* Author: BUI VAN NGHIA          */
/* Email: katatunix@yahoo.com     */
/*                 [May, 2008]    */
/*                                */
/**********************************/

using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace Lines2008
{
	class Piece : PictureBox
	{
		public int col, row;
		public int color;

		public Piece(int i, int j)
		{
			this.col = i;
			this.row = j;
			this.Location = SkinConstants.getLocationOfPiece(i, j);
			this.Size = new Size(
				SkinConstants.BallSize.Width, SkinConstants.BallSize.Height);
		}

		public void setNormal()
		{
			this.Image = ClippingImage.bitmapPiece[0, color - 1];
		}

		public void setHint()
		{
			this.Image = ClippingImage.bitmapPiece[SkinConstants.BallHint, -color - 1];
		}

		public void setJumpAt(int frame)
		{
			this.Image = ClippingImage.bitmapPiece[SkinConstants.BallSelected[frame] - 1, color - 1];
		}

		public void setAppearenceAt(int frame)
		{
			this.Image = ClippingImage.bitmapPiece[SkinConstants.BallAppearence[frame] - 1, -color - 1];
		}

		public void setDestructionAt(int frame)
		{
			this.Image = ClippingImage.bitmapPiece[SkinConstants.BallDestruction[frame] - 1, color - 1];
		}
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?