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

0 favourites
  • 3 posts
From the Asset Store
20 high quality click sounds, ready to improve your game's UI instantly
  • 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!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

  • 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!

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