Author: DerekRhodes
Date: 2008-01-02 06:37:22 +0000 (Wed, 02 Jan 2008)
New Revision: 717

Modified:
   trunk/pysoy/examples/broken/console.py
   trunk/pysoy/examples/collide_blocks.py
Log:
temporay bug bypass

Modified: trunk/pysoy/examples/broken/console.py
===================================================================
--- trunk/pysoy/examples/broken/console.py      2008-01-02 06:31:31 UTC (rev 
716)
+++ trunk/pysoy/examples/broken/console.py      2008-01-02 06:37:22 UTC (rev 
717)
@@ -17,8 +17,8 @@
     self.foreground = soy.colors.White()
     self.font = "courier"
     self.text = str(aChar)
+  def __repr__(self): return self.text
 
-
 class ConsoleLine(object):
   """
   I am a line in the Console. ConsoleChars are added to me, and I grow right.
@@ -31,15 +31,22 @@
     self.add_char(']')
     self.add_char(' ')
 
+  def full(self):
+    if len(self.columns) < self.maxColumns: return False
+    return True
+
   def add_char(self, aChar):
-    if len(self.columns) < self.maxColumns:
+    if not self.full():
       newChar = ConsoleChar(aChar)
       self.columns.append(  soy.widgets.Canvas( self.textArea,
                             margin  = 1,
                             texture = newChar ) )
-      return 0  # 
+      return 0
     return 1    # tell console to make a new line, cause we're full
   
+class KeyPress(soy.actions):
+  def __init__(self):
+    pass
     
 class Console(object):
   """
@@ -54,7 +61,9 @@
     self.lines          = []
     self.currentLine    = -1
     self.add_line()
-    
+    self.key            = soy.controllers.Keyboard(self.win)    
+    for char in 'abcdefghijklmnopqrtuvwxyz':
+      self.key[char] = KeyPress(1)
   def add_line(self):
     print "Adding Line: ", len(self.lines)    
     self.lines.append(ConsoleLine(self.win))
@@ -69,10 +78,11 @@
 
 if __name__ == '__main__' :
   sleep(1)
-  console = Console()
+  C = Console()
   count = 0
   while True:
-    console.add_char(str(count)[0])
+
+    C.add_char(str(count)[0])
     count += 1
     sleep(.1)
     

Modified: trunk/pysoy/examples/collide_blocks.py
===================================================================
--- trunk/pysoy/examples/collide_blocks.py      2008-01-02 06:31:31 UTC (rev 
716)
+++ trunk/pysoy/examples/collide_blocks.py      2008-01-02 06:37:22 UTC (rev 
717)
@@ -34,7 +34,8 @@
 if __name__ == '__main__' :
   while True:
     sleep(.1)
-    fps.text = '%sfps' % str(int(cam.fps)).zfill(4)
+    if cam.fps:
+      fps.text = '%sfps' % str(int(cam.fps)).zfill(4)
     for bk in bks :
       p = bks[bk].position
       v = bks[bk].velocity

_______________________________________________
PySoy-SVN mailing list
[email protected]
http://www.pysoy.org/mailman/listinfo/pysoy-svn

Reply via email to