Change Opacity

0 favourites
  • 6 posts
From the Asset Store
Simplistic hyper-casual game with nature elements. Tap to switch between the 4 elements and reach a better score.
  • Hello all

    I'm stuck with this:

    I need when player on collision with (A), The layer opacity go up from 0 to 90 (1 every second) , when it reach 90 the player die.

    When the above event working, If the player on collision with (B), The opacity stop go up and start go down until it reach 0.

    I've created a complex event with global variable but when the player die and the system load the game the event stop working, so i'm searching for better solution.

    Thank's for any help

  • You might want to post a stripped down .capx of your problem, that way people could take a better look..

  • slanw, would you mind share some code (or psuedo-code)? It may be easier that way to determine what is wrong rather than guessing. And, can you please be more specific on how your game "stops working"? Maybe there was a global/static variable that you didn't reset when the game started?

    My first idea for how I would do this is to add an instance variable to player for health. Then, I would put two conditions in the event: 1) On collision, 2) Every 1 second. And then, the actions would change opacity and instance variable value.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, it seems it works at first, than you restart the layout and it stops working.

    [quote:3va9xueo]I've created a complex event with global variable but when the player die and the system load the game the event stop working, so i'm searching for better solution.

    Maybe your Global Variable is keeping its value between sessions.

    Put a "On start of layout" condition and reset the value of that variable, if I understood it right, it might work.

  • Thank's all

    I know now what's wrong : i'm using save-load system, and my game is long platform game not level game.

    So if the player die, he will go back to the last check point and the global variable will not reset.

    I need all the global and instance variable and the object's to reset if the player die.

    Any help??

  • System Action reset all global variables

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)