Loading

Paste #p1l0ufpfh

  1. def g_nums(base, xsize, ysize, dx_offset, dy_offset):
  2.     sprites = {}
  3.     for x in range(xsize):
  4.         for y in range(ysize):
  5.             sprites[x,y] = base + x * dx_offset + y * dy_offset
  6.     return sprites
  7.  
  8. north = g_nums(9, 3, 3, -3, -1)
  9. west = g_nums(16, 3, 3, 1, -3)
  10. south = g_nums(19, 3, 3, 3, 1)
  11. east = g_nums(30, 3, 3, -1, 3)
  12.  
  13. dirs = [("north", north), ("east", east), ("south", south), ("west", west)]
  14. print("\tride {")
  15. for dx in range(3):
  16.     for dy in range(3):
  17.         print("\t\tvoxel {")
  18.         print("\t\t\tdx: {}; dy: {}; dz: 0;".format(dx, dy))
  19.         print()
  20.         for dn, ds in dirs:
  21.             print("\t\t\t{}: sprite {{".format(dn))
  22.             print("\t\t\t\tx_base: 0; y_base: 0;")
  23.             sn = ds[dx, dy]
  24.             print("\t\t\t\tfile: \"../sprites/ride_shops/ride_3x3_carousel/64_{:04d}.png\";".format(sn))
  25.             print("\t\t\t\trecolour: \"../sprites/ride_shops/ride_3x3_carousel/64p_{:04d}.png\";".format(sn))
  26.             print("\t\t\t\tx_offset: -32; y_offset: -97; width: 64; height: 128;")
  27.             print("\t\t\t}")
  28.         print("\t\t}")
  29. print("\t}")

Comments