我想做的是
所以我基本上想做的是每次一辆车越过终点 它说哪辆车有一个但我想做的是每次第一辆车获胜并且第二辆车越过终点线我想要它说哪辆车排在第二位和第三位等等
import pygame, random
pygame.init()
# music
music = pygame.mixer.music.load(“image/Led Zeppelin - Rock And Roll (Alternate Mix) (Official Music Video).mp3”)
pygame.mixer.music.play(-1)
#Setting up our colors that we are going to use
GREEN = (20, 255, 140)
GREY = (210, 210, 210)
WHITE = (255, 255, 255)
RED = (255, 0, 0)
PURPLE = (255, 0, 255)
BLACKWHITE =(96, 96, 96)
SCREENWIDTH = 400
SCREENHEIGHT = 500
size = (SCREENWIDTH, SCREENHEIGHT)
screen = pygame.display.set_mode(size)
pygame.display.set_caption("Car Racing")
Icon = pygame.image.load("image/redca_iconr.png")
pygame.display.set_icon((Icon))
# This will be a list that will contain all the sprites we intend to use in our game.
#all_sprites_list = pygame.sprite.Group()
#player
playerIMG = pygame.image.load("image/red_racecar.png")
playerX = 250
playerY = 450
playerCar_position = 0
#player2
playerIMG_two = pygame.image.load("image/greencar.png")
playerX_two = 150
playerY_two = 450
playerCar_position_two = 0
#player3
playerIMG_three = pygame.image.load("image/Orangecar.png")
playerX_three = 50
playerY_three = 450
playerCar_position_three = 0
#player4
playerIMG_four = pygame.image.load("image/yellow_car.png")
playerX_four = 200
playerY_four = 450
playerCar_position_four = 0
#Putting cars to the screen
def player(x, y):
screen.blit(playerIMG, (x, y))
def player_two(x, y):
screen.blit(playerIMG_two, (x, y))
def player_three(x, y):
screen.blit(playerIMG_three, (x, y))
def player_four(x, y):
screen.blit(playerIMG_four, (x, y))
哈士奇WWW
UYOU
相关分类