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.     index: [0, 1];
  79.     xoffset: [0, 16];
  80.     hide_sprite: !red_signal;
  81.   }
  82.   childsprite {
  83.     sprite: signals(yellow);
  84.     index: [0, 1];
  85.     xoffset: [0, 16];
  86.     hide_sprite: !yellow_signal;
  87.   }
  88.   childsprite {
  89.     sprite: signals(green);
  90.     index: [0, 1];
  91.     xoffset: [0, 16];
  92.     hide_sprite: !green_signal;
  93.   }
  94.   building {
  95.     sprite: platforms(concrete + platform_variation);
  96.     index: [2, 4];
  97.     yoffset: 12;
  98.     yextent: 4;
  99.   }
  100.   // Same idea as first building's childsprites
  101. }
  102.  
  103. spritelayout cobble_platform {
  104.   // Same idea as concrete_platform layout
  105. }
  106.  
  107. spritelayout dirt_platform {
  108.   // Same idea as concrete_platform layout
  109. }
  110.  
  111. item(FEAT_STATIONS, concrete_station) {
  112.   property { ... }
  113.   graphics {
  114.     concrete_platform;
  115.   }
  116. }
  117.  
  118. item(FEAT_STATIONS, cobble_station) {
  119.   property { ... }
  120.   graphics {
  121.     cobble_platform;
  122.   }
  123. }
  124.  
  125. item(FEAT_STATIONS, dirt_station) {
  126.   property { ... }
  127.   graphics {
  128.     dirt_platform;
  129.   }
  130. }
  131.  
  132. switch(FEAT_STATIONS, SELF, adaptation_switch, magic_expr_for_type) {
  133.   1: cobble_platform;
  134.   2: dirt_platform;
  135.   concrete_platform;
  136. }
  137.  
  138. item(FEAT_STATIONS, adaptive_station) {
  139.   property { ... }
  140.   graphics {
  141.     adaptation_switch;
  142.   }
  143. }

Version history

Revision # Author Created at
pzuzoxvd6 Anonymous 09 Jan 2015, 16:24:44 UTC Diff

Comments