diff options
Diffstat (limited to 'physics.py')
-rw-r--r-- | physics.py | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -26,15 +26,16 @@ License: GPLv3 http://gplv3.fsf.org/ import pygame from pygame.locals import * from pygame.color import * -import olpcgames +import olpcgamesbridge as olpcgames -import elements +import elementsbridge as elements #from elements import Elements import tools from bridge import Bridge #from helpers import * from gettext import gettext as _ +import gtk class PhysicsGame: """ @@ -51,7 +52,13 @@ class PhysicsGame: # get everything set up self.clock = pygame.time.Clock() self.font = pygame.font.Font(None, 24) # font object - self.canvas = olpcgames.ACTIVITY.canvas # canvas object + try: + self.canvas = olpcgames.ACTIVITY.canvas # canvas object + except: + from olpcgamesbridge.canvas import PygameCanvas + xsize, ysize = pygame.display.list_modes()[0] + self.canvas = PygameCanvas(xsize, ysize-45-75) + self.joystickobject = None # TODO Figure out why this exists self.debug = True # TODO Figure out what this does @@ -86,7 +93,7 @@ class PhysicsGame: for event in pygame.event.get(): # Handles events like button clicks - self.currenttool.handleEvents(event) + self.currenttool.handleevents(event) # Clear Display self.screen.fill((80, 160, 240)) #255 for white |