-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (31 loc) · 835 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import pygame
import event
from classes import *
pygame.init()
pygame.mixer.init()
width, height = 640, 400
screen = pygame.display.set_mode((width, height), 0, 32)
clock = pygame.time.Clock()
fps = 26
total_frames = 0
roi = Roi(0, 349, 'images/roi.PNG')
bg = pygame.image.load('images/bg.jpg')
# Music negros !!
pygame.mixer.music.load('theme.ogg')
pygame.mixer.music.play()
while True:
event.check_theme()
event.process_events(roi)
event.spawn(fps, total_frames)
event.handle_collisions()
# Logic
roi.motion(width, height)
Booba.update_all(width, height)
RoiSpit.movement()
total_frames += 1
# Draw
screen.blit(bg, (0, 0))
BaseClass.allSprites.draw(screen)
RoiSpit.spits.draw(screen)
pygame.display.flip()
clock.tick(fps)