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.

52 lines
1.2 KiB
Python

# -*- coding: UTF-8 -*-
### Tangled Mind
### Author: Arthur 'Grizzly' Grisel-Davy
import pygame
from models import Game, Perso, Carte, Camera, Enemy
pygame.init()
screen_width = 1200
screen_height = 800
center_screen = (int(screen_width/2),int(screen_height/2))
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)
carte = Carte('map1')
# possible positions: 300,300: 1400,1000: 2700,400, 2800,1600
# click = 323
perso = Perso('Alice',660,1570,center_screen,pygame.K_z,pygame.K_s,pygame.K_q,pygame.K_d,323,'perso.png','canon.png','projectile1_right.png')
camera = Camera(660,1570,screen_width,screen_height,0.3)
enemies = [Enemy('Plop',(300,300),'perso.png')]
game = Game(carte,perso,camera,enemies)
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() + pygame.mouse.get_pressed()
perso.check_keys(keystate,screen_width,screen_height,carte,camera)
screen.fill(BACKGROUND)
game.draw(screen)
pygame.display.flip()
clock.tick(60)