Skip to content

Racing game #19

@krisu29

Description

@krisu29

import pygame
import random

Initialize pygame

pygame.init()

Screen dimensions

WIDTH = 800
HEIGHT = 600

Colors

WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)

Create the screen

screen = pygame.display.set_mode((WIDTH, HEIGHT))
pygame.display.set_caption("KR$HNA")

Load Krishna car (rectangle used here, image can be added)

KRISHNA_WIDTH = 50
KRISHNA_HEIGHT = 100
krishna_x = WIDTH // 2
krishna_y = HEIGHT - KRISHNA_HEIGHT - 20
krishna_speed = 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions