Something like this will do:
#! usr/bin/env python
import pygame
from pygame.locals import *
pygame.font.init
pygame.init()
screen = pygame.display.set_mode((150, 150))
pygame.display.set_caption('Help')
pygame.mouse.set_visible(0)
pygame.display.init()
lives = 3
def main():
global lives
font = pygame.font.Font(None, 36)
s = "Lives =" + str(lives)
text = font.render(s, 1, (250, 250, 250))
screen.blit(text, (0, 0))
pygame.display.flip()
# run event loop and provide exit conditions
while True:
for event in pygame.event.get():
# window title 'x' click
if event.type == pygame.QUIT:
raise SystemExit
main()
sneekula
Nearly a Posting Maven
2,427 posts since Oct 2006
Reputation Points: 961
Solved Threads: 212