Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

help me to find the syntax error and how to correct it

0 votes
asked Oct 21, 2018 by tila
pygame.init()

# create the canvas object
# here we pass it a size of 800x600
canvas = pygame.display.set_mode((800, 600))

scene = pygame.Surface(canvas.get_size())
scene.fill((0, 0, 0))

f15 = Jet()
exocet  = Missile()

container = pygame.sprite.Group().   # create an instance of class Group
container.add(f15,exocet)                       # add  f15 and exocet object in the container        

running = True

while running:
    for event in pygame.event.get():
         if event.type == KEYDOWN:
             if event.key == K_ESCAPE:
                 running = False
         elif event.type == QUIT:
             running = False
        
     canvas.blit(scene, (0, 0))
 
     container.update()   
     container.draw(canvas)

     pygame.display.flip()

1 Answer

0 votes
answered Jan 23, 2019 by Ryan (1,230 points)
Your first mistake would be that in order to use pygame, you have to first import the pygame module. You also seem to be making calls to Jet() and Missle() without any definitions. If the definitions are in modules you have written, you need to import those also.
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...