Godot Version
4.4
Question
Hi! Just starting out and I am messing with the ‘Pong with GDScript Demo’. I am trying to learn small stuff by adding the ability to not start the game or start each round until the user presses Enter. I am having a hard time figuring out how to add this. Any advice?
You can use process modes in order to pause some nodes while still be able to unpause the game. Or you can put logic that returns from the functions that run the game if the player hasn’t pressed enter yet.
For detecting when the player presses enter, you can use the _input function. Like:
func _input(event):
if event.is_action_pressed("start_level"):
# do something
You’ll need to add an action called “start_level” to the InputMap in project settings, though.
2 Likes