hrmm, I'm not too sure what I'm trying to do is called. I have a sprite. On the update function of the scene I'm trying to make this sprite fade from -255(RGB) to 255 then back to -255 continuously. is there some way i can use Math::Sin() to do this?
this is my current code which creates an okay effect.
this is my current code which creates an okay effect.
Code:
def update_command
@sprite.tone = Tone.new(@spr,@spg,@spb)
if @reverse != true
@spr += 2
@spg += 3
@spb += 7
else
@spr -= 2
@spg -= 3
@spb -= 7
end
if @spr >= 255 then
@reverse = true
end
if @spr <= -255 then
@reverse = false
end