-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathactivity.py
45 lines (35 loc) · 1.04 KB
/
activity.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import sys
import gtk
import pygame
import os
import sugar.activity.activity
import sugar.graphics.toolbutton
sys.path.insert(0, os.path.abspath("libraries"))
import sugargame
import sugargame.canvas
import spyral
class Activity(sugar.activity.activity.Activity):
def __init__(self, handle):
super(Activity, self).__init__(handle)
self.paused = False
self._pygamecanvas = sugargame.canvas.PygameCanvas(self)
self.set_canvas(self._pygamecanvas)
def run():
spyral.director.init((1200,900), fullscreen = False, max_fps = 30)
game.main()
spyral.director.run(sugar = True)
self._pygamecanvas.run_pygame(run)
def read_file(self, file_path):
pass
def write_file(self, file_path):
pass
def main():
spyral.director.init((0,0), fullscreen = False, max_fps = 30)
import game
game.main()
try:
spyral.director.run()
except KeyboardInterrupt:
pygame.quit()
if __name__ == '__main__':
main()