def __init__(self): "Inicialización de las variables del videojuego." Escena.__init__(self) self.motor = Tilevid() tiles = {1: ("todos", self.tile_muro, None), 4: ("personaje", self.recoge_ruby, None)} self.motor.tga_load_tiles("media/niveles/tiles_tierra.tga", (TW, TH), tiles) self.motor.tga_load_level("media/niveles/laberinto2.tga") # Imágenes para los sprites. imagenes = [ # Sprites del jugador. ("lp_s1", "media/sprites/lp_s1.gif", (0, 0, 24, 24)), ("lp_s2", "media/sprites/lp_s2.gif", (0, 0, 24, 24)), ("lp_o1", "media/sprites/lp_o1.gif", (0, 0, 24, 24)), ("lp_o2", "media/sprites/lp_o2.gif", (0, 0, 24, 24)), ("lp_e1", "media/sprites/lp_e1.gif", (0, 0, 24, 24)), ("lp_e2", "media/sprites/lp_e2.gif", (0, 0, 24, 24)), ("lp_n1", "media/sprites/lp_n1.gif", (0, 0, 24, 24)), ("lp_n2", "media/sprites/lp_n2.gif", (0, 0, 24, 24)), # Sprites de la bruja maldita. ("bm_s1", "media/sprites/bm_s1.gif", (0, 0, 24, 24)), ("bm_s2", "media/sprites/bm_s2.gif", (0, 0, 24, 24)), ("bm_o1", "media/sprites/bm_o1.gif", (0, 0, 24, 24)), ("bm_o2", "media/sprites/bm_o2.gif", (0, 0, 24, 24)), ("bm_e1", "media/sprites/bm_e1.gif", (0, 0, 24, 24)), ("bm_e2", "media/sprites/bm_e2.gif", (0, 0, 24, 24)), ("bm_n1", "media/sprites/bm_n1.gif", (0, 0, 24, 24)), ("bm_n2", "media/sprites/bm_n2.gif", (0, 0, 24, 24)), # Sprites del paladín del imperio. ("pi_s1", "media/sprites/pi_s1.gif", (0, 0, 24, 24)), ("pi_s2", "media/sprites/pi_s2.gif", (0, 0, 24, 24)), ("pi_o1", "media/sprites/pi_o1.gif", (0, 0, 24, 24)), ("pi_o2", "media/sprites/pi_o2.gif", (0, 0, 24, 24)), ("pi_e1", "media/sprites/pi_e1.gif", (0, 0, 24, 24)), ("pi_e2", "media/sprites/pi_e2.gif", (0, 0, 24, 24)), ("pi_n1", "media/sprites/pi_n1.gif", (0, 0, 24, 24)), ("pi_n2", "media/sprites/pi_n2.gif", (0, 0, 24, 24)), # Sprites del alter ego. ("ae_s1", "media/sprites/ae_s1.gif", (0, 0, 24, 24)), ("ae_s2", "media/sprites/ae_s2.gif", (0, 0, 24, 24)), ("ae_o1", "media/sprites/ae_o1.gif", (0, 0, 24, 24)), ("ae_o2", "media/sprites/ae_o2.gif", (0, 0, 24, 24)), ("ae_e1", "media/sprites/ae_e1.gif", (0, 0, 24, 24)), ("ae_e2", "media/sprites/ae_e2.gif", (0, 0, 24, 24)), ("ae_n1", "media/sprites/ae_n1.gif", (0, 0, 24, 24)), ("ae_n2", "media/sprites/ae_n2.gif", (0, 0, 24, 24)), # Sprites de los no-muertos. ("nm_s1", "media/sprites/nm_s1.gif", (0, 0, 24, 24)), ("nm_s2", "media/sprites/nm_s2.gif", (0, 0, 24, 24)), ("nm_o1", "media/sprites/nm_o1.gif", (0, 0, 24, 24)), ("nm_o2", "media/sprites/nm_o2.gif", (0, 0, 24, 24)), ("nm_e1", "media/sprites/nm_e1.gif", (0, 0, 24, 24)), ("nm_e2", "media/sprites/nm_e2.gif", (0, 0, 24, 24)), ("nm_n1", "media/sprites/nm_n1.gif", (0, 0, 24, 24)), ("nm_n2", "media/sprites/nm_n2.gif", (0, 0, 24, 24)), ] self.codigos = { 1: (self.crear_jugador, None), 4: (self.bruja_maldita, None), 5: (self.alter_ego, None), 6: (self.paladin, None), 7: (self.no_muerto, None), } self.motor.load_images(imagenes) self.motor.run_codes(self.codigos, (0, 0, 16, 16)) self.puntos = 0 self.rubies = 0 # Conteo inicial de rubíes. for linea in self.motor.tlayer: for tile in linea: if tile == 4: self.rubies += 1
def __init__(self, puntos=0): global complejidad, densidad, nivel "Inicialización de las variables del videojuego." Escena.__init__(self) def array_load_level(self,z,bg=0): w, h = z.shape self.resize((w,h),bg) for y in range(0,h): for x in range(0,w): t = z[y,x] if t == 5: #jugador self.tlayer[y][x] = 0 self.clayer[y][x] = 1 elif t == 6: #enemigo self.tlayer[y][x] = 0 self.clayer[y][x] = 4 else : self.tlayer[y][x] = t self.clayer[y][x] = 0 return self.motor = Tilevid() Tilevid.array_load_level = array_load_level tiles = { 1: ('todos', self.tile_muro, None), 4: ('personaje', self.recoge_ruby, None), } self.motor.tga_load_tiles('media/niveles/tiles_ekmaze.tga', (TW, TH), tiles) self.maze = Maze(16, 16, complejidad, densidad) self.motor.array_load_level(self.maze.getMap(),0) complejidad += 0.05 densidad += 0.02 #Imágenes para los sprites. imagenes = [ #Sprites del jugador. ('lp_s1', 'media/sprites/lp_s1.gif', (0, 0, 24, 24) ), ('lp_s2', 'media/sprites/lp_s2.gif', (0, 0, 24, 24) ), ('lp_o1', 'media/sprites/lp_o1.gif', (0, 0, 24, 24) ), ('lp_o2', 'media/sprites/lp_o2.gif', (0, 0, 24, 24) ), ('lp_e1', 'media/sprites/lp_e1.gif', (0, 0, 24, 24) ), ('lp_e2', 'media/sprites/lp_e2.gif', (0, 0, 24, 24) ), ('lp_n1', 'media/sprites/lp_n1.gif', (0, 0, 24, 24) ), ('lp_n2', 'media/sprites/lp_n2.gif', (0, 0, 24, 24) ), #Sprites de los no-muertos. ('nm_s1', 'media/sprites/nm_s1.gif', (0, 0, 24, 24) ), ('nm_s2', 'media/sprites/nm_s2.gif', (0, 0, 24, 24) ), ('nm_o1', 'media/sprites/nm_o1.gif', (0, 0, 24, 24) ), ('nm_o2', 'media/sprites/nm_o2.gif', (0, 0, 24, 24) ), ('nm_e1', 'media/sprites/nm_e1.gif', (0, 0, 24, 24) ), ('nm_e2', 'media/sprites/nm_e2.gif', (0, 0, 24, 24) ), ('nm_n1', 'media/sprites/nm_n1.gif', (0, 0, 24, 24) ), ('nm_n2', 'media/sprites/nm_n2.gif', (0, 0, 24, 24) ), ] self.codigos = { 1: (self.crear_jugador, None), 4: (self.no_muerto, None), } self.motor.load_images(imagenes) self.motor.run_codes(self.codigos, (0, 0, 16, 16)) self.puntos = puntos self.puertas = 0 #Conteo inicial de puertas. for linea in self.motor.tlayer: for tile in linea: if tile == 4: self.puertas += 1
class EscenaJuego(Escena): "Clase que define la escena principal del videojuego." def __init__(self): "Inicialización de las variables del videojuego." Escena.__init__(self) self.motor = Tilevid() tiles = {1: ("todos", self.tile_muro, None), 4: ("personaje", self.recoge_ruby, None)} self.motor.tga_load_tiles("media/niveles/tiles_tierra.tga", (TW, TH), tiles) self.motor.tga_load_level("media/niveles/laberinto2.tga") # Imágenes para los sprites. imagenes = [ # Sprites del jugador. ("lp_s1", "media/sprites/lp_s1.gif", (0, 0, 24, 24)), ("lp_s2", "media/sprites/lp_s2.gif", (0, 0, 24, 24)), ("lp_o1", "media/sprites/lp_o1.gif", (0, 0, 24, 24)), ("lp_o2", "media/sprites/lp_o2.gif", (0, 0, 24, 24)), ("lp_e1", "media/sprites/lp_e1.gif", (0, 0, 24, 24)), ("lp_e2", "media/sprites/lp_e2.gif", (0, 0, 24, 24)), ("lp_n1", "media/sprites/lp_n1.gif", (0, 0, 24, 24)), ("lp_n2", "media/sprites/lp_n2.gif", (0, 0, 24, 24)), # Sprites de la bruja maldita. ("bm_s1", "media/sprites/bm_s1.gif", (0, 0, 24, 24)), ("bm_s2", "media/sprites/bm_s2.gif", (0, 0, 24, 24)), ("bm_o1", "media/sprites/bm_o1.gif", (0, 0, 24, 24)), ("bm_o2", "media/sprites/bm_o2.gif", (0, 0, 24, 24)), ("bm_e1", "media/sprites/bm_e1.gif", (0, 0, 24, 24)), ("bm_e2", "media/sprites/bm_e2.gif", (0, 0, 24, 24)), ("bm_n1", "media/sprites/bm_n1.gif", (0, 0, 24, 24)), ("bm_n2", "media/sprites/bm_n2.gif", (0, 0, 24, 24)), # Sprites del paladín del imperio. ("pi_s1", "media/sprites/pi_s1.gif", (0, 0, 24, 24)), ("pi_s2", "media/sprites/pi_s2.gif", (0, 0, 24, 24)), ("pi_o1", "media/sprites/pi_o1.gif", (0, 0, 24, 24)), ("pi_o2", "media/sprites/pi_o2.gif", (0, 0, 24, 24)), ("pi_e1", "media/sprites/pi_e1.gif", (0, 0, 24, 24)), ("pi_e2", "media/sprites/pi_e2.gif", (0, 0, 24, 24)), ("pi_n1", "media/sprites/pi_n1.gif", (0, 0, 24, 24)), ("pi_n2", "media/sprites/pi_n2.gif", (0, 0, 24, 24)), # Sprites del alter ego. ("ae_s1", "media/sprites/ae_s1.gif", (0, 0, 24, 24)), ("ae_s2", "media/sprites/ae_s2.gif", (0, 0, 24, 24)), ("ae_o1", "media/sprites/ae_o1.gif", (0, 0, 24, 24)), ("ae_o2", "media/sprites/ae_o2.gif", (0, 0, 24, 24)), ("ae_e1", "media/sprites/ae_e1.gif", (0, 0, 24, 24)), ("ae_e2", "media/sprites/ae_e2.gif", (0, 0, 24, 24)), ("ae_n1", "media/sprites/ae_n1.gif", (0, 0, 24, 24)), ("ae_n2", "media/sprites/ae_n2.gif", (0, 0, 24, 24)), # Sprites de los no-muertos. ("nm_s1", "media/sprites/nm_s1.gif", (0, 0, 24, 24)), ("nm_s2", "media/sprites/nm_s2.gif", (0, 0, 24, 24)), ("nm_o1", "media/sprites/nm_o1.gif", (0, 0, 24, 24)), ("nm_o2", "media/sprites/nm_o2.gif", (0, 0, 24, 24)), ("nm_e1", "media/sprites/nm_e1.gif", (0, 0, 24, 24)), ("nm_e2", "media/sprites/nm_e2.gif", (0, 0, 24, 24)), ("nm_n1", "media/sprites/nm_n1.gif", (0, 0, 24, 24)), ("nm_n2", "media/sprites/nm_n2.gif", (0, 0, 24, 24)), ] self.codigos = { 1: (self.crear_jugador, None), 4: (self.bruja_maldita, None), 5: (self.alter_ego, None), 6: (self.paladin, None), 7: (self.no_muerto, None), } self.motor.load_images(imagenes) self.motor.run_codes(self.codigos, (0, 0, 16, 16)) self.puntos = 0 self.rubies = 0 # Conteo inicial de rubíes. for linea in self.motor.tlayer: for tile in linea: if tile == 4: self.rubies += 1 def crear_jugador(self, motor, tile, valor): "Función para crear el sprite animado del jugador." imagenes = [ ["lp_s1", "lp_s2"], # Abajo ["lp_n1", "lp_n2"], # Arriba ["lp_o1", "lp_o2"], # Izquierda ["lp_e1", "lp_e2"], # Derecha ] jugador = CharacterSprite(imagenes, (tile.rect.x + 4, tile.rect.y + 4), motor, 20) motor.sprites.append(jugador) jugador.loop = self.mover_jugador jugador.groups = motor.string2groups("todos,personaje") jugador.speed = 2 def bruja_maldita(self, motor, tile, valor): "Función para crear a la bruja maldita." imagenes = [ ["bm_s1", "bm_s2"], # Abajo ["bm_n1", "bm_n2"], # Arriba ["bm_o1", "bm_o2"], # Izquierda ["bm_e1", "bm_e2"], # Derecha ] bruja = CharacterSprite(imagenes, (tile.rect.x + 4, tile.rect.y + 4), motor, 20) motor.sprites.append(bruja) bruja.groups = motor.string2groups("todos") bruja.agroups = motor.string2groups("personaje") bruja.loop = self.mover_enemigo bruja.hit = self.juego_terminado bruja.speed = 2 bruja.set_movedir(0) def alter_ego(self, motor, tile, valor): "Función para crear el alter ego." imagenes = [ ["ae_s1", "ae_s2"], # Abajo ["ae_n1", "ae_n2"], # Arriba ["ae_o1", "ae_o2"], # Izquierda ["ae_e1", "ae_e2"], # Derecha ] alter = CharacterSprite(imagenes, (tile.rect.x + 4, tile.rect.y + 4), motor, 20) motor.sprites.append(alter) alter.groups = motor.string2groups("todos") alter.agroups = motor.string2groups("personaje") alter.loop = self.mover_enemigo alter.hit = self.juego_terminado alter.speed = 2 alter.set_movedir(0) def paladin(self, motor, tile, valor): "Función para crear al paladín del imperio." imagenes = [ ["pi_s1", "pi_s2"], # Abajo ["pi_n1", "pi_n2"], # Arriba ["pi_o1", "pi_o2"], # Izquierda ["pi_e1", "pi_e2"], # Derecha ] paladin = CharacterSprite(imagenes, (tile.rect.x + 4, tile.rect.y + 4), motor, 20) motor.sprites.append(paladin) paladin.groups = motor.string2groups("todos") paladin.agroups = motor.string2groups("personaje") paladin.loop = self.mover_enemigo paladin.hit = self.juego_terminado paladin.speed = 2 paladin.set_movedir(2) def no_muerto(self, motor, tile, valor): "Función para crear al paladín del imperio." imagenes = [ ["nm_s1", "nm_s2"], # Abajo ["nm_n1", "nm_n2"], # Arriba ["nm_o1", "nm_o2"], # Izquierda ["nm_e1", "nm_e2"], # Derecha ] no_muerto = CharacterSprite(imagenes, (tile.rect.x + 4, tile.rect.y + 4), motor, 20) motor.sprites.append(no_muerto) no_muerto.groups = motor.string2groups("todos") no_muerto.agroups = motor.string2groups("personaje") no_muerto.loop = self.mover_enemigo no_muerto.hit = self.juego_terminado no_muerto.speed = 2 no_muerto.set_movedir(0) def tile_muro(self, motor, tile, sprite): sprite.crashed = True if sprite._rect.bottom <= tile._rect.top: sprite.rect.bottom = tile.rect.top if sprite._rect.right <= tile._rect.left: sprite.rect.right = tile.rect.left if sprite._rect.left >= tile._rect.right: sprite.rect.left = tile.rect.right if sprite._rect.top >= tile._rect.bottom: sprite.rect.top = tile.rect.bottom def recoge_ruby(self, motor, tile, sprite): self.puntos += 100 self.rubies -= 1 motor.set((tile.tx, tile.ty), 0) def mover_jugador(self, motor, sprite): teclas = p.key.get_pressed() if teclas[p.K_UP]: sprite.set_movedir(1) elif teclas[p.K_DOWN]: sprite.set_movedir(0) elif teclas[p.K_LEFT]: sprite.set_movedir(2) elif teclas[p.K_RIGHT]: sprite.set_movedir(3) sprite.update() def mover_enemigo(self, motor, sprite): if sprite.tile_changed(): caminos = sprite.next_are_free([0, 2, 3, 4]) if caminos: sprite.movedir = choice(caminos) else: sprite.reverse() sprite.update() def juego_terminado(self, motor, sprite, objeto): "Accede aquí en caso de colisión entre sprites." puntuaciones = High("media/puntuaciones/normal.dat") if puntuaciones.check(self.puntos) == None: # Aquí no alcanzo entrar. self.cambiar_escena(EscenaJuegoTerminado(self.puntos)) else: self.cambiar_escena(EscenaTeclado(self.puntos)) def actualizar(self): "Actualiza los objetos del juego." if self.rubies: self.motor.loop() else: self.juego_terminado(None, None, None) def dibujar(self, pantalla): "Dibujar objetos en pantalla." self.motor.paint(pantalla) fuente = p.font.Font(None, 36) puntuacion = fuente.render("%07d" % self.puntos, True, (255, 255, 255)) x = pantalla.get_size()[0] - puntuacion.get_width() y = pantalla.get_size()[1] - puntuacion.get_height() pantalla.blit(puntuacion, (x, y))
class EscenaJuego(Escena): "Clase que define la escena principal del videojuego." def __init__(self, puntos=0): global complejidad, densidad, nivel "Inicialización de las variables del videojuego." Escena.__init__(self) def array_load_level(self,z,bg=0): w, h = z.shape self.resize((w,h),bg) for y in range(0,h): for x in range(0,w): t = z[y,x] if t == 5: #jugador self.tlayer[y][x] = 0 self.clayer[y][x] = 1 elif t == 6: #enemigo self.tlayer[y][x] = 0 self.clayer[y][x] = 4 else : self.tlayer[y][x] = t self.clayer[y][x] = 0 return self.motor = Tilevid() Tilevid.array_load_level = array_load_level tiles = { 1: ('todos', self.tile_muro, None), 4: ('personaje', self.recoge_ruby, None), } self.motor.tga_load_tiles('media/niveles/tiles_ekmaze.tga', (TW, TH), tiles) self.maze = Maze(16, 16, complejidad, densidad) self.motor.array_load_level(self.maze.getMap(),0) complejidad += 0.05 densidad += 0.02 #Imágenes para los sprites. imagenes = [ #Sprites del jugador. ('lp_s1', 'media/sprites/lp_s1.gif', (0, 0, 24, 24) ), ('lp_s2', 'media/sprites/lp_s2.gif', (0, 0, 24, 24) ), ('lp_o1', 'media/sprites/lp_o1.gif', (0, 0, 24, 24) ), ('lp_o2', 'media/sprites/lp_o2.gif', (0, 0, 24, 24) ), ('lp_e1', 'media/sprites/lp_e1.gif', (0, 0, 24, 24) ), ('lp_e2', 'media/sprites/lp_e2.gif', (0, 0, 24, 24) ), ('lp_n1', 'media/sprites/lp_n1.gif', (0, 0, 24, 24) ), ('lp_n2', 'media/sprites/lp_n2.gif', (0, 0, 24, 24) ), #Sprites de los no-muertos. ('nm_s1', 'media/sprites/nm_s1.gif', (0, 0, 24, 24) ), ('nm_s2', 'media/sprites/nm_s2.gif', (0, 0, 24, 24) ), ('nm_o1', 'media/sprites/nm_o1.gif', (0, 0, 24, 24) ), ('nm_o2', 'media/sprites/nm_o2.gif', (0, 0, 24, 24) ), ('nm_e1', 'media/sprites/nm_e1.gif', (0, 0, 24, 24) ), ('nm_e2', 'media/sprites/nm_e2.gif', (0, 0, 24, 24) ), ('nm_n1', 'media/sprites/nm_n1.gif', (0, 0, 24, 24) ), ('nm_n2', 'media/sprites/nm_n2.gif', (0, 0, 24, 24) ), ] self.codigos = { 1: (self.crear_jugador, None), 4: (self.no_muerto, None), } self.motor.load_images(imagenes) self.motor.run_codes(self.codigos, (0, 0, 16, 16)) self.puntos = puntos self.puertas = 0 #Conteo inicial de puertas. for linea in self.motor.tlayer: for tile in linea: if tile == 4: self.puertas += 1 def crear_jugador(self, motor, tile, valor): "Función para crear el sprite animado del jugador." imagenes = [ ['lp_s1', 'lp_s2'], #Abajo ['lp_n1', 'lp_n2'], #Arriba ['lp_o1', 'lp_o2'], #Izquierda ['lp_e1', 'lp_e2'], #Derecha ] jugador = CharacterSprite(imagenes, (tile.rect.x+4, tile.rect.y+4), motor, 20) motor.sprites.append(jugador) jugador.loop = self.mover_jugador jugador.groups = motor.string2groups('todos,personaje') jugador.speed = 2 def no_muerto(self, motor, tile, valor): "Función para crear al paladín del imperio." imagenes = [ ['nm_s1', 'nm_s2'], #Abajo ['nm_n1', 'nm_n2'], #Arriba ['nm_o1', 'nm_o2'], #Izquierda ['nm_e1', 'nm_e2'], #Derecha ] no_muerto = CharacterSprite(imagenes, (tile.rect.x+4, tile.rect.y+4), motor, 20) motor.sprites.append(no_muerto) no_muerto.groups = motor.string2groups('todos') no_muerto.agroups = motor.string2groups('personaje') no_muerto.loop = self.mover_enemigo no_muerto.hit = self.juego_terminado no_muerto.speed = 2 no_muerto.set_movedir(0) def tile_muro(self, motor, tile, sprite): sprite.crashed = True if sprite._rect.bottom <= tile._rect.top: sprite.rect.bottom = tile.rect.top if sprite._rect.right <= tile._rect.left: sprite.rect.right = tile.rect.left if sprite._rect.left >= tile._rect.right: sprite.rect.left = tile.rect.right if sprite._rect.top >= tile._rect.bottom: sprite.rect.top = tile.rect.bottom def recoge_ruby(self, motor, tile, sprite): self.puntos += 100 self.puertas -= 1 motor.set((tile.tx, tile.ty), 0) def mover_jugador(self, motor, sprite): teclas = p.key.get_pressed() #caminos = sprite.next_are_free([0, 2, 3, 4]) #print caminos if teclas[p.K_UP]: sprite.set_movedir(1) elif teclas[p.K_DOWN]: sprite.set_movedir(0) elif teclas[p.K_LEFT]: sprite.set_movedir(2) elif teclas[p.K_RIGHT]: sprite.set_movedir(3) sprite.update() def mover_enemigo(self, motor, sprite): if sprite.tile_changed(): caminos = sprite.next_are_free([0, 2, 3, 4]) if caminos: sprite.movedir = choice(caminos) else: sprite.reverse() sprite.update() def juego_terminado(self, motor, sprite, objeto): global nivel, complejidad, densidad "Accede aquí en caso de colisión entre sprites." if self.puntos > 0 and ((self.puntos - nivel) == 100): #seguimos jugando nivel += 100 self.cambiar_escena(EscenaJuego(self.puntos)) else: nivel = 0 complejidad = 0.10 densidad = 0.20 puntuaciones = High('media/puntuaciones/normal.dat') if puntuaciones.check(self.puntos) == None: #Aquí no alcanzo entrar. self.cambiar_escena(EscenaJuegoTerminado(self.puntos)) else: self.cambiar_escena(EscenaTeclado(self.puntos)) def actualizar(self): "Actualiza los objetos del juego." if self.puertas: self.motor.loop() else: self.juego_terminado(None, None, None) def dibujar(self, pantalla): "Dibujar objetos en pantalla." self.motor.paint(pantalla) fuente = p.font.Font(None, 36) puntuacion = fuente.render('%07d' % self.puntos, True, (255,255,255)) x = pantalla.get_size()[0] - puntuacion.get_width() y = pantalla.get_size()[1] - puntuacion.get_height() pantalla.blit(puntuacion, (x, y)) # fog of war # get coordinates from player current pos for sprite in self.motor.sprites: if sprite.imglists[0][0] =='lp_s1': coords = [sprite.rect.x,sprite.rect.y] break s = p.Surface((480, 480), flags=p.SRCALPHA) for y in range(0, 480, 16): for x in range(0, 480, 16): fog1 = (x-coords[0])*(x-coords[0]) + (y-coords[1])*(y-coords[1]) fog = fog1/200 if fog > 225: fog = 225 p.draw.rect(s, (0, 0, 0, fog), (x, y, 16, 16), 16) pantalla.blit(s, (32, 32))