blob: f62150fc036df975b75ba6957424143fc213d8c5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import pygame
from constants import *
from circleshape import *
from player import *
def main():
pygame.init()
screen = pygame.display.set_mode((SCREEN_WIDTH, SCREEN_HEIGHT))
clock = pygame.time.Clock()
dt = 0
player = Player(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2)
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT or pygame.key.get_pressed()[pygame.K_q]:
return
screen.fill("black")
player.update(dt)
player.draw(screen)
pygame.display.flip()
dt = clock.tick(60) / 1000
if __name__ == "__main__":
main()
|