Question: 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.py
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
