Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am stuck with the next part of my code. Which is writing the main function Part 4: Create the main() function Write a function

I am stuck with the next part of my code. Which is writing the main function

Part 4: Create the main() function Write a function named main() that completes the following tasks:

Call the function that creates the Game Control graphics window dont forget to assign the Graphics objects it returns to variables

Call the function that creates the GoldHunt graphics window assigning the Graphics objects it returns to variables

Using a while loop, the main() function should repeat until a mouse click is detected on the EXIT control in the Game Control graphics window

After the while loop ends, close all graphics windows

So far my code is:

from graphics import * def gameControl(): win = GraphWin(" GameControl", 250, 200) win.setBackground('Light Grey') NewGame = Rectangle(Point(5,125), Point(100,190)) Exit = Rectangle(Point(200,125), Point(245,190)) box3= Rectangle(Point(0,0), Point(250,30)) NewGame.setFill('Gold') NewGame.draw(win) Exit.setFill('Black') Exit.draw(win) box3.setFill('Black') box3.draw(win) Text1=Text(Point(50,160), "NEW GAME") Text2=Text(Point(225,160), "EXIT") Text3=Text(Point(125,15), "BOILER GOLD HUNT!") Text4=Text(Point(125,50), "PLAYER NAME") Text1.setFill('Black') Text1.draw(win) Text2.setFill('White') Text2.draw(win) Text3.setFill('Gold') Text3.setStyle('bold') Text3.draw(win) Text4.setFill('Black') Text4.draw(win)

Name=Entry(Point(125,80),10) Name.draw(win) return (Name, NewGame, Exit, win) gameControl()

def BoilerGoldHunt(): window= GraphWin("GoldHunt", 480,520) rec1= Rectangle(Point(0,0), Point(480,40)) rec1.setFill('Black') rec1.draw(window) TextRound=Text(Point(40,20), "Round:") TextClick=Text(Point(400,20), "Clicks:") TextRound.setFill('Gold') TextRound.draw(window) TextClick.setFill('Gold') TextClick.draw(window) return(TextRound, TextClick, window) BoilerGoldHunt()

def main():

Thank you!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

Describe the scale of redistribution in the United States.

Answered: 1 week ago

Question

=+Who should be recruited?

Answered: 1 week ago

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago