uml activity diagrams
Start 1. Place the butterfly at the starting position in the maze. 2. Initialize the player’s score, butterfly health, and timer. 3. Display a welcome message to the player. 4. While the game is active: • Wait for the player’s input to move the butterfly. • If the player presses the “up” arrow key, then: Move the butterfly one step up. Check if the butterfly reaches the green button at the end of the maze. • If the player presses the “down” arrow key, then. Move the butterfly one step down. Check if the butterfly reaches the green button. • If the player presses the “left” arrow key, then. Move the butterfly one step to the left. Check if the butterfly reaches the green button. • If the player presses the “right” arrow key, then. Move the butterfly one step to the right. Check if the butterfly is one step to the right. • Update the timer, score, and display them. • Check if the butterfly’s health reaches zero or the timer runs out. If so, end the game. • If the player reaches the green button, then end the game.