2020-03-28 03:43:12 +01:00
|
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
|
|
|
|
### Tangled Mind
|
|
|
|
### Author: Arthur 'Grizzly' Grisel-Davy
|
|
|
|
|
|
|
|
import pygame
|
2020-03-28 20:56:52 +01:00
|
|
|
|
2020-03-29 23:17:04 +02:00
|
|
|
from models import Perso
|
2020-04-11 06:17:49 +02:00
|
|
|
|
2020-03-28 03:43:12 +01:00
|
|
|
pygame.init()
|
|
|
|
|
|
|
|
|
2020-03-28 20:56:52 +01:00
|
|
|
screen_width = 1200
|
2020-03-28 03:43:12 +01:00
|
|
|
screen_height = 800
|
|
|
|
screen = pygame.display.set_mode((screen_width, screen_height))
|
|
|
|
done = False
|
|
|
|
|
|
|
|
|
2020-04-04 06:11:34 +02:00
|
|
|
BACKGROUND=(200,200,200)
|
2020-03-28 03:43:12 +01:00
|
|
|
WHITE=(255,255,255)
|
|
|
|
BLUE=(0,0,255)
|
2020-03-28 20:56:52 +01:00
|
|
|
RED=(255,0,0)
|
2020-03-28 03:43:12 +01:00
|
|
|
|
2020-04-11 06:17:49 +02:00
|
|
|
perso = Perso('Alice',200,200,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d,pygame.K_SPACE,'perso1','canon.png','projectile1')
|
|
|
|
|
2020-03-28 03:43:12 +01:00
|
|
|
|
2020-04-11 06:17:49 +02:00
|
|
|
clock = pygame.time.Clock()
|
2020-03-28 03:43:12 +01:00
|
|
|
|
|
|
|
while not done:
|
|
|
|
for event in pygame.event.get():
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
done = True
|
|
|
|
|
2020-04-11 06:17:49 +02:00
|
|
|
|
2020-03-28 03:43:12 +01:00
|
|
|
keystate = pygame.key.get_pressed()
|
2020-04-11 06:17:49 +02:00
|
|
|
perso.check_keys(keystate,screen_width,screen_height)
|
2020-03-28 20:56:52 +01:00
|
|
|
|
2020-03-28 03:43:12 +01:00
|
|
|
|
|
|
|
screen.fill(BACKGROUND)
|
2020-04-11 06:17:49 +02:00
|
|
|
perso.draw(screen)
|
|
|
|
pygame.display.flip()
|
|
|
|
|
|
|
|
|
|
|
|
clock.tick(30)
|
|
|
|
|