subject

what is the string of code to make a variable change pls make this into this code, this is pygame btw import pygame import time pygame. init() screen = pygame. display. set_mode([800,600]) keep_going = True WHITE = (255,255,255) BLACK = (0,0,0) BALL_SPEED_X = 5 BALL_SPEED_Y = 5 score = 0 # ball variables posx = 100 posy = 100 speedx = BALL_SPEED_X speedy = BALL_SPEED_Y radius = 14 #paddle variables paddley = 300 paddlex = 1 paddle_length = 100 paddle_speed = 5 while keep_going: for event in pygame. event. get(): if event. type == pygame. QUIT: keep_going = False # ball movement posx += speedx posy += speedy if posx - radius paddley + paddle_length/2) or (posy = 1: print(" You Lose!") exit() speedx = BALL_SPEED_X speedy = BALL_SPEED_Y posx = paddlex + 10 posy = int(paddley) else: speedx = -speedx elif posx + radius >= 800: speedx = -speedx elif posy - radius = 600: speedy = -speedy # paddle movement if paddley - paddle_length/2 = 600: paddley = 599 - paddle_length/2 else: key_object = pygame. key. get_pressed() if key_object[pygame. K_UP]: paddley -= paddle_speed elif key_object[pygame. K_DOWN]: paddley += paddle_speed # draw the screen elements screen. fill(BLACK) pygame. draw. circle(screen, WHITE, (posx, posy), radius) pygame. draw. rect(screen, WHITE, (paddlex, paddley - paddle_length/2, 5,paddle_length)) pygame. display. update() # slow things down time. sleep(0.02) pygame. quit()

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 09:00, 19elbatawisaly
What is one way in which tablets differ from laptops and notebooks? tablets are designed for touch-based interaction. tablets are designed to be used as desktops. tablets are designed for input via a keyboard and mouse. tablets are designed to be larger than laptops.
Answers: 1
image
Computers and Technology, 23.06.2019 01:40, hanjonez
Writing a modular program in visual c++. i am new to this and not sure what i am missing. i am getting the following error: baddate. cpp: in function ‘int main()’: baddate. cpp: 50: 3: error: ‘else’ without a previous ‘if’elsehere are the instructions and code: writing a modular program in c++in this lab, you add the input and output statements to a partially completed c++ program. when completed, the user should be able to enter a year, a month, and a day. the program then determines if the date is valid. valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.notice that variables have been declared for you. write the simulated housekeeping() function that contains the prompts and input statements to retrieve a year, a month, and a day from the user. include the output statements in the simulated endofjob() function. the format of the output is as follows: month/day/year is a valid date. ormonth/day/year is an invalid date. execute the program entering the following date: month = 5, day = 32, year = 2014. record the output of this program. execute the program entering the following date: month = 9, day = 21, year = 2002. record the output of this /* program name: baddate. cppfunction: this program determines if a date entered by the user is valid. input: interactiveoutput: valid date is printed or user is alerted that an invalid date was entered*/#include bool validatedate(int, int, int); using namespace std; int main(){// declare variablesint year; int month; int day; const int min_year = 0, min_month = 1, max_month = 12, min_day = 1, max_day = 31; bool validdate = true; // this is the work of the housekeeping() method// get the year, then the month, then the daycout< < "enter the year"< > year; cout< < "enter the month"< > month; cout< < "enter the day"< > day; // this is the work of the detailloop() method// check to be sure date is validif(year < = min_year) // invalid yearvaliddate = false; else if (month < min_month || month > max_month) // invalid monthvaliddate = false; else if (day < min_day || day > max_day) // invalid dayvaliddate = false; // this is the work of the endofjob() method// test to see if date is valid and output date and whether it is valid or notif(validdate == true); {// output statementcout<
Answers: 1
image
Computers and Technology, 23.06.2019 06:30, Zieken993
Martha is designing a single-player game. her manager suggests that she plan the design to incorporate future modifications. which principle of game design relates to planning for future modifications?
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, powellmj9216
Spoons are designed to be used for: spring hammering. applying body filler. identifying high and low spots. sanding highly formed areas.
Answers: 3
You know the right answer?
what is the string of code to make a variable change pls make this into this code, this is pygame bt...

Questions in other subjects:

Konu
Mathematics, 05.05.2020 15:12
Konu
Mathematics, 05.05.2020 15:12
Konu
German, 05.05.2020 15:12
Konu
Mathematics, 05.05.2020 15:12
Konu
Mathematics, 05.05.2020 15:12
Konu
Mathematics, 05.05.2020 15:12