You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
955 B
Python

# -*- coding: UTF-8 -*-
### Tangled Mind
### Author: Arthur 'Grizzly' Grisel-Davy
import pygame
from models import perso
pygame.init()
screen_width = 1200
screen_height = 800
screen = pygame.display.set_mode((screen_width, screen_height))
done = False
BACKGROUND=(0,0,0)
WHITE=(255,255,255)
BLUE=(0,0,255)
RED=(255,0,0)
perso1 = perso('Alice',200,200,50,50,RED,pygame.K_o,pygame.K_l,pygame.K_k,pygame.K_m)
perso2 = perso('Bjorn',600,600,50,50,BLUE,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d)
speed = 1
while not done:
for event in pygame.event.get():
if event.type == pygame.QUIT:
done = True
keystate = pygame.key.get_pressed()
perso1.check_move(keystate,screen_width,screen_height,speed)
perso2.check_move(keystate,screen_width,screen_height,speed)
screen.fill(BACKGROUND)
perso1.draw(screen)
perso2.draw(screen)
pygame.display.flip()