Is it possible to interpolate self image to an other image?
KIIVIIN
Member Posts: 159
Hello,
I tried to make that when my miningveins health is 0 that it interpolate the self image to its original image "EmptyVein"
But it dont work. The image appear blank / white. Anyone know if its even possible to interpolate one image set to the actor to a other one?
regards
Comments
What would you want to happen ?
I wounder if its possible to interpolate one image to another.
Lets say, interpolate self.image (An Apple) to image (Orange) for 1 sec.
Do I have to make 2 different rules?
Interpolate self.color.alpha to 0
When Alpha = 0 do Interpolate self image to Orange?
I thought I can interpolate the set image to an other image directly but that didnt work well
you can animate with interpolate is that what your looking for, heres a old video I made.
Not really what I ment.
Well the thing here is, I got mining function into my game. You can mine different veins like goldvein, adamantitevein etc.
When the "rock" vein is empty the original image appear as only a empty rock.
I want to interpolate the current vein to the empty vein in 1 sec.
So for instance if the player clicked the vein of gold 10 times its health is 0.
Then I want it to change the image to emptyvein but in a faded way like interpolate.
From this - interpolate to
This
Spawn the grey actor behind the gold actor then use an Interpolate to Fade the Alpha of the Gold actor to 0.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
But that will make the game to heavy if I have like 100 veins?
Is that really the best solution if I want the game as optimized as possible :P?
I try to make the vein fade for each click I make but I cannot as said figure how to interpolate as I wanted it to
Depending on how your game is set up I'd go with jamie_c's suggestion - otherwise you could create the fade as an animation and simply animate between the two images.
on contact.. change touched to touched+1. then if touched is greater than 3 change image to img2 greater than 5 ...change ore collected to collected+1 then destroy actor.
or use 3 images. 1 with alot of visible ore. 1 with half as much ore. 1 with no more ore visible. and make rules toward touched to touched +1. if touch is 3 change to img2 if 5 change to img3.
See the attached. Just this effect alone won't likely slow your game down. Of course other things in the game might, I can't speak for those. Click the gold to mine it...
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Okey, I will try my best and find a solution mixed up with some of your suggestions!
Else later on I will have to optimize it if needed.
Thank you for the help guys!
If you number your images say r1-r12 you can change the image based on a attribute that counts the number of times it was struck. This way you could have a series of images where each little nugget disappears until the Rock is grey.
So make a self attribute struck (integer)
Constrain attribute self.image to "r"..self.struck..".png"
Rule
When actor is struck (whatever your using)
Change attribute self.struck to self.struck+1
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS