Why my "btnGotoLevel2" button doesn't work? (Look the picture to help me out)

0 favourites
  • 7 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • Greeting Construct 2 users,

    Can someone explain to me why the event and action located within the red circle don't work? Look the picture to help me out. (Note that the event within the red circle is a sub-event) Thank you!

    Tagged:

  • Is the text "16" and has the other logic been actioned, such as does the audio turn off and are the objects destroyed? This problem is kind of hard to work out from the screenshot though, maybe you can share a file? Thanks

  • It looks like your mouse event is a sub event of the text is 16 condition check.This means the mouse click will only trigger when the text is equal to 16 and I'm not sure if that was your intention.

  • To rhg1968:

    Well to be more precise, after the text display the number "16" and after all the actions located at the right side of the picture are completed, I want the player to have the possibility to click the "btnGotoLevel2" button that will bring him on another layout.

  • To plinkie:

    I cannot give you the file. However, I can give you some precision:

    After the text display, the number "16" and after all the actions located at the right side of the picture are completed, I want the player to have the possibility to click the "btnGotoLevel2" button that will bring him on another layout.

  • WesleyDeveloper9

    That is not an ideal way to do structure your events.

    What will happen is that once the txtPlayerPoints is "16", all the actions will be executed every single tick while that condition is true (60 times a second). So, it will continuously try to stop playing tag 2, restart "Forever Believe" (all you will hear is a buzz), try to destroy the objects, and enable the button... while it is waiting for the player to click it.

    you should structure it so that the actions only execute once. One way to do that is to set a global variable "LevelOver" to 1.

    and move the button click code to the top level. You don't really have to have to check LevelOver on the button click because the button is disabled and invisible before points gets to 16, but it doesn't hurt.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To AllanR:

    Thank you AllanR! I use the code that you sent me and it works! Again thank you for your help!

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