Create a Python program that can do the following -Have an object that moves horizontally from one side of the screen to the other.The object should have the option to have the colour, size, speed,...

1 answer below »
Create a Python program that can do the following -Have an object that moves horizontally from one side of the screen to the other.The object should have the option to have the colour, size, speed, and shape changed via a gui menu on the screen.When setting up those variables (size, shape, colour, speed) of the object, there should also be an option to save the settings in a text file.The gui menu should be on the main screen, but also fade after the program is run (the object starts moving)
Answered 9 days AfterMar 30, 2021University of Queensland

Answer To: Create a Python program that can do the following -Have an object that moves horizontally from one...

Kamal answered on Apr 08 2021
140 Votes
import pygame
# initiate pygame
pygame.init()
# initiate surface dimension
win = pygame.display.
set_mode((500, 500))
# set the name
pygame.display.set_caption("Moving Object")
# co-ordinates
x = 200
y = 200
# initiate object dimension
width = 20
height = 20
# velocity
vel = 10
# "pygame is running" is true
run = True
while run:
    
    pygame.time.delay(10)
    
    # iterate over the list of event...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here