How do I start the game on a keypress after a gameover?

Get help using Construct 2

Post » Wed Jul 06, 2016 12:33 am

Hiya folks,

In game that I'm working on, I'm having trouble getting the enter key to work after the player triggers a game over.

For context:
When the player starts the game they first see the title screen. Upon pressing enter the player is taken to the game screen. Here, they would then press enter one last time to start the game. After getting a game over, the player is taken to the game over screen where they are prompted to press enter to return to the title screen. should the player decide to play the game again they would follow the prompts like the first time and be taken to the game screen. This time around however, the game is not recognizing any inputs from the player.

Here are some methods I've tried to combat the problem:
- forcibly re-initiate the keyboard plugin when the game starts over.
- change where the start game call is initiated by essentially creating a boolean statement (isRunning).
- abstract the behaviors to functions and place calls in different areas to try and identify where the problem is happening.

I've attached some executable files for context and the .capx file for anyone who wishes to view the code associated with the problem.

Executables
.capx file

Many thanks in advance!
B
14
S
5
G
5
Posts: 21
Reputation: 4,024

Post » Wed Jul 06, 2016 2:44 am

So after some prodding I think I've traced the problem down to the Ball Sheet. The "ball collides with scoreline" event has a "Wait 5 sec" action. Problem is the layout switches to the Game Over layout before the 5 sec are up, so the event group Interactions (which contains the trigger for pressing Enter) gets disabled but is never re-enabled.
B
49
S
23
G
17
Posts: 291
Reputation: 12,407

Post » Wed Jul 06, 2016 4:05 am

Sup with that? wrote:So after some prodding I think I've traced the problem down to the Ball Sheet. The "ball collides with scoreline" event has a "Wait 5 sec" action. Problem is the layout switches to the Game Over layout before the 5 sec are up, so the event group Interactions (which contains the trigger for pressing Enter) gets disabled but is never re-enabled.


Well whaddaya know! Thanks for spotting that discrepancy!
B
14
S
5
G
5
Posts: 21
Reputation: 4,024


Return to How do I....?

Who is online

Users browsing this forum: Apollo14, Exabot [Bot], MaujDeveloper, totoe and 5 guests