def updateChar(self, pos, char, hit=None): self.getImports() global getNewRender #from game import getNewRender pos = tuple(pos) oldline = self.niceMap[pos[1]-1] newline = [] _x = 0 #print pos[0] #print oldline[pos[0]-1] for i in oldline: _x += 1 if _x == pos[0]: newline.append(char) #CHAR else: newline.append(i) #print newline self.niceMap[pos[1]-1] = ''.join(newline) #print self.niceMap[pos[1]-1] if hit != None: #Update hitmap (should be tuplez) self.hitMap[(pos[1]-1, pos[0]-1)] = hit #print self.hitMap[(pos[1]-1, pos[0]-1)] #GETNEWREND = True getNewRender()
def updateChar(self, pos, char, hit=None): self.getImports() global getNewRender #from game import getNewRender pos = tuple(pos) oldline = self.niceMap[pos[1] - 1] newline = [] _x = 0 #print pos[0] #print oldline[pos[0]-1] for i in oldline: _x += 1 if _x == pos[0]: newline.append(char) #CHAR else: newline.append(i) #print newline self.niceMap[pos[1] - 1] = ''.join(newline) #print self.niceMap[pos[1]-1] if hit != None: #Update hitmap (should be tuplez) self.hitMap[(pos[1] - 1, pos[0] - 1)] = hit #print self.hitMap[(pos[1]-1, pos[0]-1)] #GETNEWREND = True getNewRender()
def unmodifyChar(self, pos): self.getImports() global getNewRender if tuple(pos) in self.modify.keys(): del self.modify[tuple(pos)] getNewRender()
def modifyChar(self, pos, char): self.getImports() global getNewRender self.modify[tuple(pos)] = char getNewRender()