Creating A Rainbow Mode Effect, Best Way???
KillerPenguinStudios
Member Posts: 1,291
Hey GS,
So in my game I want to create a mode called rainbow mode that occurs when you collect something. The objects and everything in the scene go through random colors creating a rainbow effect and possibly a rainbow trail behind my character almost like nyan cat, lol. Just trying to figure out the best way to accomplish this and if others have done this how they went about accomplishing this.
I know there are plenty of game examples of what I want to accomplish but can't really think of any off the top of my head. The only example of what I want to pretty much accomplish that comes to mind is Pac-Man Championship Edition. Below is a picture. Thanks in advance for your guys input!
Comments
You could constrain each of the RGB channels of your objects to a 'clipped' sine wave (a sine wave with the top and bottom squared off), and then offset each of the channels by 120° . . . . this will make your objects (preferably white) cycle through the spectrum . . . . then add a further offset to the angle that sin operating on based on the position of the object on the screen . . . this will give you a sweeping rainbow moving across the screen. Although depending on your project it might be a little too many constrains ?
Hope that makes sense !
. . . . . . . . . . . .
Or maybe you could just use a rainbow image overlay set on Multiply ?
woah
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left
There goes @Socks again speaking klingon.
That video is so sweet my teeth fell out.
Fortuna Infortuna Forti Una
Thanks @Socks,
that video shows the exact thing I want to accomplish. Did you just make that and the video??? If so, thank you! You always seem to have the right answers for me @Socks and for that I am forever grateful!!! I almost love you but don't want to get weird, HAHAHAHAHA
I can't thank you enough and will be trying this out when I get home!!!
I'm always surprised what people think is impressive (or cool, or whatever), this is just the same old rotating spectrum thing done a million times !
I'll be double locking the doors and windows tonight.
By the way, it would be much more efficient (I've tested this idea a lot on actual devices) if you animated a block of colour moving 360° through the spectrum - and use that on your actors (where applicable) instead of three constrain behaviours.
HAHAHA, No need for that. I'll be too busy game developing to go anywhere. I'll be locked down in my room! HAHAHA!!!
@Socks, could you please give an example of this? The video in this thread is no longer available and I'm interested!
Thanks!
edit:
I found another thread where you answered the same thing! Your solution is pasted below, I adjusted it where necessary. Thanks again.
R to sin(vectorToAngle(self.X-game.baseX, self.Y-game.baseY))+0.5
G to sin(120+(vectorToAngle(self.X-game.baseX, self.Y-game.baseY))+0.5
B to sin(240+(vectorToAngle(self.X-game.baseX, self.Y-game.baseY))+0.5
I can't give you an actual GameSalad example (too poor to afford GameSalad at the moment), but I can explain the overall theory as is applicable to GameSalad if you want ?
No need, but thanks anyway
Good ! It involved graphs and sine waves and a picture of a rainbow.