2.2.11 Cycle 11 - Add Pause Menu

Design

Objectives

In this cycle I aim to add a pause menu which can be brought up with the press of a button or through a key on the keyboard. The user should also be able to click away from the pause menu and then resume playing seamlessly.

Usability Features

Key Variables

Variable Name
Use

pause_label

This is the button on screen the user can press to bring up the menu.

menu

This is the menu sprite that will come up and be displayed central on the screen.

paused

This is a boolean value that tells the game when it is and isn't paused.

Pseudocode

procedure create
    pause label = new text (Pause, top right)
    pause label enable input
    if pause label is pressed
        paused = true
        menu = new sprite (middle of screen)
        choice label = new text (middle of screen)
end procedure

procedure unpause
    if game is paused 
        choices = [0,1,2,3,4,5]
        selection = position of choices
        choice text = "You chose: " choice
        kill menu
        paused = false
end procedure

Development

Outcome

Challenges

I found it challenging for the pause menu button to come up on screen and this was irritating as this was the main intended way for the player to pause.

Testing

Evidence for testing

Tests

Test
Instructions
What I expect
What actually happens
Pass/Fail

1

Press the 'pause' button in the top right

The menu should come up with a range of different

The pause button doesn't show

Fail

Evidence

Unfortunately I ran out of time to be able to fully implement this feature, however I would like to try and add this to the game after the project has finished.

Last updated