Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sprayplay.py
diff options
context:
space:
mode:
authorAlan Aguiar <alanjas@hotmail.com>2012-05-26 22:37:30 (GMT)
committer Alan Aguiar <alanjas@hotmail.com>2012-05-26 22:37:30 (GMT)
commit09441e906492a0dfd913f8363878dcd3171bd8a3 (patch)
tree59a6946a7743f082fc90f7f5407284105e9f34f2 /sprayplay.py
parentcbc047edeacbfd238cd10afe55b749df99779799 (diff)
some changes to improve the code
Diffstat (limited to 'sprayplay.py')
-rwxr-xr-x[-rw-r--r--]sprayplay.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/sprayplay.py b/sprayplay.py
index d80a92a..2315750 100644..100755
--- a/sprayplay.py
+++ b/sprayplay.py
@@ -2,6 +2,7 @@
from __future__ import division
import os
+import gtk
import pygame
import random
from math import *
@@ -685,12 +686,12 @@ class SprayPlay():
def __init__(self):
pass
- def run():
+ def run(self):
# Initialization
pygame.init()
screen = pygame.display.get_surface()
- SCREEN_WIDTH = screen.width()
- SCREEN_HEIGHT = screen.height()
+ SCREEN_WIDTH = screen.get_width()
+ SCREEN_HEIGHT = screen.get_height()
background = Background()
# Initial game state.
@@ -722,11 +723,17 @@ class SprayPlay():
delta = clock.tick(25)
#delta = 1.0 / 25.0
+ #GTK events
+ while gtk.events_pending():
+ gtk.main_iteration()
for evt in pygame.event.get():
+ print 'tipo ev: ', evt.type
+ print pygame.event.event_name(evt.type)
if evt.type == pygame.QUIT:
raise StopGame
elif evt.type == pygame.KEYDOWN:
+ print 'tecla presionda'
if not overlay.dying:
overlay.dying = 1
keyboard_intro.kill()
@@ -772,6 +779,8 @@ class SprayPlay():
if evt.key == pygame.K_SPACE:
b.shootButton = 0
b.isHuman = 1
+ elif event.type == pygame.VIDEORESIZE:
+ pygame.display.set_mode(event.size, pygame.RESIZABLE)
if not a.isHuman:
applyAI(a)