def LoadSprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE/2) y_offset = (BLOCK_SIZE/2) """Load the level""" level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() """Create the Pellet group""" self.pellet_sprites = pygame.sprite.Group() """Create the block group""" self.block_sprites = pygame.sprite.Group() for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x*BLOCK_SIZE)+x_offset,(y*BLOCK_SIZE+y_offset)] if layout[y][x]==level1.BLOCK: block = basicSprite.Sprite(centerPoint, img_list[level1.BLOCK]) self.block_sprites.add(block) elif layout[y][x]==level1.SNAKE: self.snake = Snake(centerPoint,img_list[level1.SNAKE]) elif layout[y][x]==level1.PELLET: pellet = basicSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderPlain((self.snake))
def LoadSprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE / 2) y_offset = (BLOCK_SIZE / 2) """Load the level""" level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() """Create the Pellet group""" self.pellet_sprites = pygame.sprite.Group() """Create the block group""" self.block_sprites = pygame.sprite.Group() for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x * BLOCK_SIZE) + x_offset, (y * BLOCK_SIZE + y_offset)] if layout[y][x] == level1.BLOCK: block = basicSprite.Sprite(centerPoint, img_list[level1.BLOCK]) self.block_sprites.add(block) elif layout[y][x] == level1.SNAKE: self.snake = Snake(centerPoint, img_list[level1.SNAKE]) elif layout[y][x] == level1.PELLET: pellet = basicSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderPlain((self.snake))
def LoadSprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE / 2) y_offset = (BLOCK_SIZE / 2) """Load the level""" level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() # > The pellet sprites are grouped # > The block sprites are grouped # > The Wall sprites are grouped # > This is an example of a style of Object Oriented Programming, assigning # > The groups of items as a bluprint of one object to save typing the # > same code over and over. self.pellet_sprites = pygame.sprite.Group() self.block_sprites = pygame.sprite.Group() self.gwall_sprites = pygame.sprite.Group() for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x * BLOCK_SIZE) + x_offset, (y * BLOCK_SIZE + y_offset)] if layout[y][x] == level1.BLOCK: self.block_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.BLOCK])) elif layout[y][x] == level1.GWALL: self.gwall_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.GWALL])) elif layout[y][x] == level1.SNAKE: self.snake = Snake(centerPoint, img_list[level1.SNAKE]) elif layout[y][x] == level1.PELLET: self.pellet_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.PELLET])) elif layout[y][x] == level1.GHOST: self.ghost = Ghost(centerPoint, img_list[level1.GHOST]) elif layout[y][x] == level1.GHOST2: self.ghost2 = Ghost(centerPoint, img_list[level1.GHOST2]) elif layout[y][x] == level1.GHOST3: self.ghost3 = Ghost(centerPoint, img_list[level1.GHOST3]) elif layout[y][x] == level1.GHOST4: self.ghost4 = Ghost(centerPoint, img_list[level1.GHOST4]) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderPlain((self.snake)) self.ghost_sprites = pygame.sprite.RenderPlain((self.ghost)) self.ghost2_sprites = pygame.sprite.RenderPlain((self.ghost2)) self.ghost3_sprites = pygame.sprite.RenderPlain((self.ghost3)) self.ghost4_sprites = pygame.sprite.RenderPlain((self.ghost4))
def load_sprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (self.BLOCK_SIZE / 2) y_offset = (self.BLOCK_SIZE / 2) """Load the level""" level1 = level001.level() # layout = level1.getLayout() img_list = level1.getSprites() self.pellet_sprites = pygame.sprite.Group() self.block_sprites = pygame.sprite.Group() self.gwall_sprites = pygame.sprite.Group() for y in range(len(self.initial_layout)): for x in range(len(self.initial_layout[y])): """Get the center point for the rects""" centerPoint = [(x * self.BLOCK_SIZE) + x_offset, (y * self.BLOCK_SIZE + y_offset)] # print centerPoint if self.initial_layout[y][x] == level1.BLOCK: self.block_sprites.add( basic_sprite.Sprite(centerPoint, img_list[level1.BLOCK])) elif self.initial_layout[y][x] == level1.GWALL: self.gwall_sprites.add( basic_sprite.Sprite(centerPoint, img_list[level1.GWALL])) elif self.initial_layout[y][x] == level1.SNAKE: self.pacman = Pacman(centerPoint, img_list[level1.SNAKE], self.map_manager, self.PACMAN_SPEED) elif self.initial_layout[y][x] == level1.PELLET: self.pellet_sprites.add( basic_sprite.Sprite(centerPoint, img_list[level1.PELLET])) elif self.initial_layout[y][x] == level1.GHOST: self.ghost = Ghost(centerPoint, img_list[level1.GHOST]) elif self.initial_layout[y][x] == level1.GHOST2: self.ghost2 = Ghost(centerPoint, img_list[level1.GHOST2]) elif self.initial_layout[y][x] == level1.GHOST3: self.ghost3 = Ghost(centerPoint, img_list[level1.GHOST3]) elif self.initial_layout[y][x] == level1.GHOST4: self.ghost4 = Ghost(centerPoint, img_list[level1.GHOST4]) self.pacman_sprites = pygame.sprite.RenderPlain(self.pacman) self.ghost_sprites = pygame.sprite.RenderPlain(self.ghost) self.ghost2_sprites = pygame.sprite.RenderPlain(self.ghost2) self.ghost3_sprites = pygame.sprite.RenderPlain(self.ghost3) self.ghost4_sprites = pygame.sprite.RenderPlain(self.ghost4)
def LoadSprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE / 2) y_offset = (BLOCK_SIZE / 2) """Load the level""" level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() self.pellet_sprites = pygame.sprite.Group() self.block_sprites = pygame.sprite.Group() self.gwall_sprites = pygame.sprite.Group() for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x * BLOCK_SIZE) + x_offset, (y * BLOCK_SIZE + y_offset)] if layout[y][x] == level1.BLOCK: self.block_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.BLOCK])) elif layout[y][x] == level1.GWALL: self.gwall_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.GWALL])) elif layout[y][x] == level1.SNAKE: self.snake = Snake(centerPoint, img_list[level1.SNAKE]) elif layout[y][x] == level1.PELLET: self.pellet_sprites.add( basicSprite.Sprite(centerPoint, img_list[level1.PELLET])) elif layout[y][x] == level1.GHOST: self.ghost = Ghost(centerPoint, img_list[level1.GHOST]) elif layout[y][x] == level1.GHOST2: self.ghost2 = Ghost(centerPoint, img_list[level1.GHOST2]) elif layout[y][x] == level1.GHOST3: self.ghost3 = Ghost(centerPoint, img_list[level1.GHOST3]) elif layout[y][x] == level1.GHOST4: self.ghost4 = Ghost(centerPoint, img_list[level1.GHOST4]) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderPlain((self.snake)) self.ghost_sprites = pygame.sprite.RenderPlain((self.ghost)) self.ghost2_sprites = pygame.sprite.RenderPlain((self.ghost2)) self.ghost3_sprites = pygame.sprite.RenderPlain((self.ghost3)) self.ghost4_sprites = pygame.sprite.RenderPlain((self.ghost4))
def LoadSprites(self): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE/2) y_offset = (BLOCK_SIZE/2) """Load the level""" level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() """Create the Pellet group""" self.pellet_sprites = pygame.sprite.RenderUpdates() self.super_pellet_sprites = pygame.sprite.RenderUpdates() """Create the block group""" self.block_sprites = pygame.sprite.RenderUpdates() self.monster_sprites = pygame.sprite.RenderUpdates() for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x*BLOCK_SIZE)+x_offset,(y*BLOCK_SIZE+y_offset)] if layout[y][x]==level1.BLOCK: block = basicSprite.Sprite(centerPoint, img_list[level1.BLOCK]) self.block_sprites.add(block) elif layout[y][x]==level1.SNAKE: self.snake = Snake(centerPoint,img_list[level1.SNAKE]) elif layout[y][x]==level1.PELLET: pellet = basicSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) elif layout[y][x]==level1.MONSTER: monster = Monster(centerPoint, img_list[level1.MONSTER] , img_list[level1.SCARED_MONSTER]) self.monster_sprites.add(monster) """We also need pellets where the monsters are""" pellet = basicSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) elif layout[y][x]==level1.SUPER_PELLET: super_pellet = basicSprite.Sprite(centerPoint, img_list[level1.SUPER_PELLET]) self.super_pellet_sprites.add(super_pellet) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderUpdates(self.snake)
def __load_sprites(self): x_offset = (config.block_size/2) y_offset = (config.block_size/2) ##getting layout and images for level one level1 = level001.level() layout = level1.get_layout() images = level1.get_image_paths() self.gwall_sprites = pygame.sprite.Group() self.block_sprites = pygame.sprite.Group() self.pellet_sprites = pygame.sprite.Group() #blinky, inky, pinky, clyde self.enemies = list() self.enemies_sprites = pygame.sprite.Group() self.__load_level(x_offset, y_offset, level1, layout, images) self.pacman_sprite = pygame.sprite.RenderPlain((self.pacman)) for ghost in self.enemies: self.enemies_sprites.add(ghost)
def __load_sprites(self): x_offset = (config.block_size / 2) y_offset = (config.block_size / 2) ##getting layout and images for level one level1 = level001.level() layout = level1.get_layout() images = level1.get_image_paths() self.gwall_sprites = pygame.sprite.Group() self.block_sprites = pygame.sprite.Group() self.pellet_sprites = pygame.sprite.Group() #blinky, inky, pinky, clyde self.enemies = list() self.enemies_sprites = pygame.sprite.Group() self.__load_level(x_offset, y_offset, level1, layout, images) self.pacman_sprite = pygame.sprite.RenderPlain((self.pacman)) for ghost in self.enemies: self.enemies_sprites.add(ghost)
def LoadSprites(self): x_offset = (BLOCK_SIZE / 2) y_offset = (BLOCK_SIZE / 2) level1 = level001.level() layout = level1.getLayout() img_list = level1.getSprites() self.pellet_sprites = pygame.sprite.RenderUpdates() self.block_sprites = pygame.sprite.RenderUpdates() self.monster_sprites = pygame.sprite.RenderUpdates() self.super_pellet_sprites = pygame.sprite.RenderUpdates() for y in range(len(layout)): for x in range(len(layout[y])): centerPoint = [(x * BLOCK_SIZE) + x_offset, (y * BLOCK_SIZE + y_offset)] if layout[y][x] == level1.BLOCK: block = centerSprite.Sprite(centerPoint, img_list[level1.BLOCK]) self.block_sprites.add(block) elif layout[y][x] == level1.PLAYER: self.player = Player(centerPoint, img_list[level1.PLAYER]) elif layout[y][x] == level1.PELLET: pellet = centerSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) elif layout[y][x] == level1.BLINKY: blinky = Monster(centerPoint, img_list[level1.BLINKY], img_list[level1.SCARED_MONSTER]) self.monster_sprites.add(blinky) pellet = centerSprite.Sprite(centerPoint, img_list[level1.PELLET]) self.pellet_sprites.add(pellet) elif layout[y][x] == level1.SUPER_PELLET: super_pellet = centerSprite.Sprite( centerPoint, img_list[level1.SUPER_PELLET]) self.super_pellet_sprites.add(super_pellet) self.player_sprites = pygame.sprite.RenderUpdates(self.player)
def __init__(self, width=640, height=480): """Initialize""" pygame.init() self.start = time.time() self.end = time.time() self.elapsed_time = 0 """Set the window Size""" self.width = width self.height = height """Create the Screen""" self.screen = pygame.display.set_mode((self.width, self.height)) pygame.display.set_caption("AI playing PacMan in style!") self.isGameOver = False self.initial_layout = level001.level().getLayout() self.learner = q_learner.QLearner() self.map_manager = map_manager.MapManager(self.initial_layout) self.pacman = None self.game_counter = 1 self.score = 0 self.record = 0 self.frame_count_since_last_decision = 0 self.frame_count_threshold = self.BLOCK_SIZE / self.PACMAN_SPEED * self.DECISION_TIMEOUT_CONSTANT
def LoadSprites(self): '''Load the sprites that we need''' x_offset = BLOCK_SIZE / 2 y_offset = BLOCK_SIZE / 2 level1 = level001.level() layout = level1.getLayout() img_list = level1.getImages() self.pellet_sprites = pygame.sprite.RenderUpdates() self.block_sprites = pygame.sprite.RenderUpdates() self.super_pellet_sprites = pygame.sprite.RenderUpdates() self.monster_sprites = pygame.sprite.RenderUpdates() for y in range(len(layout)): for x in range(len(layout[y])): centerPoint = [(x * BLOCK_SIZE) + x_offset, (y * BLOCK_SIZE) + y_offset] if layout[y][x] == level1.block: block = basicSprite.Sprite(centerPoint, img_list[level1.block]) self.block_sprites.add(block) elif layout[y][x] == level1.pellet: pellet = basicSprite.Sprite(centerPoint, img_list[level1.pellet]) self.pellet_sprites.add(pellet) elif layout[y][x] == level1.snake: self.snake = Snake(centerPoint, img_list[level1.snake]) elif layout[y][x] == level1.monster: monster = Monster(centerPoint, img_list[level1.monster], img_list[level1.scared_monster]) self.monster_sprites.add(monster) elif layout[y][x] == level1.super_pellet: super_pellet = basicSprite.Sprite( centerPoint, img_list[level1.super_pellet]) self.super_pellet_sprites.add(super_pellet) self.snake_sprites = pygame.sprite.RenderUpdates((self.snake))
import basic_sprite from helpers import * import level001 import map_manager import numpy as np BLOCK_SIZE = 24 x_offset = (BLOCK_SIZE / 2) y_offset = (BLOCK_SIZE / 2) level1 = level001.level() layout = level1.getLayout()[2:] layout = [row[1:-1] for row in layout] class Pacman(basic_sprite.Sprite): """This is our snake that will move around the screen""" def __init__(self, centerPoint, image, map_manager: map_manager, speed): basic_sprite.Sprite.__init__(self, centerPoint, image) """Initialize the number of pellets eaten""" self.pellets = 0 self.did_eat = False self.is_dead = False """Set the number of Pixels to move each time""" self.speed = speed # """Initialize how much we are moving""" self.xMove = 0 self.yMove = 0 self.score = 0
def LoadSprites(self, level): """Load all of the sprites that we need""" """calculate the center point offset""" x_offset = (BLOCK_SIZE/2) y_offset = (BLOCK_SIZE/2) """Load the level""" if level == 1: level1 = level001.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 2: level1 = level002.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 3: level1 = level003.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 4: level1 = level004.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 5: level1 = level005.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 6: level1 = level006.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 7: level1 = level007.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 8: level1 = level008.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 9: level1 = level009.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif level == 10: level1 = level010.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() elif (level > 10 and level <= self.maxlevels): level1 = level001.level() layout = self.newlevels[level-11].getLayout() self.letters = self.newlevels[level-11].getNome() picture, rect = load_image(self.newlevels[level-11].getPicname(),-1) figura = basicSprite.Sprite([640,300],picture,'IMG') elif level > self.maxlevels: if pygame.font: z = 0; self.background.fill((0,0,0)) self.pellet_sprites.empty() self.snake_sprites.empty() self.alphabet_sprites.empty() self.alphabet_csprites.empty() self.figura_sprites.empty() self.block_sprites.empty() self.Loadfundo() self.screen.blit(self.background, (0, 0)) pygame.display.flip() font = pygame.font.Font('font.ttf', 24) text = font.render("Parabéns!!! Você ganhou o Jogo!!!!!", 1, (255, 0, 0)) text2 = font.render("Pressione 'Q' Para Sair ou Qualquer Tecla para Reiniciar", 1, (255, 0, 0)) text3 = font.render("Sua pontuação foi: %s" % self.pontos, 1, (255, 0, 0)) textpos = text.get_rect(centerx=self.background.get_width()/2) textpos.centery += 10 textpos2 = text.get_rect(centerx=self.background.get_width()/2) textpos2.centerx = textpos.centerx - 70 textpos2.centery = textpos.centery + 500 textpos3 = text3.get_rect(centerx=self.background.get_width()/2) textpos3.centery = textpos2.centery - 90 self.screen.blit(text, textpos) self.screen.blit(text2, textpos2) self.screen.blit(text3, textpos3) won, rect = load_image('figuras/parabens.jpg') ganhou = basicSprite.Sprite([400,230],won,'LS') won_group = pygame.sprite.Group(ganhou) won_group.draw(self.screen) pygame.display.flip() while z==0: for event in pygame.event.get(): if event.type == pygame.QUIT: sys.exit() elif event.type == KEYDOWN: if event.key == pygame.K_q: sys.exit() else: self.cur_level = 1; level1 = level001.level() layout = level1.getLayout() self.letters = level1.getName() figura = level1.getPicture() self.background.fill((0,0,0)) pygame.display.flip() self.screen.blit(self.background, (0, 0)) self.pontos = 0; z=1; """Create the Pellet group""" self.xcolpos = 30; self.pellet_sprites = pygame.sprite.Group() self.alphabet_csprites = pygame.sprite.Group() """Create the block group""" self.block_sprites = pygame.sprite.Group() self.alphabet_sprites = pygame.sprite.Group() self.figura_sprites = pygame.sprite.Group() self.figura_sprites.add(figura) for y in xrange(len(layout)): for x in xrange(len(layout[y])): """Get the center point for the rects""" centerPoint = [(x*BLOCK_SIZE)+x_offset,(y*BLOCK_SIZE+y_offset)] if layout[y][x]==level1.BLOCK: block = basicSprite.Sprite(centerPoint, self.img_list[1][level%6],'BL') self.block_sprites.add(block) elif layout[y][x]==level1.SNAKE: self.snake = Snake(centerPoint,self.img_list[2]) elif layout[y][x]==level1.PELLET: self.fim = basicSprite.Sprite(centerPoint, self.img_list[0],'END') self.pellet_sprites.add(self.fim) elif layout[y][x]==level1.letterA: letterA = basicSprite.Sprite(centerPoint,self.img_list[3],'A') self.alphabet_sprites.add(letterA) elif layout[y][x]==level1.letterB: letterB = basicSprite.Sprite(centerPoint,self.img_list[4],'B') self.alphabet_sprites.add(letterB) elif layout[y][x]==level1.letterC: letterC = basicSprite.Sprite(centerPoint,self.img_list[5],'C') self.alphabet_sprites.add(letterC) elif layout[y][x]==level1.letterCD: letterCD = basicSprite.Sprite(centerPoint,self.img_list[6],'1') self.alphabet_sprites.add(letterCD) elif layout[y][x]==level1.letterD: letterD = basicSprite.Sprite(centerPoint,self.img_list[7],'D') self.alphabet_sprites.add(letterD) elif layout[y][x]==level1.letterE: letterE = basicSprite.Sprite(centerPoint,self.img_list[8],'E') self.alphabet_sprites.add(letterE) elif layout[y][x]==level1.letterF: letterF = basicSprite.Sprite(centerPoint,self.img_list[9],'F') self.alphabet_sprites.add(letterF) elif layout[y][x]==level1.letterG: letterG = basicSprite.Sprite(centerPoint,self.img_list[10],'G') self.alphabet_sprites.add(letterG) elif layout[y][x]==level1.letterH: letterH = basicSprite.Sprite(centerPoint,self.img_list[11],'H') self.alphabet_sprites.add(letterH) elif layout[y][x]==level1.letterI: letterI = basicSprite.Sprite(centerPoint,self.img_list[12],'I') self.alphabet_sprites.add(letterI) elif layout[y][x]==level1.letterJ: letterJ = basicSprite.Sprite(centerPoint,self.img_list[13],'J') self.alphabet_sprites.add(letterJ) elif layout[y][x]==level1.letterK: letterK = basicSprite.Sprite(centerPoint,self.img_list[14],'K') self.alphabet_sprites.add(letterK) elif layout[y][x]==level1.letterL: letterL = basicSprite.Sprite(centerPoint,self.img_list[15],'L') self.alphabet_sprites.add(letterL) elif layout[y][x]==level1.letterM: letterM = basicSprite.Sprite(centerPoint,self.img_list[16],'M') self.alphabet_sprites.add(letterM) elif layout[y][x]==level1.letterN: letterN = basicSprite.Sprite(centerPoint,self.img_list[17],'N') self.alphabet_sprites.add(letterN) elif layout[y][x]==level1.letterO: letterO = basicSprite.Sprite(centerPoint,self.img_list[18],'O') self.alphabet_sprites.add(letterO) elif layout[y][x]==level1.letterP: letterP = basicSprite.Sprite(centerPoint,self.img_list[19],'P') self.alphabet_sprites.add(letterP) elif layout[y][x]==level1.letterQ: letterQ = basicSprite.Sprite(centerPoint,self.img_list[20],'Q') self.alphabet_sprites.add(letterQ) elif layout[y][x]==level1.letterR: letterR = basicSprite.Sprite(centerPoint,self.img_list[21],'R') self.alphabet_sprites.add(letterR) elif layout[y][x]==level1.letterS: letterS = basicSprite.Sprite(centerPoint,self.img_list[22],'S') self.alphabet_sprites.add(letterS) elif layout[y][x]==level1.letterT: letterT = basicSprite.Sprite(centerPoint,self.img_list[23],'T') self.alphabet_sprites.add(letterT) elif layout[y][x]==level1.letterU: letterU = basicSprite.Sprite(centerPoint,self.img_list[24],'U') self.alphabet_sprites.add(letterU) elif layout[y][x]==level1.letterV: letterV = basicSprite.Sprite(centerPoint,self.img_list[25],'V') self.alphabet_sprites.add(letterV) elif layout[y][x]==level1.letterX: letterX = basicSprite.Sprite(centerPoint,self.img_list[26],'X') self.alphabet_sprites.add(letterX) elif layout[y][x]==level1.letterY: letterY = basicSprite.Sprite(centerPoint,self.img_list[27],'Y') self.alphabet_sprites.add(letterY) elif layout[y][x]==level1.letterW: letterW = basicSprite.Sprite(centerPoint,self.img_list[28],'W') self.alphabet_sprites.add(letterW) elif layout[y][x]==level1.letterZ: letterZ = basicSprite.Sprite(centerPoint,self.img_list[29],'Z') self.alphabet_sprites.add(letterZ) elif layout[y][x]==level1.letterAT: letterAT = basicSprite.Sprite(centerPoint,self.img_list[30],'2') self.alphabet_sprites.add(letterAT) """Create the Snake group""" self.snake_sprites = pygame.sprite.RenderPlain((self.snake))