Esempio n. 1
0
    def __init__(self):
        random.seed()

        self.road_start = cargar_img("road/road_start", 2)
        self.road_piece = cargar_img("road/road", 2)
        self.x = WIDTH // 2 - self.road_start.get_width() // 2
        self.y = 0

        self.road = Array()
        self.load_road()
Esempio n. 2
0
    def __init__(self, _states_manager):
        self.start_game = Timer(1000)
        self.logo = cargar_img("menu/logo_intro")
        self.levels = cargar_img("menu/levels_tag")
        self.selector = cargar_img("menu/selector")
        self.confirm_start_game = False

        self.blink_selection = Timer(200)
        self.blink_enabled = False

        self.states_manager = _states_manager
Esempio n. 3
0
    def __init__(self):
        random.seed()
        self.enemies = Array()

        self.gfx = [
            cargar_img("enemies/enemy_1", 2),
            cargar_img("enemies/enemy_3", 2),
            cargar_img("enemies/enemy_2", 2),
            cargar_img("enemies/bonus", 2)
        ]

        self.timer = Timer(2000)
Esempio n. 4
0
	def __init__(self):
		self.graficos = GestorAnimaciones()

		self.bounds = py.Rect(140 , 291, 0, 0)
		self.graficos.añadir_animacion("muerte", self.graficos.cargar_frames("jugador/muerte_jugador", 3), 200)
		self.bounds.width, self.bounds.height = self.graficos.añadir_animacion("normal", [cargar_img("jugador/jugador_normal")], 0)
		
		self.vx = 0
		self.velocidad = 4
		self.vivo = True
Esempio n. 5
0
 def cargar_ladrillos(self):
     self.imgs_ladrillos = [
         cargar_img("ladrillos/ladrillo_azul_claro"),
         cargar_img("ladrillos/ladrillo_naranja"),
         cargar_img("ladrillos/ladrillo_azul_oscuro"),
         cargar_img("ladrillos/ladrillo_rosa"),
         cargar_img("ladrillos/ladrillo_rojo"),
         cargar_img("ladrillos/ladrillo_salmon"),
         cargar_img("ladrillos/ladrillo_verde")
     ]
Esempio n. 6
0
    def __init__(self):
        random.seed()
        self.img = cargar_img("elementos/pelota")
        self.bounds = self.img.get_rect()
        self.bounds.x = 150
        self.bounds.y = 200

        self.velocidad = 3
        self.vx, self.vy = 0, -self.velocidad

        while self.vx == 0:
            self.vx = random.randrange(-self.velocidad, self.velocidad)
Esempio n. 7
0
	def __init__(self):
		self.animator = GestorAnimaciones()

		self.bounds = py.Rect(WIDTH // 2, HEIGHT - HEIGHT // 4, 0, 0)
		self.bounds.width, self.bounds.height = self.animator.añadir_animacion("recto", [cargar_img("jugador/recto", 2)], 0)
		self.bounds.x -= self.bounds.width // 2
		self.vx = 0
		self.speed = 2

		self.animator.añadir_animacion("explosion", self.animator.cargar_frames("jugador/explosion/explosion", 3, 2), 250, 1)
		self.animator.añadir_animacion("hacia_derecha", self.animator.cargar_frames("jugador/hacia_derecha", 3, 2), 200, 1)
		self.animator.añadir_animacion("hacia_izquierda", self.animator.cargar_frames("jugador/hacia_izquierda", 3, 2), 250, 1)
		self.animator.reproducir_animacion("recto", 0)
		self.alive = True
Esempio n. 8
0
    def __init__(self, _gestor_estados):
        self.fondo = cargar_img("fondos/fondo")

        self.jugador = Jugador()
        self.pelota = Pelota()
        self.escenario = Escenario()
Esempio n. 9
0
	def __init__(self, _gestor_estados):
		self.fondo = cargar_img("fondos/intro")
		self.temporizador_parpadeo = Timer(250)
		self.parpadear = True
		self.gestor_estados = _gestor_estados