Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with problem 6 Install pygmies using pip (see Assignment 2 for a reminder on how to use pip). Run the code below
I need help with problem 6
Install pygmies using pip (see Assignment 2 for a reminder on how to use pip). Run the code below that draws a blue rectangle near the top of a window. Listing 3: Starlight Star bright. import pygame, sys #initializes video pygame init() #sets the screen size screen = pygame. display. set_mode((400, 400)) while (1): for event in pygame. event. get(): if event. type == pygame. QUIT: sys. exit() #draws a rectangle on screen with color (r, g, b) at loc (x, y) of width leftarrow w, height h. pygame. draw. rect(screen, (0, 128, 255), pygame. Rect(10, 10, 30, 20)) pygame. display. flip() Add code to draw a green (0, 255, 0) rectangle at (100, 100) that is 40 times 30 pixels. Put your code for this problem in a new module named MyGame.pyStep 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