GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Is it possible to interpolate self image to an other image?

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

  • SocksSocks London, UK.Posts: 12,822Member

    @KIIVIIN said:
    The image appear blank / white.

    What would you want to happen ?

  • KIIVIINKIIVIIN Posts: 159Member

    @Socks said:

    @KIIVIIN said:
    The image appear blank / white.

    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

  • BBEnkBBEnk Posts: 1,764Member

    you can animate with interpolate is that what your looking for, heres a old video I made.

  • KIIVIINKIIVIIN Posts: 159Member

    @BBEnk said:
    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

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,535Member

    Spawn the grey actor behind the gold actor then use an Interpolate to Fade the Alpha of the Gold actor to 0.

  • KIIVIINKIIVIIN Posts: 159Member

    @jamie_c said:
    Spawn the grey actor behind the gold actor then use an Interpolate to Fade the Alpha of the Gold actor to 0.

    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?

  • KIIVIINKIIVIIN Posts: 159Member

    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 :/

  • SocksSocks London, UK.Posts: 12,822Member

    @KIIVIIN said:
    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.

  • FINNBOGGFINNBOGG Posts: 1,809Member
    edited February 2016

    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.

  • jamie_cjamie_c ImagineLabs.rocks Posts: 5,535Member
    edited February 2016

    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...

  • KIIVIINKIIVIIN Posts: 159Member

    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!

  • The_Gamesalad_GuruThe_Gamesalad_Guru Posts: 9,906Member
    edited February 2016

    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

Sign In or Register to comment.