Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/physics.py
diff options
context:
space:
mode:
Diffstat (limited to 'physics.py')
-rw-r--r--physics.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/physics.py b/physics.py
index a3be7ef..0c60371 100644
--- a/physics.py
+++ b/physics.py
@@ -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