def __init__(self, bor): # self.currnet_idx = 16 self.currnet_idx = 19 texte = text.Text(bor) texte.set_text(10, 1, "XD XD XD XD") self.effects = [ texte, # 0 pixels.Pixels(bor), # 1 rainbow.Rainbow(bor), # 2 sinrainbow2.SinRainbow2(bor), # 3 sinrainbow.SinRainbow(bor), # 4 # tetris.Tetris(10, 10), metaballs.Metaballs(bor), # 5 disco.Disco(), # 6 pulsingcolor.PulsingColor(Color.blue()), # 7 xdcolor.XDColor(Color.red()), # 8 xdcolor.XDColor(Color.green()), # 9 xdcolor.XDColor(Color.blue()), # 10 solidcolor.SolidColor(Color.black()), # 11 droplet.Droplet(bor), # 12 paint.Paint(bor), # 13 tennis.Tennis(bor), # 14 rays.Rays(bor), # 15 plasma.Plasma(bor), # 16 #GifPlayer('/home/pi/xD-Table-Py/effects/gifplayer/gifs/fireplace_smol.gif'), # 17 GifPlayer( '/home/pi/xD-Table-Py/effects/gifplayer/gifs/fireplace_doniel.gif' ), # 17 rainbow_slow.RainbowSlow(bor), # 18 kibana.Heatmap(), # 19 ]
def __call__(self, mapgen): mapgen.plasma = plasma.Plasma() for x in range(mapgen.width): for y in range(mapgen.height): if mapgen.plasma.map[x][y] < self.loground: mapgen.gb.map[x][y].floor = maps.WATER elif mapgen.plasma.map[x][y] < self.higround: mapgen.gb.map[x][y].floor = maps.LOGROUND mapgen.gb.map[x][y].wall = True else: mapgen.gb.map[x][y].floor = maps.HIGROUND mapgen.gb.map[x][y].wall = True
def __call__( self, mapgen ): mapgen.plasma = plasma.Plasma() for x in range( mapgen.width ): for y in range( mapgen.height ): if mapgen.plasma.map[x][y] < self.loground: mapgen.gb._map[x][y].floor = self.loterr elif mapgen.plasma.map[x][y] < self.higround: mapgen.gb._map[x][y].floor = self.medterr mapgen.gb._map[x][y].wall = True else: mapgen.gb._map[x][y].floor = self.hiterr mapgen.gb._map[x][y].wall = True
def __call__( self, mapgen ): if not hasattr( mapgen, "plasma" ): mapgen.plasma = plasma.Plasma() for x in range( mapgen.width ): for y in range( mapgen.height ): if mapgen.gb.map[x][y].wall is True: if x%3 == 0 and y%3 == 0 and self.four_true_walls(mapgen,x,y) and random.triangular(0.3,1.0,0.90) < mapgen.plasma.map[x][y]: mapgen.gb.map[x][y].wall = maps.MOUNTAIN_TOP mapgen.gb.map[x+1][y].wall = maps.MOUNTAIN_RIGHT mapgen.gb.map[x][y+1].wall = maps.MOUNTAIN_LEFT mapgen.gb.map[x+1][y+1].wall = maps.MOUNTAIN_BOTTOM elif self.water_nearby( mapgen, x, y ): if random.randint(1,3) != 2: mapgen.gb.map[x][y].wall = maps.ROCKS else: mapgen.gb.map[x][y].wall = None else: if mapgen.plasma.map[x][y] < self.treeline: mapgen.gb.map[x][y].wall = maps.TREES else: mapgen.gb.map[x][y].wall = maps.ROCKS