Interpolating with the color red
BasGoodboy
Member, PRO Posts: 310
Hey guys,
I want to interpolate an actor when he gets hit to color red, but if i do set self-color to red, with value 0, the actor gets green?!!
What should I do to fix this?
I want to interpolate an actor when he gets hit to color red, but if i do set self-color to red, with value 0, the actor gets green?!!
What should I do to fix this?
Goodboi Gamestudios | Monster Jumper now on the App Store
Comments
1 in GameSalad is the equivalent of 255 value you're probably use to seeing in art programs. 0.5 in GameSalad would be 127.5
Goodboi Gamestudios | Monster Jumper now on the App Store
When actor is hit, set game.mobhitcolor to 1
If attribute game.mobhitcolor = 1
(timer)for one second:
interpolate actor (going red)
But after the second the color overlay won't fade away.
So i did change attribute back to game.mobhitcolor to 0.
How should i set mobhitcolor=0 to get original colors actor back?
Goodboi Gamestudios | Monster Jumper now on the App Store
Hi @BasGoodBoy
A couple of comments first:
• Unless you need that attribute mobhitcolor for something else, you don't need it at all to trigger the colour change if you're using overlaps or collides Rule
• If you're using Interpolate to change the colour back, this includes a timer so you don't need a separate Timer behaviour
• You didn't mention what the original colour of the actor is, so for the example below, I've assumed it's white.
Rule: When Actor overlaps or collides with BaddyActor
Change Attribute self.Color.Green to 0
Change Attribute self.Color.Blue to 0
Interpolate self.Color.Green to 1 Duration:1
Interpolate self.Color.Blue to 1 Duration:1
Hope that helps.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
I really want to know how I can use interpolate to change the original colors back.
@gyroscope the original colors are just colorful pixelarted chars, and there are different chars which spawn random to be fought with, so can't really answer on that.
Goodboi Gamestudios | Monster Jumper now on the App Store
Timer after 1 second
Interpolate colours back to original ones (fade away)
So:
Interpolate: red
Timer: After 1 second
..Interpolate: fade red away
I've added dots to show interpolate is nested inside the timer
Is it red, blue, green color to 1 or 2 or how can i do this.
If I insert an interpole attribute, it says this:
INTERPOLATE ATTRIBUTE: so here i put self.color.red TO ...
DURATION:
FUNCTION: Linear or Ease in or Ease out or Ease in/out
So where can I set the coming back of original colors?
Goodboi Gamestudios | Monster Jumper now on the App Store
I'll explain a bit more: any actor (even with an image) whose colour is white, has red, green and blue all set to 1. This "colour" white doesn't actually appear over the image (but does show if the actor doesn't have an image).
You want a red colour overlaid on your graphics numbers when they collide. A red colour is made by changing the Green and the Blue to 0.
When you want to fade back to the original colour (i.e "no colour" white on an image) you simply have to make the colours you changed back to 1 again. Interpolate is a great behaviour for changing an attribute over time. Because you need to change two attributes to get your red faded back to white (the Green & Blue), you'll need two Interpolate Behaviours, one for each of the colour attributes.
(If other certain attributes or Rules you might add are delayed by an Interpolation behaviour waiting to finish, then put them just before the Interpolates, leaving your Interpolate behaviours as last.)
--------
So here's your Rules in each of your numbers as graphics:
Rule: When Actor overlaps or collides with BaddyActor --when it collides, it triggers the following---
Change Attribute self.Color.Green to 0
Change Attribute self.Color.Blue to 0
---the above 2 change attributes changes the colour to Red as you want, placing the Red tint over your image, then carrying on below, the two interpolates changes them back to white again, over time that you require (in this case, 1 second)------
Interpolate self.Color.Green to 1 Duration:1
Interpolate self.Color.Blue to 1 Duration:1
--And that's all done until the next collision.
Hope I haven't gone overboard with my explanation again (I tend to do that); and that you understand now. :-)
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
Goodboi Gamestudios | Monster Jumper now on the App Store
Goodboi Gamestudios | Monster Jumper now on the App Store