Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2013-12-28 23:31:31 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-12-28 23:31:31 (GMT)
commitc99763903dc6ec65a6caeacf14fd60fb8bd8226c (patch)
tree789e236898c4d3b3025ed35354b18af6e2dbe486
parente71b8cd3eb657384eddd1b0d891869fecb0d4d50 (diff)
adjust screen size
-rwxr-xr-xgame.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/game.py b/game.py
index c6bf8ba..1dede2e 100755
--- a/game.py
+++ b/game.py
@@ -61,8 +61,7 @@ class PacmanGame:
WIN_COLOR = (0xff, 0xff, 0x00)
def __init__(self, screen):
- print "init"
- pygame.init()
+
# note what time it was when we first launched
self.game_start_time = time.time()
self.pause = 0
@@ -102,6 +101,7 @@ class PacmanGame:
self.reset()
self.frame = 0
+ pygame.font.init()
self.font = pygame.font.Font(None, 30)
# support arrow keys, game pad arrows and game pad buttons
@@ -547,18 +547,16 @@ class PacmanGame:
def main():
"""Run a game of Maze."""
- #canvas_size = 1024,768-75
- #screen = pygame.display.set_mode(canvas_size)
-
# ask pygame how big the screen is, leaving a little room for the toolbar
- toolbarheight = 75
+ toolbarheight = 55
pygame.display.init()
- maxX,maxY = pygame.display.list_modes()[0]
- screen = pygame.display.set_mode( ( maxX, maxY-toolbarheight ) )
+ videoinfo = pygame.display.Info()
+ width = videoinfo.current_w
+ height = videoinfo.current_h - toolbarheight
+ screen = pygame.display.set_mode((width, height))
game = PacmanGame(screen)
game.run()
if __name__ == '__main__':
main()
-