Skip to content
Snippets Groups Projects
Commit e0d1b702 authored by Mohannad Alaya's avatar Mohannad Alaya
Browse files

CTF_Done

parent baa2bbc1
Branches
Tags
No related merge requests found
import pygame
import pymunk
from pygame.locals import *
from pygame.color import *
import images
font1 = pygame.font.SysFont('Corbel',20)
font2 = pygame.font.SysFont('Corbel',35)
white = (255,255,255)
def print_stats_time(screen,var, current_map):
""" Print the current time left on the game screen. """
text1 = font1.render("Time left:"+str(((1800*5-var)//60)) , True , white)
screen.blit(text1, (current_map.width*40+18,current_map.height*18))
def print_counting_score_console(tanks_list):
""" Print the score of retrived flags in the console"""
player = 1
for i in tanks_list:
print('Player',player,": ",i.points)
player = player+1
def print_score_result(screen, tanks_list):
""" Print the current score of retrived flags for all tanks over the whole
screen before a new round is started """
width = 300
height = 300
# create all labels!
while True:
for ev in pygame.event.get():
if ev.type == KEYDOWN:
if ev.key == K_1:
return
text2 = font2.render('Press 1 to countinue ' , True , white)
player = 1
screen.blit(images.grass,(200, 200))
for i in tanks_list:
text1 = font2.render("Player"+str(player)+":"+str(i.points), \
True , white)
screen.blit(text1, (width/2-120,height/6+player*50))
player = player +1
screen.blit(text2, (width/2-120,height/6-40))
text3 = font2.render('Result:' , True , white)
screen.blit(text3, (width/2-120,height/6))
pygame.display.update()
def print_stats_score(screen, tanks_list , current_map):
""" Print the current score of each tank on the game screen """
player = 1
for i in tanks_list:
text1 = font1.render(('Player'+str(player)+": "+str(i.points)) , \
True , white)
screen.blit(text1,(current_map.width*40+18,\
current_map.height*15+player*15))
player = player+1
def print_stats_round(screen, var , current_map):
""" Print the round number on the game screen. """
text1 = font1.render("round nr:"+str(var) , True , white)
screen.blit(text1, (current_map.width*40+18,current_map.height*18))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment