Loading

elaborate_station_example

  1. spriteset(grounds, "graphics/grounds.png") {
  2.   concrete: template_grounds(0);
  3.   cobble: template_grounds(1);
  4.   dirt: template_grounds(2);
  5. }
  6.  
  7. spriteset(platforms, "graphics/platforms.png") {
  8.   concrete: template_platforms(0);
  9.   cobble: template_platforms(1);
  10.   dirt: template_platforms(2);
  11. }
  12.  
  13. spriteset(buildings, "graphics/buildings.png") {
  14.   small: template_buildings(0);
  15.   large: template_buildings(1);
  16. }
  17.  
  18. spriteset(little_cargoes, "graphics/cargoes.png") {
  19.   template_cargoes(0, 0);
  20.   template_cargoes(0, 1);
  21.   // ...
  22.   template_cargoes(0, 46);
  23.   template_cargoes(0, 47);
  24. }
  25.  
  26.  
  27. spriteset(lots_cargoes, "graphics/cargoes.png") {
  28.   template_cargoes(1, 0);
  29.   template_cargoes(1, 1);
  30.   // ...
  31.   template_cargoes(1, 46);
  32.   template_cargoes(1, 47);
  33. }
  34.  
  35. spriteset(signals, "graphics/signals.png") {
  36.   red: template_signals(0);
  37.   yellow: template_signals(1);
  38.   green: template_signals(2);
  39. }
  40.  
  41. spritegroup cargoes {
  42.   little: [little_cargoes];
  43.   lots: [lots_cargoes];
  44. }
  45.  
  46. spritelayout concrete_platform {
  47.   ground { sprite: grounds(dirt + ground_variation); }
  48.   building {
  49.     sprite: platforms(concrete + platform_variation);
  50.     index: [0, 2];
  51.     yextent: 4;
  52.   }
  53.   childsprite {
  54.     sprite: buildings(small + building_variation);
  55.     index: [0, 1];
  56.   }
  57.   childsprite {
  58.     sprite: cargoes(cargo_type + cargo_size);
  59.     yoffset: 4;
  60.   }
  61.   childsprite {
  62.     sprite: cargoes(cargo_type + cargo_size);
  63.     xoffset: 8;
  64.     yoffset: 8;
  65.   }
  66.   childsprite {
  67.     sprite: cargoes(cargo_type + cargo_size);
  68.     xoffset: 16;
  69.     yoffset: 12;
  70.   }
  71.   childsprite {
  72.     sprite: cargoes(cargo_type + cargo_size);
  73.     xoffset: 24;
  74.     yoffset: 16;
  75.   }
  76.   childsprite {
  77.     sprite: signals(red);
  78.     xoffset: [0, 16];
  79.     hide_sprite: !red_signal;
  80.   }
  81.   childsprite {
  82.     sprite: signals(yellow);
  83.     xoffset: [0, 16];
  84.     hide_sprite: !yellow_signal;
  85.   }
  86.   childsprite {
  87.     sprite: signals(green);
  88.     xoffset: [0, 16];
  89.     hide_sprite: !green_signal;
  90.   }
  91.   building {
  92.     sprite: platforms(concrete + platform_variation);
  93.     index: [2, 4];
  94.     yoffset: 12;
  95.     yextent: 4;
  96.   }
  97.   // Same idea as first building's childsprites
  98. }
  99.  
  100. spritelayout cobble_platform {
  101.   // Same idea as concrete_platform layout
  102. }
  103.  
  104. spritelayout dirt_platform {
  105.   // Same idea as concrete_platform layout
  106. }
  107.  
  108. item(FEAT_STATIONS, concrete_station) {
  109.   property { ... }
  110.   graphics {
  111.     concrete_platform;
  112.   }
  113. }
  114.  
  115. item(FEAT_STATIONS, cobble_station) {
  116.   property { ... }
  117.   graphics {
  118.     cobble_platform;
  119.   }
  120. }
  121.  
  122. item(FEAT_STATIONS, dirt_station) {
  123.   property { ... }
  124.   graphics {
  125.     dirt_platform;
  126.   }
  127. }
  128.  
  129. switch(FEAT_STATIONS, SELF, adaptation_switch, magic_expr_for_type) {
  130.   1: cobble_platform;
  131.   2: dirt_platform;
  132.   concrete_platform;
  133. }
  134.  
  135. item(FEAT_STATIONS, adaptive_station) {
  136.   property { ... }
  137.   graphics {
  138.     adaptation_switch;
  139.   }
  140. }

Comments