Text not showing after game restart

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Hello everyone :)

    Downloaded Construct and started to work on my very first game :))

    It is going pretty well but there is one problem I have.

    Made text box on layer which is for score and made global variable Score.

    It is working great. On event sheet made under every tick to display

    "Score: " & Score.

    When game ends it goes to layer menu and when game starts again added under on start of layout to reset global variables. And that works too since have lives too so I know.

    Added condition when lives = 0 to show game over and go to menu. So when start game again you can play since global variables are resetted BUT cant see Score : Lives : :(

    So only when start game for first time player can see score and lives, when play again cant see them.

    Anyone know why is that? :)

  • I can't say I know what's going on without seeing your capx, but make sure the text box size isn't changing or, if you're creating it at start of layout, be sure to set the text box to the right size. If the text box is too small, it won't show anything.

  • Hello, thx for reply :)

    Caps is too huge to post since game is almost finished but I can explain here. For example added text Game Over which is invisible.

    Added condition when lives = 0 text "Game over" fade in and become visible, that works every time, tried to play 3 times in a row and it shows every time.

    But score and lives shows only for first time when player plays a game. So it does show and when game ends, after game over text it goes to menu. when start again you cant see score and lives, its pretty weird.

    So have 2 layers, game and menu.

    On game layer regarding text is like this:

    On start of layout : set visible (for both score and lives)

    When game ends (lives :0)

    Lives = 0

    Trigger once : Stop all sounds

                   (Game over text) set visible

                   wait 5 seconds

                   go to menu

                   set cursor to normal (since its only crosshair when game start)

    Under menu made this:

    On start of layout: Text (both score and lives) set invisible

                        Reset global variables to default

    And all works fine, you play a game, can see score and lives when ends game over pops up and go in main menu. There you cant see score and lives since I set them to invisible. Resetted global variables so when player starts new game it have 3 lives again and can play. That works fine too but cant see Score and Lives. They are visible only first time when player plays. It is pretty weird. :)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tinypic.com/view.php

    Maybe this will help :)

    As you can see under every tick cursor is becoming crosshair and that works fine, even when game ends, player starts new game it turns into crosshair again. Should work for text too, deleted all effects, only text visible from start, added matrix mode, slow motion :) So now have 3 but still the same. They are not visible when player start another game. :(

  • Finally solved it :)

    Messed somewhere with layers, not sure what exactly, added new layer HUD, put Score and Lives there and now works no matter how many times games is played. :)

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