changeset 44:d35a3762edda

Idiomatic
author Neil Muller <drnlmuller@gmail.com>
date Mon, 07 May 2012 16:53:18 +0200
parents 2bdac178ec6f
children 1e8f7e694f0c
files gamelib/main.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/main.py	Mon May 07 16:51:52 2012 +0200
+++ b/gamelib/main.py	Mon May 07 16:53:18 2012 +0200
@@ -92,11 +92,11 @@
         if MOUSE_DOWN:
             if event.type == MOUSEBUTTONUP:
                 MOUSE_DOWN = False
-                WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_up(event.pos)
+                WINDOW_STACK[-1].on_mouse_up(event.pos)
             elif event.type == MOUSEMOTION:
-                WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_move(event.pos)
+                WINDOW_STACK[-1].on_mouse_move(event.pos)
         elif not MOUSE_DOWN and event.type == MOUSEBUTTONDOWN:
             MOUSE_DOWN = True
-            WINDOW_STACK[len(WINDOW_STACK) - 1].on_mouse_down(event.pos)
+            WINDOW_STACK[-1].on_mouse_down(event.pos)
         elif event.type == QUIT:
             GAME_IS_RUNNING = False