Ejemplo n.º 1
0
pellet8 = farnsworth.sprite( sign.locate_file('pellet.bmp') )
pellet8.move_to(60,7)

pellet9 = farnsworth.sprite( sign.locate_file('pellet.bmp') )
pellet9.move_to(68,7)

pellet10 = farnsworth.sprite( sign.locate_file('pellet.bmp') )
pellet10.move_to(76,7)

pellet11 = farnsworth.sprite( sign.locate_file('pellet.bmp') )
pellet11.move_to(84,7)

pellet12 = farnsworth.sprite( sign.locate_file('pellet.bmp') )
pellet12.move_to(92,7)

clock = farnsworth.clock(.075)
#clock = farnsworth.clock(1.5)
frame_count = 0

while True:

  sign.front_layer().blank()

  if clock.tick():
    pacman.cycle_image()
    pacman.tween()
    blinky.cycle_image()
    blinky.tween() 
    print "Blinky = ", blinky._x, blinky._x_inc, blinky._x_float
    print "Pacman = ", pacman._x , pacman._x_inc, pacman._x_float
    #print frame_count
Ejemplo n.º 2
0
walker.add_image( sign.locate_file('06.bmp') )
walker.add_image( sign.locate_file('07.bmp') )
walker.add_image( sign.locate_file('08.bmp') )
walker.add_image( sign.locate_file('09.bmp') )
walker.add_image( sign.locate_file('10.bmp') )
walker.add_image( sign.locate_file('11.bmp') )
walker.add_image( sign.locate_file('12.bmp') )
walker.add_image( sign.locate_file('13.bmp') )
walker.add_image( sign.locate_file('14.bmp') )
walker.add_image( sign.locate_file('15.bmp') )
walker.add_image( sign.locate_file('16.bmp') )

walker.move_to(-10,0)
walker.tween_to(95,0,150)

clock = farnsworth.clock(0.08)

while True:

  sign.front_layer().blank()

  if clock.tick():
    walker.advance_image()
    walker.tween()

  walker.paint( sign.front_layer() )    
  
  sign.paint()

  sleep(0.001)
Ejemplo n.º 3
0
              { "file": "goomba.gif",
                "fps": 1,
                "x": 60 },
              { "file": "qblock.gif",
                "fps": 5,
                "x": 80 }
            ]

sign = farnsworth.sign( provides_logo=False,
                        is_dynamic=True,
                        preferred_duration=10.0 )

for gif in gifs:
  gif["file"] = sign.locate_file(gif["file"])
  gif["sprite"] = farnsworth.sprite(gif_source=gif["file"], scale_y_to=config.PIXELS_HIGH)
  gif["sprite"].move_to( gif["x"], 0 )
  gif["clock"] = farnsworth.clock( 1.0 / gif["fps"] )

while True:

  sign.front_layer().blank()

  for gif in gifs:
    if gif["clock"].tick():
      gif["sprite"].advance_image()
    gif["sprite"].paint( sign.front_layer() )    

  sign.front_layer().render_string("CENTER","CENTER","FONT_5x5","GIF RENDERING",constants.COLORS['WHITE'] )

  sign.paint()