为什么我不能搞多个图像?

时间:2015-08-05 16:30:28

标签: python-3.x pygame

我真的很新。我只是想制作一些简单的游戏来开始学习。我收到错误:“语法无效”,只有“pygame”突出显示在我的代码底部“pygame.display.flip()”帮助!

import pygame
import time
import random

pygame.init()


display_width = 800         #sets width/height
display_height = 600

black = (0,0,0)             #sets colors
white = (255,255,255)
red = (200,0,0)
bright_red = (255, 0, 0)
sky_blue = (200, 230, 255)
green = (0, 200, 0)
bright_green = (0, 255, 0)
block_color = (53, 115, 255)

jet_width = 100            #sets jet width
BowserImgWidth = 100

gameDisplay = pygame.display.set_mode((display_width,display_height))  #sets surface name/size
pygame.display.set_caption('Bowser Hunter')
clock = pygame.time.Clock()

JetImg = pygame.image.load('FighterJet1.png')
BowserImg_1 = pygame.image.load('Bowser1.png')
BowserImg_2 = pygame.image.load('Bowser2.png')

gameLoop = True
while gameLoop:

    for event in pygame.event.get():

        if (event.type==pygame.QUIT):

            gameLoop=False

    gameDisplay.fill(black)

    gameDisplay.blit(JetImg,(380, 450))

    gameDiplsay.blit(BowserImg_1(100(100))

    pygame.display.flip()

pygame.quit()
quit()

1 个答案:

答案 0 :(得分:0)

您有很多语法错误。它应该是这样的:

<style type="text/css" scoped><!-- -->
   p{color:red;}
<!-- --></style>

如果查看代码,则参数之间有一个左括号。

你还拼写了gameDisplay:gameDiplsay。