示例#1
0
 def __init__(self, x, y, num_ints):
     # pretty sure x,y aren't needed
     self.x = x
     self.y = y
     self.w = 30
     self.h = 15
     self.num_ints = num_ints
     self.base_obj = display_object(x, y, 30, 15)
     self.score_string_obj = display_object(x, y, 30, 7)
     self.score_string_obj.pix = stringtopix("Score:")
     self.score_int_obj = display_object(x, y + 8, 30, 7)
示例#2
0
#!/usr/bin/python
import numpy
from display_object import *
#import display_object
import shapes
from locationservices import *
from matrix_printer import *

# Base canvas object, all drawing will be done on this
canvas = display_object(0,0,32,32)

# Temp canvas layer while shape is being edited
layer = display_object(0,0,32,32)

# Select Shape char
#   dot     [0]
#   line    [1]
#   square  [2]
shape_options = ""
shape_length = 5

# State machine hoo-ha
state = 0
running = 1     # keeps while loop going
shape_choosen = -1      #default- no shape
shape = display_object(0,0,shape_length,shape_length)

def start():
    #print "Program start...\n"
#       STATE NOT CHANGED IN DEF METHODS
    state = 1
示例#3
0
from display_object import *
from scoreboard import *
from matrix_master import *
import string
import array
import numpy

word = "Scor:1"
print(set(string.ascii_lowercase).intersection(word))
print(set(string.ascii_uppercase).intersection(word))
print(set(string.digits).intersection(word))
print(set(string.punctuation).intersection(word))
#print(string.digits.index(word[0]))

typed_string_pix = numpy.zeros((32, 32))
canvas_pix = display_object(0, 0, 32, 32)
test_master = matrix_master(canvas_pix)

# display_object for user typed input (in typing game)
user_typed_obj = display_object(1, 4, 30, 7)
test_master.display_object_list.append(user_typed_obj)

# display_object for the score
scoreboard_obj = scoreboard(1, 16, 4)
test_master.display_object_list.append(scoreboard_obj)

#print_to_matrix_default(displayAt(0,0,scoreboard_obj.getScoreboard_pix(0)))

user_input = raw_input("Press any key to start\t")
# take first char input --> initialize typed_string
#typed_string = array.array('c',[user_input])