Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- #Need to now import Random
- import random
- pygame.init()
- #General Variables
- running = True
- window = pygame.display.set_mode((400,600))
- clock = pygame.time.Clock()
- #New Variables
- randx = random.randrange(0, 300)
- randy = 0
- score = 0
- pygame.display.set_caption('Race car')
- class car(pygame.sprite.Sprite):
- def __init__(self,location):
- pygame.sprite.Sprite.__init__(self)
- self.image = pygame.image.load('racecar.png').convert_alpha()
- self.x_change = 0
- self.x = 370
- self.y = 430
- car1 = car([370,430])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement