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-03-30 01:38:41 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2013-03-30 01:38:41 (GMT)
commit17e65ae2ca7863eb8d03f50687d0ab5573469762 (patch)
treef8fb8e84414338735a698a8f86c7c08a55326382
parent13ab927cc7ddac01673c2b9bc0a0eda583a03fae (diff)
add basic non sugar use
-rwxr-xr-xkuku.py23
1 files changed, 18 insertions, 5 deletions
diff --git a/kuku.py b/kuku.py
index 712203e..ce2781e 100755
--- a/kuku.py
+++ b/kuku.py
@@ -557,7 +557,8 @@ class Lives(object):
class KukuActivity():
- def __init__(self):
+ def __init__(self, running_sugar=True):
+ self.running_sugar = running_sugar
#Initialize questions - need to do lazy loading to speed up game init
self.question_lists = []
qfIO = question.QuestionFileIO()
@@ -714,10 +715,19 @@ class KukuActivity():
]
pygame.init()
-
+ pygame.display.init()
#screen = pygame.display.set_mode(SCREENRECT.size,0)
screen = pygame.display.get_surface()
+ if not(screen):
+ info = pygame.display.Info()
+ w = info.current_w
+ h = info.current_h
+ # prevent hide zones
+ #w = w - 50
+ #h = h - 100
+ screen = pygame.display.set_mode((w, h), pygame.FULLSCREEN)
+
#whiten screen
screen.fill((255,255,255))
@@ -826,6 +836,10 @@ class KukuActivity():
for evt in events:
if evt.type == pygame.KEYDOWN:
+ if evt.key == 27:
+ if not(self.running_sugar):
+ running = False
+ exit()
# elif evt.key == pygame.K_SPACE:
if not evt.key in move_keys:
x = player.grid_position[0]
@@ -977,8 +991,7 @@ class KukuActivity():
state.time = GAME_TIME
state.save()
-"""
if __name__ == '__main__':
- k = KukuActivity()
- k.run()"""
+ k = KukuActivity(False)
+ k.run()