45 lines
No EOL
888 B
Python
45 lines
No EOL
888 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=(200,200,200)
|
|
WHITE=(255,255,255)
|
|
BLUE=(0,0,255)
|
|
RED=(255,0,0)
|
|
|
|
perso = Perso('Alice',200,200,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d,pygame.K_SPACE,'perso1','canon.png','projectile1_right.png')
|
|
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
while not done:
|
|
for event in pygame.event.get():
|
|
if event.type == pygame.QUIT:
|
|
done = True
|
|
|
|
|
|
keystate = pygame.key.get_pressed()
|
|
perso.check_keys(keystate,screen_width,screen_height)
|
|
|
|
|
|
screen.fill(BACKGROUND)
|
|
perso.draw(screen)
|
|
pygame.display.flip()
|
|
|
|
|
|
clock.tick(60)
|
|
|