Skip to content

Pause Menu

Handles game pausing/unpausing and features an animated 3D chicken character, dynamic button visibility, smooth transitions, and focus handling.

Key Components:

  • PauseMenu.gd: Main controller script
  • pause_menu.tscn: Scene container
PropertyTypeDescription
chickenNode3DThe 3D chicken character to animate during paused state
cameraCamera3DGame camera to adjust during pause animations
footerPanelContainerBottom menu panel that slides in (not used)
game_logo_containerMarginContainerLogo container with hover effects
pausedboolControls pause state with setter logic
prev_mouse_modeInput.MouseModeStores previous mouse mode before pausing

pause menu

NodeTypeDescription
ResumeButtonUnpauses the game
SettingsButtonOpens the settings ui
QuitButtonReturns to main menu
ForfeitButtonForfeits the fight and returns to poultryman menu
var paused: bool:
set(value):
paused = value
visible = value
get_tree().paused = value
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE if value else prev_mouse_mode
if value:
get_parent().move_child(self, get_parent().get_child_count() - 1)
_set_button_visibility()

Behaviour:

  • Freezes the whole scene tree when paused, except itself. Since this node’s process mode is set to PROCESS_MODE_ALWAYS, it will never get paused in the scene tree.
  • Handles mouse visibility when paused and unpaused.
  • Ensures this menu is always on top of other UI’s.
  • Updates the button visiblity dynamically.
func _input(event: InputEvent) -> void:
if Input.is_action_just_pressed("pause"):
if not paused:
prev_mouse_mode = Input.mouse_mode
paused = not paused
if paused:
_squish_chicken()
resume_button.grab_focus()

Key Features:

  • Toggles pause on pause action in the input mappings. (default key is ESC)
  • Preserves the previous mouse mode before entering this node.
  • Auto-focuses on the resume button.
  • Triggers the 3d chicken animation when entering this node.
UsageHexSample
button normal font#bebcbe Sample
button hover font#878085 Sample
button focus font#878085 Sample
button pressed font#eae7dc Sample
button normal bgtransparent Sample
button hover bg#cccbc7 Sample
button focus bg#cccbc7 Sample
button pressed bg#262520 Sample
ElementFontSize
buttonFrost Scream36px
  1. Player presses pause button
  2. Game freezes (physics/process stops)
  3. Menu appears with animation
  4. Player selects option
  5. Menu closes with animation
  6. Game resumes
  • Uses SignalManager to switch interfaces
  • Uses TweenManager for animations