Exemple #1
0
def test_keyframescene():

    wall_driver = WallDriver(refresh=10, port=7778)
    print "Started wall driver for %s panel wall at %s:%s" % (wall_driver.panel_num, wall_driver.host, wall_driver.port)

    kst = KeyframeSceneTemplate(scene_length=32)  # Length of scene in beats

    # Set all panels to color 0 at beat 0
    kst.set_wall_frame(0, 0)

    # Set all panels to color 1 at beat 10, except for panel 6 set to color 2
    x = [1] * 36
    x[6] = 2
    x[0] = 2
    x[1] = 2
    kst.set_frame(10, x)

    # set all panels to color 2 at beat 20
    kst.set_wall_frame(20, 2)

    p = kst.bind({"tempo": 116, "colors": {0: (12, 34, 56), 1: (255, 234, 204), 2: (118, 0, 6)}})

    # p is now a playable scene
    wall_driver.set_scene(p)
    wall_driver.start()
    return wall_driver, kst
Exemple #2
0
def launcher_test():
	k = KeyboardHandler()
	l = LauncherScene()
	k.register_keypress('p',l.add_random_launcher)
	k.start() # Start watching keyboard
	
	wd = WallDriver(refresh=15,port=7778,initial_scene=l)
	k.register_keypress('q', wd.stop)
	wd.start()
Exemple #3
0
def wall_test():
	
	print """
	SNAKE for METROPOWALL
	
	Arrow keys control. Press 'q' to exit.
	
	Collect all the apples to win a special surprise!
	
	"""
	
	wd = WallDriver(refresh=30,host='localhost',port=7778)
	
	k = KeyboardHandler()
	
	s = Snake()
	
	k.register_arrows(s.up,s.right,s.down,s.left)
	k.register_keypress('q', wd.stop)
	k.start()
	
	wd.set_scene(s)
	wd.start()
	return wd,s