Welcome Guest.

1Answers

Why can’t Python run

Asked by: Samuel Kelly 13 views IT August 4, 2022

Import Pygame

Import Sys

From ***. Locals Import *

From Random Import Randint

size = w, h = 600,400

FISH1_Speed ​​= [Randint (1,10), randint (1,10)]

Fish2_speed = [Randint (1,10 (1,10) ), randint (1,10)]

Fish3_speed = [randint (1,10), randint (1,10)]

class main:

DEF __init __ (SELF, SIZE):

***. Init ()

***. Screen = pygame. ***. set_mode ( size)

pygame. ***. set_caption ("Hello, this is the game: Turtle Eat Fish")

***. BG = (210, 210, 210)

DEF RUN_GAME (SELF):

While True:

for events in python. ***. get ():

if ***. Type == ***. Quit:

***. Exit ()

Self. ***. Fill (***. BG)

pygame. ***. Flip ()

if __name__ == "__main __":

setgo = main (SIZE)

***. Run_game ()

Can't be run or save it.

Addition: *** is pygame

Addition: *** is omitted before Noodles have already available things

1 Answers

  1. +5Votes  

    There are multiple errors in the program, and it is changed (I test the normal operation, but you want to install the Pygame library)

    Run results

    Jacqueline Rogers- August 4, 2022 |