def __init__(self, x, y, message, imgFile, name=''): self.start = (x, y) self.X = x self.Y = y self.images = images.loadNPC(imgFile) pygame.sprite.Sprite.__init__(self) #call Sprite intializer self.imgIdx = 2 self.stepIdx = 0 self.image = self.images[self.imgIdx] self.dir = 'down' self.moving = False self.message = message self.setRect(x * const.blocksize, y * const.blocksize, const.blocksize, const.blocksize) self.movingRate = 20 self.moveQueue = queue.Queue() self.name = name
def __init__(self, cPos): self.cursorPos = cPos self.currentTile = 0 self.sideImg, sideRect = load_image.load_image('sidebar.bmp') self.npcImg = {} npcAvatar = pygame.Surface((const.blocksize, const.blocksize)) for n in npcScr.npcList: npcImgFilename = n + '.bmp' npcImgs = images.loadNPC(npcImgFilename) self.npcImg[n] = npcImgs[2] #self.npcImg, npcR = load_image('npc.bmp') self.drawMode = False self.cursorColor = colors.white self.offset = 0 self.numImages = len(mapImages) self.topX = 0 self.topY = 0 self.visited = [] self.BFSQueue = queue.Queue() self.mouseAction = 'draw' self.drawLayers = ['fore', 'back'] self.drawLayer = self.drawLayers[0] self.selecting = False self.selectBoxPoints = None self.placeNPC = False self.myMap = myWorld.currentMap self.editorImages = range(7) editorSpriteSheet = spritesheet.spritesheet('editorsheet.bmp') for i in range(7): self.editorImages[i] = editorSpriteSheet.image_at( (i * const.blocksize, 0, const.blocksize, const.blocksize), -1)
def __init__(self, cPos): self.cursorPos = cPos self.currentTile = 0 self.sideImg, sideRect = load_image.load_image('sidebar.bmp') self.npcImg = {} npcAvatar = pygame.Surface((const.blocksize, const.blocksize)) for n in npcScr.npcList: npcImgFilename = n+'.bmp' npcImgs = images.loadNPC(npcImgFilename) self.npcImg[ n ] = npcImgs[2] #self.npcImg, npcR = load_image('npc.bmp') self.drawMode = False self.cursorColor = colors.white self.offset = 0 self.numImages = len(mapImages) self.topX = 0 self.topY = 0 self.visited = [] self.BFSQueue = queue.Queue() self.mouseAction = 'draw' self.drawLayers = ['fore', 'back'] self.drawLayer = self.drawLayers[0] self.selecting = False self.selectBoxPoints = None self.placeNPC = False self.myMap = myWorld.currentMap self.editorImages = range(7) editorSpriteSheet = spritesheet.spritesheet('editorsheet.bmp') for i in range(7): self.editorImages[i] = editorSpriteSheet.image_at((i*const.blocksize, 0, const.blocksize, const.blocksize), -1 )