Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Software Design Principle and Approach There was a popular mobile game called 'Flappy Bird' (Click the link to play the game). Here is a screen
Software Design Principle and Approach There was a popular mobile game called 'Flappy Bird' (Click the link to play the game). Here is a screen capture of the game. Now we would design a simplified version of the game, in which the bird is considered as a square with side length as 1. the pipe has a top position and a bottom position as shown in the picture, and the width of the pipe is 2. In every time unit, the bird drops by 1 space unit and the pipe moves leftward by 1 space unit. If you tap the screen of the mobile device, the bird will flap its wings and move up 1 space unit. Fly the bird as long as you can until it hits any pipes or goes beyond the height range of the screen, in which case the game is over. A new pipe will be generated immediately from the right end of the screen after the bird passes the old pipe. The pseudo code to initialize the game is given as follows: play a game birdPositionftop] = 5 birdPosition[bottom] = 4 birdPositionfleft] = 0 birdPositionfright] = 1 pipe[top] = 5 pipe[bottom] = 3 pipe[left] = 8 pipe[right] = 10 while (TRUE) PLAYING end play a game. The variables are defined as what their names imply. For example. birdPosition[top] is the top of the bird's position. Suppose both the height range and width range of the screen are [0, 10]. Answer the following questions. In the PLAYING module, what further functions/modules should be considered if we want to design the complete game? You can give simple names and provide brief comments for your functions/modules. Please write one line of pseudo code using the already-defined variables to check whether the game is over or not. Now we want to emphasize modularity which is an important software design principle. Please provide an architectural design of the game with "USES" relations, using your already-designed functions or modules. (Draw USES relations among the functions/modules whose names are identified.)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started