예제 #1
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()
예제 #2
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