-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (38 loc) · 1.39 KB
/
Copy pathmain.py
File metadata and controls
44 lines (38 loc) · 1.39 KB
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
43
44
import pygame, sys
from classes import *
from process import process
# Made By ADM - Arindam Das Modak (IIT2016036 - IIIT Allahabad)
pygame.init()
SCREENWIDTH, SCREENHEIGHT = 640, 360
screen = pygame.display.set_mode((SCREENWIDTH, SCREENHEIGHT))
clock = pygame.time.Clock()
FPS = 24
total_frames = 0
background = pygame.image.load("images/forest.jpg")
bug = Bug(0,SCREENHEIGHT - 40,"images/bug2right.png")
while True:
process(bug,FPS,total_frames)
if Game.start:
bug.motion(SCREENWIDTH,SCREENHEIGHT)
#Fly.movement(SCREENWIDTH)
Fly.update_all(SCREENWIDTH,SCREENHEIGHT)
BugAttack.movement()
total_frames += 1
#screen.fill((255,0,200))
screen.blit(background,(0,0))
Fly.score(screen)
BaseClass.allsprites.draw(screen)
BugAttack.List.draw(screen)
pygame.display.flip()
else:
screen.fill((200,100,100))
font = pygame.font.SysFont(None, 40)
text = font.render("START ", True, (0,255,50))
screen.blit(text,(SCREENWIDTH/2,SCREENHEIGHT/2))
text = font.render("(Press SPACE)", True, (50,100,50))
screen.blit(text,(SCREENWIDTH/2 - 20,SCREENHEIGHT/2 + 60))
text = font.render("ADM", True, (0,0,0))
screen.blit(text,(SCREENWIDTH - 100,0))
Fly.score(screen)
pygame.display.flip()
clock.tick(FPS)