def createDrill(name, icon, spriteN, spriteE, spriteS, spriteW): (j.MiningDrill(name) .rotatable(True) .miningSpeed(1) .item( j.Item(name + "-item") .sprite( j.Sprite() .load(icon) ) ) .sprite(addSprite(spriteN)) .spriteE(addSprite(spriteE)) .spriteS(addSprite(spriteS)) .spriteW(addSprite(spriteW)) .tileWidth(3) .tileHeight(3) # resource output: up, right, down left # <U> # [0] [ ] [ ] # <L> [ ] [ ] [ ] <R> # [ ] [ ] [ ] # <D> .resourceOutput(j._OutputTile4Way( ( (1, -1), (3, 1), (1, 3), (-1, 1) ) )) )
def addItem(name, path): (j.Item(name) .sprite(j.Sprite() .load(path) .group([j.spriteGroup.Gui]) ) )
def addInserter(name, itemSprite, worldSprite, handSprite, armSprite, rotationSpeed, tileReach): (j.Inserter(name).rotationSpeed(rotationSpeed).rotatable(True).tileReach( tileReach).sprite(j.Sprite().load(worldSprite).sets(4).frames( 1).invertSetFrame(True)).handSprite( j.Sprite().load(handSprite)).armSprite( j.Sprite().load(armSprite)).item( j.Item(name + "-item").sprite( j.Sprite().load(itemSprite))))
def addResourceEntity(noiseLayer, endRange, name, tileSpritePath, itemSpritePath): # Item for resource product = (j.Item(name + "-item").sprite( j.Sprite().load(itemSpritePath).group( [j.spriteGroup.Terrain, j.spriteGroup.Gui]))) resourceTile = (j.ResourceEntity().sprite( j.Sprite().load(tileSpritePath).group([j.spriteGroup.Terrain ])).item(product)) # Add resource tile to NoiseLayer noiseLayer.add(endRange, resourceTile)
def addBelt(name, iconSpritePath, worldSpritePath): (j.TransportBelt(name) .item( j.Item(name + "-item") .sprite( j.Sprite() .load(iconSpritePath) ) ) .sprite( j.Sprite() .load(worldSpritePath) .frames(16) .sets(20) .trim(16) ) .speed(0.05) .rotatable(True) )
def addContainer(name, invSize, health, worldSprite, itemSprite): (j.ContainerEntity(name) .tileWidth(1) .tileHeight(1) .maxHealth(health) .inventorySize(invSize) .pickupTime(0.1) .sprite( j.Sprite() .load(worldSprite) ) .item( j.Item(name + "-item") .sprite( j.Sprite() .load(itemSprite) ) ) )
def addAssemblyMachine(name, iconSpritePath, worldSpritePath): (j.AssemblyMachine(name) .item( j.Item(name + "-item") .sprite( j.Sprite() .load(iconSpritePath) ) ) .sprite( j.Sprite() .load(worldSpritePath) .frames(8) .sets(4) .trim(2) ) .tileWidth(3) .tileHeight(3) .pickupTime(0.1) .assemblySpeed(1) .rotatable(True) )
def createSplitter(name, icon, spriteN, spriteE, spriteS, spriteW): (j.Splitter(name).rotatable(True).item( j.Item(name + "-item").sprite(j.Sprite().load(icon))).sprite( addSprite(spriteN)).spriteE(addSprite(spriteE)).spriteS( addSprite(spriteS)).spriteW( addSprite(spriteW)).tileWidth(2).tileHeight(1))