Question

In: Computer Science

Python 1.Suppose you were going to design an event-driven application like the famous wack-a-mole game. Do...

Python

1.Suppose you were going to design an event-driven application like the famous wack-a-mole game. Do the following:
a) draw a mockup of the layout of the screen--this is usually easiest by hand. Submit a legible picture of your drawing.
b) List the events your game would have to respond to (such as when certain keys are pressed).

2.Explain why you should avoid using loops to repeat actions in a GUI application. What should you do instead?

Solutions

Expert Solution

Wack-a-mole game:

1) a) Design Mockup:

Tool Used: MS Powerpoint.

1) b) Game Events:

i) <Button> : Mouse button press ( To hit the mole )

ii) <Motion> : Mouse is moved over the platform to reach out to different mole burrows.

iii) <ButtonRelease> : When button is released after hammer hit the mole burrow, this will move hammer back to its original state.

iv) <Leave> : When mouse pointer leave the widget and the focus is no longer on the game board.

2) Why avoid using loops to repeat actions in a GUI application? :

The main reason why there is a need to avoid loops in a GUI oriented application is that it may result in slowness of code as the compiler will be busy with loop intensive code and the game player may miss an event or have a delayed response to the event triggered which ultimately will result in a bad game/GUI user experience. Adding to this Python is not a very fast executing language which again boils down to the fact that the user experience will be impacted if the code is loop intensive.

A feasible solution to overcome the loop issues in code is Profiling which is a set of statistics that mentions how frequently and for how long certain parts of the program are executed.


Related Solutions

This lab is designed to design an event driven animation application which JavaFX application implementing a...
This lab is designed to design an event driven animation application which JavaFX application implementing a racing car image. The car moves from left to right. When it hits the right end, it restarts from the left and continues the same process. Let the user pause/resume the animation with a button press/release and increase/decrease the car speed by pressing the up and down arrow keys. The car used for this application has the following attributes. Task(s) Task 1: Create a...
In python please: You’re going to program a simulation of the following game. Like many probability...
In python please: You’re going to program a simulation of the following game. Like many probability games, this one involves an infinite supply of ping-pong balls. No, this game is "not quite beer pong." The balls are numbered 1 through N. There is also a group of N cups, labeled 1 through N, each of which can hold an unlimited number of ping-pong balls (a;ll numbered 1 through N). The game is played in rounds. A round is composed of...
In python 3.7: You’re going to program a simulation of the following game. Like many probability...
In python 3.7: You’re going to program a simulation of the following game. Like many probability games, this one involves an infinite supply of ping-pong balls. No, this game is "not quite beer pong." The balls are numbered 1 through N. There is also a group of N cups, labeled 1 through N, each of which can hold an unlimited number of ping-pong balls (all numbered 1 through N). The game is played in rounds. A round is composed of...
In an event-driven program, you design the screens, define the objects, and define how the screens...
In an event-driven program, you design the screens, define the objects, and define how the screens will connect. Within an event-driven program, a component from which an event is generated is the source of the event. Other than changes to the planning stage, how is the development of an event-driven program different from that of a procedural program? How would a programmer create a plan for an animation?
Explain this python program as if you were going to present it to a class in...
Explain this python program as if you were going to present it to a class in a power point presentation. How would you explain it? I am having a hard time with this. I have my outputs and code displayed throughout 9 slides. #Guess My Number Program # Python Code is modified to discard duplicate guesses by the computer import random #function for getting the user input on what they want to do. def menu(): #print the options print("\n\n1. You...
A game design document is used to develop an actual game. I would like you to...
A game design document is used to develop an actual game. I would like you to be disciplined from the start and build a document that you shall use later to build your final project. However, please note that a game design document is a living document. Therefore, you are allowed to change the game design document according to the progress made in the later modules. Most of game designers know that larger the design team, the better the document....
Suppose you are responsible for a project to build an application that is going to collect...
Suppose you are responsible for a project to build an application that is going to collect all the training opportunities for any summer training program. The purpose of the application is to allow the user to search for the most suitable opportunity for him using different search criteria such as GPA and salary. How you would make a Risk Management plan for such a project? I want a Risk Management plan for this project. thanks.
Let’s suppose that you are going to play the lottery game Powerball. To play, you pick...
Let’s suppose that you are going to play the lottery game Powerball. To play, you pick five different numbers from 1 through 69 plus one Powerball number from 1 through 26. Which is a more likely combination of winning numbers: 1, 2, 3, 4, 5, 6 or 7, 21, 25, 32, 40, 56? Explain your answer. For a $500,000,000 jackpot, which of the two combinations would likely be more lucrative for you if it were to win? In other words,...
Suppose we are going to play a game. You have to choose to toss a coin...
Suppose we are going to play a game. You have to choose to toss a coin either 40 times or 400 times (pretend you have a lot of time on your hands!). You win the game if the percentage of heads is between 52.5% and 57.5%.
1. You are required to design a VoIP application. Discuss the requirements for such an application...
1. You are required to design a VoIP application. Discuss the requirements for such an application in terms of its protocols and performance requirements. What types of protocols you would need to design a complete VoIP application (Hint: real time streaming protocols and signaling protocols, etc.)? [5marks] 2. Discuss the architecture of WhatsApp in terms of its protocols. Address and discuss all the essential protocols used by WhatsApp for communication. [5 Marks]
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT