#! /usr/bin/python
print "Game console initialized"
import pygame
pygame.init()
screenSize = width,height = 240,160
display = pygame.display.set_mode(screenSize)
starImage = pygame.image.load("star.gif")
starBox = starImage.get_rect()
speed = [1,1]
black = 0,0,0
keepPlaying = True
while keepPlaying:
   for event in pygame.event.get():
      if event.type == pygame.QUIT:
         keepPlaying = False
   starBox = starBox.move(speed)
   if starBox.left < 0 or starBox.right > width:
      speed[0] = - speed[0]
      print speed
   if starBox.top < 0 or starBox.bottom > height:
      speed[1] = - speed[1]
      print speed
   display.fill(black)
   display.blit(starImage, starBox)
   pygame.display.flip()
   pygame.time.delay(100)
