def g_nums(base, xsize, ysize, dx_offset, dy_offset): sprites = {} for x in range(xsize): for y in range(ysize): sprites[x,y] = base + x * dx_offset + y * dy_offset return sprites north = g_nums(9, 3, 3, -3, -1) west = g_nums(16, 3, 3, 1, -3) south = g_nums(19, 3, 3, 3, 1) east = g_nums(30, 3, 3, -1, 3) dirs = [("north", north), ("east", east), ("south", south), ("west", west)] print("\tride {") for dx in range(3): for dy in range(3): print("\t\tvoxel {") print("\t\t\tdx: {}; dy: {}; dz: 0;".format(dx, dy)) print() for dn, ds in dirs: print("\t\t\t{}: sprite {{".format(dn)) print("\t\t\t\tx_base: 0; y_base: 0;") sn = ds[dx, dy] print("\t\t\t\tfile: \"../sprites/ride_shops/ride_3x3_carousel/64_{:04d}.png\";".format(sn)) print("\t\t\t\trecolour: \"../sprites/ride_shops/ride_3x3_carousel/64p_{:04d}.png\";".format(sn)) print("\t\t\t\tx_offset: -32; y_offset: -97; width: 64; height: 128;") print("\t\t\t}") print("\t\t}") print("\t}")