import pygame from pygame.locals import * pygame.init() screen_width = 1000 screen_height = 1000 screen = pygame.display.set_mode((screen_width, screen_height)) pygame.display.set_caption('Platformer') #define game variables tile_size = 200 #load images sun_img = pygame.image.load('sun.png') bg_img = pygame.image.load('sky.png') def draw_grid(): for line in range (0, 6): pygame.draw.line(screen, (255, 255, 255,) (0, line * tile_size), (screen_width, line * tile_size)) pygame.draw.line(screen, (255, 255, 255,) (line * tile_size 0), (line * tile_size, screen_height)) class World(): def __init__(self, data): #load images dirt_img = pygame.image.load('dirt.png') for row in data: for tile in row: if tile == 1: img = pygame world_data = [ [1, 1, 1, 1, 1], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1], [1, 0, 0, 0, 1], [1, 1, 1, 1, 1], ] run = True while run: screen.blit(sun_img (100, 100)) screen.blit(bg_img, (0, 0)) draw_grid() for event in pygame.event.get(): if event.type == pygame.QUIT: run = False pygame.display.update() pygame.quit()