Text not showing after game restart

Discussion and feedback on Construct 2

Post » Tue Sep 03, 2013 2:42 pm

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? :)
B
1
Posts: 4
Reputation: 133

Post » Tue Sep 03, 2013 3:11 pm

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.
B
103
S
38
G
19
Posts: 962
Reputation: 17,996

Post » Tue Sep 03, 2013 3:24 pm

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. :)longoRI2013-09-03 15:25:31
B
1
Posts: 4
Reputation: 133

Post » Tue Sep 03, 2013 4:40 pm

http://tinypic.com/view.php?pic=2eduu7t&s=5

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. :(
longoRI2013-09-03 16:43:17
B
1
Posts: 4
Reputation: 133

Post » Tue Sep 03, 2013 8:49 pm

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. :)
B
1
Posts: 4
Reputation: 133


Return to Construct 2 General

Who is online

Users browsing this forum: adelwich, Yahoo [Bot] and 23 guests