#!/usr/bin/env python2

import pygame
from pygame.constants import *

import time
import sys

from image import *

from menu import  Menu
from world import World
from gamestack import GameStack
from settings import *

class Game:
	def __init__(self):
		self.gamestack = GameStack()

		pygame.init()
		pygame.font.init()
		self.screen = pygame.display.set_mode((settings_screen['width'], settings_screen['height']))
		pygame.display.set_caption("Forever Keen")
		#pygame.mouse.set_visible(0)5


		self.surface = pygame.Surface(self.screen.get_size()).convert()

		self.bgcolor = (0,0,0)
		self.surface.fill(self.bgcolor)

		self.score = 0

		self.gamestack.push(Menu, [self])

	def run(self):
		self.gamestack.run()

	def startGame(self):
		font = pygame.font.Font(None, 50)

		self.surface.fill(self.bgcolor)
		imgLoad = pygame.image.load("loadscreen.png")
		titlePlate = pygame.image.load("titleplate.png")
		self.surface.blit(titlePlate,(self.screen.get_size()[0]/2-192, self.screen.get_size()[1]/2-192))
		self.surface.blit(imgLoad,(self.screen.get_size()[0]/2-160, self.screen.get_size()[1]/2-64))
		self.screen.blit(self.surface, (0,0))
		pygame.display.flip()

		self.world = World(self, "map")
		self.gamestack.pushpop(self.world.run, [])


g = Game()
g.run()
