aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar rcoh <rcoh@mit.edu>2011-08-29 21:22:57 -0400
committerGravatar rcoh <rcoh@mit.edu>2011-08-29 21:22:57 -0400
commit2c66af07ac43ffdea84e847a2e6ff7ac164d62e5 (patch)
treeea85d017c1c187624c480bc1266b0ad8a5fd3af7
parent73c4c0006aa5ec2453691ca4ed6414025fb7edab (diff)
fixing input, renderer
-rw-r--r--ddrinput.py11
-rw-r--r--renderer.py6
2 files changed, 10 insertions, 7 deletions
diff --git a/ddrinput.py b/ddrinput.py
index 6cad156..5a7b750 100644
--- a/ddrinput.py
+++ b/ddrinput.py
@@ -1,6 +1,5 @@
import pygame
import time
-=======
JOY_EVENT = 7
JOY_EVENT_2 = 10
@@ -63,10 +62,9 @@ class DdrInput(object):
event = pygame.event.poll()
player_move = None
if event.type == JOY_EVENT:
- player_index, player_move = handle_joy_event(event)
+ player_index, player_move = self.handle_joy_event(event)
if self.debug_mode:
print (player_index, player_move)
-
if self.debug_mode:
if event.type == KEY_EVENT or event.type == KEY_RELEASE:
(player_index, player_move) = self.handle_key_event(event)
@@ -84,7 +82,6 @@ class DdrInput(object):
for player_index in self.active_inputs:
if self.active_inputs[player_index] != None:
(fallback_start, start_time, move) = self.active_inputs[player_index]
- print time.time() - start_time
if time.time() - start_time > fallback_start:
fallback_start /= 2
fallback_start = max(.1, fallback_start)
@@ -98,6 +95,12 @@ class DdrInput(object):
#there may be a tricky quick way to code this, but this is more readable
#value == 0 -> released
player_move = None
+ #if event.type == JOY_EVENT_2:
+ # player_move = DROP
+ # return (player_index, player_move)
+ #if event.type == JOY_EVENT_2+1:
+ # player_move = RELEASE
+ # return (player_index, player_move)
if event.axis == X:
if event.value < 0:
player_move = LEFT
diff --git a/renderer.py b/renderer.py
index bd141c8..ffe8628 100644
--- a/renderer.py
+++ b/renderer.py
@@ -24,9 +24,9 @@ class PygameRenderer(Renderer):
pygame Window.
"""
- DISPLAY_SIZE = (1000,1000)
- OFFSET = (100, 100)
- SCALE = 15
+ DISPLAY_SIZE = (1500,1500)
+ OFFSET = (50, 50)
+ SCALE = 20
RADIUS = 6
def __init__(self):