Beispiel #1
0
            shape = Shape(shape_color, shape_queue[0], 0, 5, 0)
            shape_color = (randint(1, 255), randint(1, 255), randint(1, 255))

        # Delay (increase to increase the shape drop delay)
        if init < time:
            shape.move_down(area.matrix())
            init += 300

        # redraws the screen to update everything
        screen.fill((0, 0, 0))
        shape.draw_shape(area.matrix(), screen)
        area.draw(shape, area.matrix(), screen)
        area.print_game_info(screen)
        next_shape = Shape(shape_color, shape_queue[1], 0, 12, 0)
        next_shape.update_shape(area.matrix())
        area.draw_next_shape(next_shape, screen)
        hud.draw(screen)
        pygame.display.flip()

    # first loop helps bot with the first iteration of the bot loop
    first_loop = 1
    # Main Bot loop
    while menu.demo and shape.game_state:
        check_input()
        time = pygame.time.get_ticks() - start_time

        next_shape = Shape(shape_color, shape_queue[1], 0, 12, 0)

        if shape.state == 1 or first_loop == 1:
            next_shape.deactivate()
            shape_queue.pop(0)
Beispiel #2
0
			shape = Shape(shape_color,shape_queue[0], 0,5,0)
			shape_color=(randint(1,255), randint(1,255), randint(1,255))

		# Delay (increase to increase the shape drop delay)
		if init < time:			
			shape.move_down(area.matrix())
			init += 300
		
		# redraws the screen to update everything
		screen.fill((0,0,0))
		shape.draw_shape(area.matrix(), screen)
		area.draw(shape, area.matrix(), screen)
		area.print_game_info(screen)
		next_shape = Shape(shape_color,shape_queue[1],0,12,0)
		next_shape.update_shape(area.matrix())
		area.draw_next_shape(next_shape,screen)
		hud.draw(screen)
		pygame.display.flip()

	# first loop helps bot with the first iteration of the bot loop
	first_loop = 1
	# Main Bot loop
	while menu.demo and shape.game_state:
		check_input()
		time = pygame.time.get_ticks() - start_time

		next_shape = Shape(shape_color,shape_queue[1],0,12,0)

		if shape.state == 1 or first_loop == 1:
			next_shape.deactivate()
			shape_queue.pop(0)