private void trbAll_Scroll(object sender, EventArgs e) { color[0] = (float)trbRed.Value / 100; color[1] = (float)trbGreen.Value / 100; color[2] = (float)trbBlue.Value / 100; //重新着色 picTank.Image = GameImages.Recoloring(GameImages.tankPic[0][0], color); }
/// <summary> /// 构造函数 /// </summary> /// <param name="name">坦克名字</param> /// <param name="x">位置x</param> /// <param name="y">位置y</param> /// <param name="bmpTank">坦克使用的图片</param> public Tank(string name, int x, int y, Direction dir, float[] tankColor) { this.Name = name; this.X = x; this.Y = y; this.Life = 1; this.Dir = dir; this.DirOld = dir; this.Speed = 5; this.Level = 0; this.Color = tankColor; this.bmpTankAll[0] = GameImages.Recoloring(GameImages.tankPic[0], Color); //0级坦克图片 this.bmpTankAll[1] = GameImages.Recoloring(GameImages.tankPic[2], Color); //1级坦克图片 this.bmpTankAll[2] = GameImages.Recoloring(GameImages.tankPic[4], Color); //2级坦克图片 this.bmpTankAll[3] = GameImages.Recoloring(GameImages.tankPic[6], Color); //3级坦克图片 this.bmpTankOld = bmpTankAll[Level][0]; }