0
嗨有即时通讯完成我的游戏,但我想添加一些细节,其中之一是循环槽颜色周期我已经尝试过SKActions,这很好,但它重叠了一切。不断改变背景颜色在swift中
然后我在更新功能做这个,但它不会做任何事情
if BGRed == 1 {RedBoolIs1 = true}
else {RedBoolIs1 = false}
if BGGreen == 1 {GreenBoolIs1 = true}
else {GreenBoolIs1 = false}
if BGBlue == 1 {BlueBoolIs1 = true}
else {BlueBoolIs1 = false}
//red only
if RedBoolIs1 == true && GreenBoolIs1 == false && BlueBoolIs1 == false {
BGGreen = BGGreen + 0.01 }
//red and green
if RedBoolIs1 == true && GreenBoolIs1 == true && BlueBoolIs1 == false {
BGRed = BGRed - 0.01 }
//green only
if RedBoolIs1 == false && GreenBoolIs1 == true && BlueBoolIs1 == false {
BGBlue = BGBlue + 0.01 }
//green and blue
if RedBoolIs1 == false && GreenBoolIs1 == true && BlueBoolIs1 == true {
BGGreen = BGGreen - 0.01 }
//blue only
if RedBoolIs1 == false && GreenBoolIs1 == false && BlueBoolIs1 == true {
BGRed = BGRed + 0.01 }
//blue and red
if RedBoolIs1 == true && GreenBoolIs1 == false && BlueBoolIs1 == true {
BGBlue = BGBlue - 0.01 }
self.backgroundColor = SKColor(red: CGFloat(BGRed), green: CGFloat(BGGreen), blue: CGFloat(BGBlue), alpha: 1)
也有可能使标签上的所有颜色可读?我的解决方案现在将2个标签上彼此第一个是白色的,45大和上面说的一个是黑色的,40大,但它并不总是好的
感谢
完美作品的魅力! – 2014-08-30 13:13:52