home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Enigma / Enigma-1.01-w7.exe / data / models-2d.lua < prev    next >
Text File  |  2009-12-13  |  51KB  |  1,668 lines

  1. ------------------------------------------------------------------------
  2. -- Copyright (C) 2002,2003,2004,2005 Daniel Heck
  3. --
  4. -- This program is free software; you can redistribute it and/or
  5. -- modify it under the terms of the GNU General Public License
  6. -- as published by the Free Software Foundation; either version 2
  7. -- of the License, or (at your option) any later version.
  8. --
  9. -- This program is distributed in the hope that it will be useful,
  10. -- but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. -- GNU General Public License for more details.
  13. --
  14. -- You should have received a copy of the GNU General Public License along
  15. -- with this program; if not, write to the Free Software Foundation, Inc.,
  16. -- 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  17. --
  18. -- $Id: models-2d.lua,v 1.124 2004/05/27 20:30:47 dheck Exp $
  19. ------------------------------------------------------------------------
  20.  
  21. -- This file defines the models used in Enigma.
  22.  
  23. dofile(FindDataFile("models.lua"))
  24.  
  25. def_image("dummy")
  26. def_image("invisible")
  27.  
  28. TRUE, FALSE = 1, 0
  29.  
  30. function SpriteImages(spriteimg, n, offsetfactor, padding)
  31.     local factor = offsetfactor or 0.5
  32.     local offset = -SpriteSize * factor
  33.     local pad = (padding or 0) * TileSize
  34.     return def_subimages(spriteimg,
  35.                          {h = n, imgw=SpriteSize, imgh=SpriteSize,
  36.                              xoff = offset, yoff = offset, padding=pad})
  37. end
  38.  
  39. function SpriteImage(spriteimg, offsetfactor, padding)
  40.     local factor = offsetfactor or 0.5
  41.     local offset = -SpriteSize * factor
  42.     local padding = (padding or 0) * TileSize
  43.     return def_image(spriteimg, {xoff = offset, yoff = offset, padding=padding})
  44. end
  45.  
  46. function SpriteWithShadow()
  47.  
  48. end
  49.  
  50. function SpriteAnim(name, images, shadows, framelen, loop)
  51.     local frames={}
  52.     local nframes = getn(images)
  53.     for i=1,getn(images) do
  54.         def_shmodel(name..i, images[i], shadows[mod (i, getn(shadows))] )
  55.         tinsert(frames, name..i)
  56.     end
  57.     def_anim (name, buildframes(frames, framelen), loop)
  58. end
  59.  
  60. function Sprite(descr)
  61.     local imgfile = descr.imgfile or descr.name
  62.     local loop    = descr.loop or FALSE
  63.     local img     = SpriteImages(imgfile, descr.nimages, 0.5, descr.padding)
  64.     def_anim(descr.name, buildframes(img, descr.framelen), loop)
  65. end
  66.  
  67. --------------------------------------------------------------------
  68. --                           ACTOR MODELS                         --
  69. --------------------------------------------------------------------
  70. Progress(0, "Loading sprite models")
  71.  
  72. ------------------
  73. -- Spinning top --
  74. ------------------
  75. do
  76.     local img=SpriteImages("fg-top", 9, 0.5, 0.3)
  77.     SpriteImage("sh-top", 0.4, 0.3)
  78.  
  79.     frames={}
  80.     for i=1,9 do
  81.         def_shmodel("ac-top"..i, img[i], "sh-top")
  82.         tinsert(frames, "ac-top"..i)
  83.     end
  84.     def_anim("ac-top", buildframes(frames, 25), TRUE)
  85. end
  86.  
  87. -----------
  88. -- Rotor --
  89. -----------
  90. do
  91.     local fg=SpriteImages("fg-rotor",9)
  92.     local bg=SpriteImages("sh-rotor", 9, 0.4)
  93.  
  94.     frames={}
  95.     for i=1,9 do
  96.         def_shmodel("ac-rotor"..i, fg[i], bg[i])
  97.         tinsert(frames, "ac-rotor"..i)
  98.     end
  99.     def_anim("ac-rotor", buildframes(frames, 30), TRUE)
  100. end
  101.  
  102. -----------
  103. -- Horse --
  104. -----------
  105. do
  106.     SpriteImage ("fg-horse")
  107.     SpriteImage ("sh-horse", 0.4)
  108.     def_shmodel ("ac-horse", "fg-horse", "sh-horse")
  109. end
  110.  
  111. ----------------------
  112. -- Small white ball --
  113. ----------------------
  114. do
  115.     local fg,img
  116.  
  117.     -- Normal
  118.     SpriteImage ("sh-whiteball-small", 0.4, 0.3)
  119.     SpriteImage ("fg-whiteball-small", 0.5, 0.3) 
  120.     def_shmodel("ac-whiteball-small", "fg-whiteball-small", "sh-whiteball-small")
  121.     def_alias ("ac-whiteball-small-shine", "ac-whiteball-small")
  122.  
  123.     -- Falling
  124.     img=SpriteImages ("ac-whiteball-small-fall", 5)
  125.     tinsert(img, "invisible")
  126.     def_anim("ac-whiteball-small-fall", composeframes(img,{70,65,60,55,50,30}))
  127.     def_alias("ac-whiteball-small-fallen", "invisible")
  128.  
  129.     -- Appearing / disappearing
  130.     def_anim("ac-whiteball-small-appear", reverseframes(buildframes(img, 25)))
  131.     def_anim("ac-whiteball-small-disappear", buildframes(img, 25))
  132.  
  133.     -- Shattering
  134.     img=SpriteImages ("ac-whiteball-small-shatter", 5)
  135.     def_anim("ac-whiteball-small-shatter", buildframes(img, 60))
  136.     SpriteImage ("ac-whiteball-small-shattered")
  137.  
  138.  
  139.     -- sinking
  140.     def_alias ("ac-whiteball-small-sink0", "ac-whiteball-small-fall1")
  141.     def_alias ("ac-whiteball-small-sink1", "ac-whiteball-small-fall2")
  142.     def_alias ("ac-whiteball-small-sink2", "ac-whiteball-small-fall3")
  143.     def_alias ("ac-whiteball-small-sink3", "ac-whiteball-small-fall4")
  144.     def_alias ("ac-whiteball-small-sink4", "ac-whiteball-small-fall5")
  145.     def_alias ("ac-whiteball-small-sink5", "ac-whiteball-small-fall5")
  146.     def_alias ("ac-whiteball-small-sink6", "ac-whiteball-small-fall5")
  147.     def_alias ("ac-whiteball-small-sunk", "invisible")
  148. end
  149.  
  150. -- Jumping small balls --
  151. do
  152.     namelist = SpriteImages("ac-whiteball-small-jump", 4)
  153.     shadows  = SpriteImages("sh-whiteball-small-jump", 4, 0.4)
  154.     frames   = {}
  155.     for i=1,4 do
  156.         def_shmodel("sb-jump"..i, namelist[i], shadows[i])
  157.         tinsert(frames, "sb-jump"..i)
  158.     end
  159.     def_anim("ac-whiteball-small-jump", pingpong(buildframes(frames, 70)))
  160. end
  161.  
  162. def_alias("ac-killerball", "ac-whiteball-small")
  163.  
  164. -------------------------
  165. -- Balls (both colors) --
  166. -------------------------
  167.  
  168. -- Shattering
  169. Sprite{name="ac-blackball-shatter", nimages=5, framelen=60}
  170. Sprite{name="ac-whiteball-shatter", nimages=5, framelen=60}
  171.  
  172. -- Sinking
  173. do
  174.     local img, sh
  175.  
  176.     sh = SpriteImages("sh-blackball-sink", 7, 0.4)
  177.     img = SpriteImages("fg-blackball-sink", 7)
  178.     for i=1,getn(img) do
  179.         def_shmodel("ac-blackball-sink"..(i-1), img[i], sh[i])
  180.     end
  181.     def_alias("ac-blackball-sunk", "invisible")
  182.  
  183.     img=SpriteImages("fg-whiteball-sink", 7)
  184.     for i=1,getn(img) do
  185.         def_shmodel("ac-whiteball-sink"..(i-1), img[i], sh[i])
  186.     end
  187.     def_alias("ac-whiteball-sunk", "invisible")
  188. end
  189.  
  190.  
  191. ----------------
  192. -- Black ball --
  193. ----------------
  194. do
  195.     local img,f,sh
  196.  
  197.     -- Normal
  198.     sh = SpriteImage("sh-blackball", 0.4, 0.2)
  199.     img = SpriteImages("fg-blackball", 2, 0.5, 0.25)
  200.     def_shmodel("ac-blackball", "fg-blackball1", "sh-blackball")
  201.     def_shmodel("ac-blackball-shine", "fg-blackball2", "sh-blackball")
  202.  
  203.     -- Falling
  204.     img=SpriteImages("ac-blackball-fall", 10)
  205.     f=composeframes(img,{70,65,60,55,50,50,50,50,50,50,50})
  206.     def_anim("ac-blackball-fall", f)
  207.     def_alias("ac-blackball-fallen", "invisible")
  208.  
  209.     -- Appearing / disappearing
  210.     def_anim("ac-blackball-appear", reverseframes(buildframes(img, 25)))
  211.     def_anim("ac-blackball-disappear", buildframes(img, 25))
  212.  
  213.     def_alias("ac-blackball-shattered", "ac-blackball-shatter5")
  214. end
  215.  
  216.  
  217.  
  218. ----------------
  219. -- White ball --
  220. ----------------
  221.  
  222. do
  223.     local img,f
  224.  
  225.     -- Normal
  226.     def_alias("sh-whiteball", "sh-blackball")
  227.     img=SpriteImage ("fg-whiteball")
  228. --    def_image("fg-wb", {filename="ac-whiteball", xoff=-9, yoff=-9})
  229.     def_shmodel("ac-whiteball", "fg-whiteball", "sh-whiteball")
  230.     def_alias("ac-whiteball-shine", "ac-whiteball")
  231.  
  232.     -- Falling
  233.     img=SpriteImages("ac-whiteball-fall", 10)
  234.     f=composeframes(img,{70,65,60,55,50,50,50,50,50,50,50})
  235.     def_anim("ac-whiteball-fall", f)
  236.     def_alias("ac-whiteball-fallen", "invisible")
  237.  
  238.     -- Appearing / disappearing
  239.     def_anim("ac-whiteball-appear", reverseframes(buildframes(img, 25)))
  240.     def_anim("ac-whiteball-disappear", buildframes(img, 25))
  241.  
  242.     -- Shattering
  243.  
  244.     def_alias("ac-whiteball-shattered", "ac-whiteball-shatter5")
  245. end
  246.  
  247. -- Jumping normal balls --
  248. do
  249.     namelist = SpriteImages("ac-blackball-jump", 4)
  250.     shadows  = SpriteImages("sh-blackball-jump", 4, 0.4)
  251.     frames   = {}
  252.     for i=1,4 do
  253.         def_shmodel("bb-jump"..i, namelist[i], shadows[i])
  254.         tinsert(frames, "bb-jump"..i)
  255.     end
  256.     def_anim("ac-blackball-jump", pingpong(buildframes(frames, 70)))
  257.  
  258.     namelist = SpriteImages("ac-whiteball-jump", 4)
  259.     frames   = {}
  260.     for i=1,4 do
  261.         def_shmodel("wb-jump"..i, namelist[i], shadows[i])
  262.         tinsert(frames, "wb-jump"..i)
  263.     end
  264.     def_anim("ac-whiteball-jump", pingpong(buildframes(frames, 70)))
  265. end
  266.  
  267. ----------------
  268. -- Cannonball --
  269. ----------------
  270.  
  271. def_alias ("ac-cannonball", "ac-blackball-jump")
  272.  
  273.  
  274.  
  275. ---------
  276. -- Bug --
  277. ---------
  278. do
  279.     SpriteImage("fg-bug")
  280.     def_shmodel("ac-bug", "fg-bug", "sh-whiteball-small")
  281. end
  282.  
  283. -- Marbles in inventory  --
  284. def_image("inv-blackball")
  285. def_image("inv-whiteball")
  286.  
  287.  
  288. ------------------
  289. -- Floor models --
  290. ------------------
  291. Progress(10, "Loading floor models")
  292.  
  293. function def_floors(floorlist)
  294.     for i,name in pairs(floorlist) do
  295.     def_image(name)
  296.     end
  297. end
  298.  
  299. function def_randfloor(name, imagelist)
  300.     def_floors(imagelist)
  301.     display.DefineRandModel(name, getn(imagelist), imagelist)
  302. end
  303.  
  304. -- _si for _subimage
  305. function def_randfloor_si(name, height, width)
  306.     imagelist=def_subimages(name, {h=height, w=width})
  307.     display.DefineRandModel(name, getn(imagelist), imagelist)
  308. end
  309.  
  310. --if options.WizardMode > 0 then
  311. --    def_subimages("fl-gradient-wiz", {modelname="fl-gradient",w=6, h=4})
  312. --else
  313. def_subimages("fl-gradient2", {w=6, h=4, modelname="fl-gradient"})
  314. --end
  315.  
  316. do
  317.     def_subimages("fl-leaves", {w=10, h=2, modelname="fl-leavesx"})
  318.     display.DefineRandModel("fl-leaves", 4, {"fl-leavesx1", "fl-leavesx2", "fl-leavesx3", "fl-leavesx4"})
  319.     display.DefineRandModel("fl-leavesb", 4, {"fl-leavesx5", "fl-leavesx6", "fl-leavesx7", "fl-leavesx8"})
  320.     def_alias("fl-leavesc1", "fl-leavesx9")
  321.     def_alias("fl-leavesc2", "fl-leavesx10")
  322.     def_alias("fl-leavesc3", "fl-leavesx11")
  323.     def_alias("fl-leavesc4", "fl-leavesx12")
  324.     def_alias("fl-leavesd1", "fl-leavesx13")
  325.     def_alias("fl-leavesd2", "fl-leavesx14")
  326.     def_alias("fl-leavesd3", "fl-leavesx15")
  327.     def_alias("fl-leavesd4", "fl-leavesx16")
  328.     def_alias("fl-leavese1", "fl-leavesx17")
  329.     def_alias("fl-leavese2", "fl-leavesx18")
  330.     def_alias("fl-leavese3", "fl-leavesx19")
  331.     def_alias("fl-leavese4", "fl-leavesx20")
  332. end
  333.  
  334. -- To get different wood tiles with horizontal or vertical slats.
  335. -- Each floortype has got 2 random images.
  336. do
  337.     def_subimages("fl-wood", {w=1, h=4, modelname="fl-woodx"})
  338.     display.DefineRandModel("fl-wood", 4, {"fl-woodx1", "fl-woodx2", "fl-woodx3", "fl-woodx4"})
  339.     display.DefineRandModel("fl-wood1", 2, {"fl-woodx3", "fl-woodx4"})
  340.     display.DefineRandModel("fl-wood2", 2, {"fl-woodx1", "fl-woodx2"})
  341. end
  342.  
  343. def_randfloor("fl-rock", {"fl-rock1", "fl-rock2"})
  344. def_floors{"fl-abyss"}
  345. def_alias("fl-abyss_fake", "fl-abyss")
  346. def_floors{"fl-dunes", "fl-sand", "fl-bluegreen", "fl-bluegreenx"}
  347. def_floors{"fl-inverse", "fl-inverse2", "fl-white", "fl-black", "fl-acwhite", "fl-acblack"}
  348. def_floors{"fl-springboard"}
  349. def_image("fl-normal")
  350. def_randfloor_si("fl-hay", 4)
  351. def_floors{"fl-floor_001"}
  352. def_floors{"fl-ice"}
  353. def_floors{"fl-stone"}
  354. def_alias("fl-normal_x", "fl-normal")
  355. def_floors{"fl-dummy"}
  356. def_floors{"fl-light", "fl-lightgray", "fl-darkgray"}
  357. def_floors{"fl-trigger"}
  358. def_randfloor_si("fl-concrete", 4)
  359. def_randfloor_si("fl-gravel", 4)
  360. def_randfloor_si("fl-bumps", 2,2)
  361. def_randfloor_si("fl-mortar", 2, 2)
  362.  
  363. def_randfloor_si("fl-brick", 3)
  364.  
  365. def_randfloor_si("fl-space", 3,2)
  366. def_alias("fl-space-force", "fl-space")
  367.  
  368. def_randfloor_si("fl-rough", 5)
  369. def_alias("fl-rough_medium", "fl-rough")
  370. def_alias("fl-rough_slow", "fl-rough")
  371. def_randfloor_si("fl-gray", 5)
  372. def_randfloor_si("fl-metal", 6)
  373. def_randfloor_si("fl-plank", 4)
  374. def_randfloor_si("fl-water", 4)
  375. def_randfloor_si("fl-swamp", 4)
  376. def_randfloor_si("fl-woven", 5)
  377. def_randfloor_si("fl-marble", 4)
  378. --def_subimages("fl-stwood", {h=2})
  379. def_randfloor_si("fl-stwood", 2)
  380. def_randfloor_si("fl-bluegray", 4)
  381. def_randfloor_si("fl-red", 4)
  382. def_randfloor_si("fl-rough-blue", 4)
  383. def_randfloor_si("fl-rough-red", 4)
  384. def_randfloor_si("fl-sahara", 4)
  385. def_randfloor_si("fl-tigris", 4)
  386. def_randfloor_si("fl-samba", 2)
  387. def_randfloor_si("fl-himalaya", 4)
  388. def_floors{"fl-woven_orange"}
  389.  
  390. --
  391. -- Bridges
  392. --
  393. def_image("fl-bridgea-open")
  394. def_image("fl-bridgea-closed")
  395. namelist=def_subimages("fl-bridgea", {h=10})
  396. frames = buildframes(namelist,70)
  397. def_anim("fl-bridgea-opening", reverseframes(frames))
  398. def_anim("fl-bridgea-closing", frames)
  399.  
  400.  
  401. def_image("fl-bridgex-open")
  402. def_image("fl-bridgex-closed")
  403. namelist=def_subimages("fl-bridgex", {h=9})
  404. frames = buildframes(namelist,70)
  405. def_anim("fl-bridgex-opening", frames)
  406. def_anim("fl-bridgex-closing", reverseframes(frames))
  407.  
  408.  
  409. def_image("fl-bridgey-open")
  410. def_image("fl-bridgey-closed")
  411. namelist=def_subimages("fl-bridgey", {h=9})
  412. frames = buildframes(namelist,70)
  413. def_anim("fl-bridgey-opening", frames)
  414. def_anim("fl-bridgey-closing", reverseframes(frames))
  415.  
  416. ------------------------
  417. -- Heating animations --
  418. ------------------------
  419.  
  420. function heating_animation(basemodel)
  421.     local img = def_subimages(basemodel.."-heating", {h=8});    
  422.     local f = buildframes(img, 240)
  423.     def_anim(basemodel.."-heating", f);
  424. end
  425.  
  426. heating_animation("fl-ice")
  427. heating_animation("fl-water")
  428. heating_animation("fl-swamp")
  429.  
  430.  
  431. --------------------------------------------------------------------------
  432. --                           ITEM MODELS                                --
  433. --------------------------------------------------------------------------
  434. Progress(20, "Loading item models")
  435.  
  436. do
  437. --    def_image("items")
  438.     local itemtiles={
  439.         "it-brush", "it-floppy",
  440.         "it-document", "it-hammer",
  441.         "it-key", "it-spade",
  442.         "it-umbrella", "it-extralife",
  443.         "it-hill", "it-hollow", "it-tinyhill", "it-tinyhollow",
  444.         "it-laserh", "it-laserv", "it-laserhv",
  445.         "it-magicwand",
  446.         "it-spring1", "it-spring2",
  447.         "it-sword",
  448.         "it-surprise",
  449.         "it-trigger", "it-trigger1",
  450.         "it-yinyang", "it-yanying",
  451.         "it-puller-n", "it-puller-e", "it-puller-s", "it-puller-w",
  452.         "it-odometer",
  453.         "it-flagblack", "it-flagwhite",
  454.         "it-ring", "it-pin", "it-bag", "it-drop", "it-rubberband"
  455.     }
  456. --    def_tiles("items", itemtiles)
  457.     DefineTiles ("items", itemtiles)
  458. end
  459.  
  460. -- Puller animation
  461. do
  462.     local models={"it-puller-n", "it-puller-e", "it-puller-s", "it-puller-w"}
  463.     local frames=buildframes(models, 100)
  464.     def_anim("it-puller-active", repeatanim(frames, 4), FALSE)
  465. end
  466.  
  467. do
  468.     local n=def_subimages("it-coffee", {h=4})
  469.     local f=buildframes(n,150)
  470.     def_anim("it-coffee", f, TRUE)
  471. end
  472.  
  473. -- Some more Items
  474.  
  475. def_images{
  476.     "it-blackbomb",
  477.     "it-whitebomb",
  478.     "it-dynamite",
  479.     "it-dummy",
  480.     "it-blocker",
  481.     "it-wrench",
  482.     "it-cherry",
  483.     "it-glasses",
  484.     "it-glasses-broken",
  485.     "it-weight",
  486.     "it-landmine",
  487.     "it-hstrip",
  488.     "it-vstrip",
  489.     "it-booze",
  490.     "it-banana", 
  491.     "it-spoon",
  492.     "it-cross",
  493.     "it-pencil",
  494.     "it-squashed",
  495.     "it-booze-broken",
  496. }
  497.  
  498. def_alias("it-key_a", "it-key")
  499. def_alias("it-key_b", "it-key")
  500. def_alias("it-key_c", "it-key")
  501.  
  502. -- Seed --
  503. do
  504.     local n = def_subimages("it-seed", {h=5})
  505.     def_alias("it-seed", "it-seed1")
  506.     def_alias("it-seed_nowood", "it-seed")
  507.     def_alias("it-seed_volcano", "it-seed")
  508.     local f={
  509.         "it-seed1", "it-seed2", "it-seed1", "it-seed3", "it-seed1", "it-seed2",
  510.         "it-seed1", "it-seed4", "it-seed5", "it-seed4", "it-seed1",
  511.         "it-seed4", "it-seed5",
  512.     }
  513.     def_anim("it-seed-growing", buildframes(f, 120))
  514. end
  515.  
  516. -- Cracks --
  517. namelist=def_subimages("it-crack", {h=8})
  518. --frames=buildframes({"it-crack4", "it-crack6", "it-crack7", "it-crack8"},90)
  519. frames=buildframes(namelist,50)
  520. def_anim("it-debris", frames)
  521.  
  522. frames=buildframes({"it-crack4", "it-crack5"},120)
  523. def_anim("it-crack_anim1", frames)
  524.  
  525. frames=buildframes({"it-crack6", "it-crack7", "it-crack8"},120)
  526. def_anim("it-crack_anim2", frames)
  527.  
  528. -- Burning Floor --
  529. frames=buildframes(def_subimages("it-burnable_ignite", {h=8}), 100)
  530. def_anim("it-burnable_ignited", frames)
  531.  
  532. frames=buildframes(def_subimages("it-burnable_burning", {h=8}), 100)
  533. def_anim("it-burnable_burning", frames)
  534.  
  535. def_images{ "it-burnable_ash", "it-burnable_fireproof"}
  536. def_alias("it-burnable", "invisible")
  537.  
  538. do
  539.    local img = def_subimages("it-extinguisher", {h=3})
  540.    def_alias("it-extinguisher", img[1])
  541.    def_alias("it-extinguisher_medium", img[2])
  542.    def_alias("it-extinguisher_empty", img[3])
  543. end
  544.  
  545. -- Oil --
  546. def_subimages("it-burnable_oil", {h=4})
  547.  
  548. -- Magnet --
  549. def_image("it-magnet-off")
  550. frames=buildframes(def_subimages("it-magnet-on", {h=5}), 100)
  551. def_anim("it-magnet-on", frames, 1)
  552.  
  553. -- Wormhole --
  554. do
  555.     local f = buildframes(def_subimages("it-wormhole", {h=2}), 100)
  556.     def_anim("it-wormhole", f, TRUE)
  557.     def_alias("it-wormhole-off", "it-wormhole1")
  558. end
  559.  
  560. -- Vortex --
  561. do
  562.    local img = def_subimages("it-vortex", {h=4})
  563.    def_alias("it-vortex-open", img[1])
  564.    def_alias("it-vortex-closed", img[4])
  565.  
  566.    def_anim("it-vortex-opening", reverseframes(buildframes(img, 100)))
  567.    def_anim("it-vortex-closing", buildframes(img, 100))
  568. end
  569.  
  570. -- Coins --
  571. def_images{"it-coin1", "it-coin2", "it-coin4"}
  572.  
  573. -- Burning dynamite --
  574. dyn_frames=buildframes(def_subimages("it-dynamite-burning", {h=15}), 100)
  575. def_anim("it-dynamite-burning", dyn_frames) --repeat_frames(dyn_frames,3,2))
  576.  
  577. -- Burning bomb --
  578. frames=buildframes(def_subimages("it-blackbomb-burning", {h=9}), 100)
  579. def_anim("it-blackbomb-burning", frames) --repeat_frames(frames,3,2))
  580.  
  581. frames=buildframes(def_subimages("it-whitebomb-burning", {h=9}), 100)
  582. def_anim("it-whitebomb-burning", frames) --repeat_frames(frames,3,2))
  583.  
  584. -- Explosion --
  585. def_anim_images("expl", {{"expl", 50}})
  586. def_alias("it-explosion1", "expl")
  587. def_alias("it-explosion2", "expl")
  588. def_alias("it-explosion3", "expl")
  589.  
  590. -- Pipes --
  591. DefineTiles("it-pipe", {
  592.                 "it-pipe-e", "it-pipe-s", "it-pipe-es", "it-pipe-sw",
  593.                 "it-pipe-h", "it-pipe-w", "it-pipe-n", "it-pipe-ne",
  594.                 "it-pipe-wn", "it-pipe-v"})
  595.  
  596. -- broken Bottle --
  597. -- Should get more models like oil!
  598. --def_subimages("it-brokenbottle", {h=1})
  599.  
  600. -----------------
  601. -- Shogun dots --
  602. -----------------
  603.  
  604. NewAnim("it-shogun-s", {img="it-shogun-small", h=3, speed=160, pingpong=1, loop=1})
  605. NewAnim("it-shogun-m", {img="it-shogun-med",   h=3, speed=160, pingpong=1, loop=1})
  606. NewAnim("it-shogun-l", {img="it-shogun-big",   h=3, speed=160, pingpong=1, loop=1})
  607.  
  608. -- Springboard --
  609. do
  610.     local n = {"it-springboard1", "it-springboard2"}
  611.     DefineTiles ("it-springboard", n)
  612.     def_alias ("it-springboard", n[1])
  613.     def_anim("it-springboard_anim", buildframes(reverseframes(n),120))
  614. end
  615.  
  616. -- def_alias("it-bridge-oxyd", "invisible")
  617. -- def_alias("it-sensor", "invisible")
  618. -- def_alias("it-inversesensor", "invisible")
  619.  
  620. -- it-death --
  621. do
  622.    local img = def_subimages("it-death", {h=4})
  623.    def_alias("it-death", img[1])
  624.    def_anim("it-death-anim", buildframes(img, 100))
  625. end
  626.  
  627. ------------------
  628. -- STONE MODELS --
  629. ------------------
  630. Progress(30, "Loading stone models")
  631.  
  632. -------------------
  633. -- Stone shadows --
  634. -------------------
  635. def_image("sh-solid")
  636. def_image("sh-round")
  637. def_image("sh-round2")
  638. def_image("sh-grate1")
  639. def_image("sh-grate2")
  640. def_image("sh-grate3")
  641. def_image("sh-glass")
  642. def_image("sh-white4")
  643. def_image("sh-puzzle1")
  644. def_image("sh-brake")
  645. def_image("sh-floating")
  646.  
  647. -- stone models
  648. def_stone("st-glass", "sh-glass");
  649.  
  650. def_stone("st-bug")
  651.  
  652. -- Scissors
  653. do
  654.     def_stone("st-scissors")
  655.     local n=def_subimages("st-scissors-snip", {h=1})
  656.     def_anim("st-scissors-snip-anim", buildframes(n, 130))
  657.     def_solidstone("st-scissors-snip", "st-scissors-snip-anim")
  658. end
  659.  
  660. def_stone("st-rubberband")
  661.  
  662.  
  663. do
  664.     local tiles = {
  665.         "st-disco-light",
  666.         "st-disco-medium",
  667.         "st-disco-dark"
  668.     }
  669.     map_tiles({h=3},
  670.               function (i, rect)
  671.                   local model = tiles[i]
  672.                   display.DefineSubImage(model, "st-disco", 0,0, rect)
  673.               end)
  674. end
  675.  
  676. -- other
  677.  
  678. do
  679. --    def_image("stones")
  680.     local stonetiles={
  681.         "st-black1#",
  682.         "st-black2#",
  683.         "st-black3#",
  684.         "st-black4#",
  685.         "st-block#",
  686.         "st-idontknowwhattonameit2",
  687.         "st-beads#"
  688.     }
  689.     DefineTiles("stones", stonetiles)
  690. end
  691.  
  692. def_alias("st-explosion", "expl")
  693.  
  694. def_stone2("st-black1")
  695. def_stone2("st-black2")
  696. def_stone2("st-black3", "sh-grate1")
  697. def_stone2("st-black4", "sh-white4")
  698. def_stone2("st-block")
  699. def_stone2("st-beads", "sh-glass")
  700.  
  701.  
  702. def_stone("st-glass1", "sh-glass")
  703. def_stone("st-glass2", "sh-glass")
  704. def_stone("st-glass3", "sh-glass")
  705. def_stone("st-rock1", "sh-round")
  706. def_stone("st-rock2")
  707. def_stone("st-rock3")
  708. def_stone("st-rock4")
  709. def_stone("st-rock5")
  710. def_stone("st-rock6")
  711. def_stone("st-rock7")
  712. def_stone("st-rock8", "sh-round")
  713. def_stone("st-rock9", "sh-round")
  714. def_stone("st-rock10")
  715. def_stone("st-redrock")
  716. def_stone("st-brownie", "sh-round")
  717. def_stone("st-stone1")
  718. def_stone("st-stone2")
  719. def_stone("st-bumps")
  720.  
  721. def_stone("st-camouflage")
  722. def_alias("st-camouflage_move", "st-camouflage")
  723. def_alias("st-camouflage_hole", "st-camouflage")
  724.  
  725. def_alias("st-laserbreak", "st-rock3")
  726. def_alias("st-laserbreak-anim", "st-rock3_break-anim")
  727.  
  728. def_alias("st-rock1_hole", "st-rock1")
  729. def_alias("st-rock1_move", "st-rock1")
  730.  
  731. def_alias("st-rock2_hole", "st-rock2")
  732.  
  733. def_alias("st-rock3_hole", "st-rock3")
  734. def_alias("st-rock3_move", "st-rock3")
  735. def_alias("st-rock3_break", "st-rock3")
  736.  
  737. def_stone("st-marble", "sh-round")
  738. def_alias("st-marble_hole", "st-marble")
  739. def_alias("st-marble_move", "st-marble")
  740.  
  741. def_alias("st-glass_move", "st-glass");
  742. def_alias("st-glass1_move", "st-glass1")
  743. def_alias("st-glass1_hole", "st-glass1")
  744. def_alias("st-glass2_move", "st-glass2")
  745. def_alias("st-glass2_hole", "st-glass2")
  746.  
  747. def_stone("st-metal")
  748. def_alias("st-metal_hole", "st-metal")
  749. def_stone("st-blue-sand")
  750. def_stone("st-flrock")
  751. def_stone("st-flhay")
  752.  
  753. def_stone("st-firebreak")
  754. def_alias("st-firebreak_move", "st-firebreak")
  755.  
  756. do
  757.    local sh=def_subimages("sh-round2-growing", {h=3,imgw=ShadowSize,imgh=ShadowSize})
  758.  
  759.    -- Wooden stones --
  760.    do
  761.       def_subimages("st-wood", {modelname="st-wood-fg",h=2})
  762.       def_shmodel("st-wood1", "st-wood-fg1", "sh-round")
  763.       def_shmodel("st-wood2", "st-wood-fg2", "sh-round")
  764.  
  765.       local n=def_subimages("st-wood-growing", {h=3})
  766.       def_anim("wood-growing-fg", buildframes(n, 130))
  767.       def_anim("wood-growing-bg", buildframes(sh, 130))
  768.       def_shmodel("st-wood-growing", "wood-growing-fg", "wood-growing-bg")
  769.       def_shmodel("st-greenbrown-growing", "wood-growing-fg", "wood-growing-bg")
  770.    end
  771.  
  772.    -- Blocker stone
  773.    do
  774.       local n=def_subimages("st-blocker", {h=4})
  775.       def_roundstone("st-blocker", n[1])
  776.       frames={}
  777.       for i=4,2,-1 do
  778.          tinsert(frames, "st-blocker"..i)
  779.       end
  780.       def_anim("blocker-growing-fg", buildframes(frames, 60))
  781.       def_anim("blocker-growing-bg", buildframes(sh, 60))
  782.       def_anim("blocker-shrinking-fg", reverseframes(buildframes(frames, 60)))
  783.       def_anim("blocker-shrinking-bg", reverseframes(buildframes(sh, 60)))
  784.       def_shmodel("st-blocker-shrinking", "blocker-shrinking-fg", "blocker-shrinking-bg");
  785.       def_shmodel("st-blocker-growing", "blocker-growing-fg", "blocker-growing-bg");
  786.    end
  787. end
  788.  
  789. def_alias("st-volcano-growing", "st-blocker-growing")
  790.  
  791. -- Rotator stones
  792. do
  793.     local n=def_subimages("st-rotator-left", {h=8})
  794.     def_anim("st-rotator-left-anim", buildframes(n, 70), FALSE)
  795.     def_roundstone("st-rotator-left", "st-rotator-left-anim")
  796.     n=def_subimages("st-rotator-right", {h=8})
  797.     def_anim("st-rotator-right-anim", buildframes(n, 70), FALSE)
  798.     def_roundstone("st-rotator-right", "st-rotator-right-anim")
  799. end
  800.  
  801. def_stone("st-grate1", "sh-grate1")
  802. def_stone("st-grate2", "sh-grate2")
  803. def_stone("st-grate3", "sh-grate3")
  804.  
  805. def_stone("st-brake", "sh-brake")
  806. def_image("it-brake", {filename="st-brake"})
  807.  
  808. def_stone("st-greenbrown", "sh-round")
  809. def_alias("st-greenbrown_hole", "st-greenbrown")
  810. def_alias("st-greenbrown_move", "st-greenbrown")
  811.  
  812. --Progress(40)
  813.  
  814.  
  815. --def_stone("st-block")
  816. def_stone("st-brick")
  817. def_stone("st-woven")
  818. def_stone("st-brick_magic", nil, {filename="st-brick"})
  819.  
  820. -- Switches --
  821. do
  822.     function mkswitch(modelname, basename)
  823.     local n = def_subimages(modelname, {h=3, modelname=basename.."-fg"})
  824.     local f = buildframes(n, 60)
  825.     def_roundstone(modelname.."-off", n[1])
  826.     def_roundstone(modelname.."-on", n[3])
  827.     def_anim(basename.."-turnon", f)
  828.     def_anim(basename.."-turnoff", reverseframes(f))
  829.     def_roundstone(modelname.."-turnon", basename.."-turnon")
  830.     def_roundstone(modelname.."-turnoff", basename.."-turnoff")
  831.     end
  832.     mkswitch("st-switch", "switch")
  833.     mkswitch("st-switch_black", "switch_black")
  834.     mkswitch("st-switch_white", "switch_white")
  835. end
  836.  
  837. -- 4-Switches --
  838. do
  839.    def_subimages("st-fourswitch",{h=4})
  840.  
  841.    def_shmodel("st-fourswitch-n", "st-fourswitch1", "sh-round")
  842.    def_shmodel("st-fourswitch-e", "st-fourswitch2", "sh-round")
  843.    def_shmodel("st-fourswitch-s", "st-fourswitch3", "sh-round")
  844.    def_shmodel("st-fourswitch-w", "st-fourswitch4", "sh-round")
  845. end
  846.  
  847. def_stone("st-floppy0", "sh-round", {filename="st-floppy1"})
  848. def_stone("st-floppy1", "sh-round", {filename="st-floppy2"})
  849.  
  850. def_image("st-easymode")
  851.  
  852.  
  853. def_stone("st-laserswitch0", nil, {filename="st-oxydb"})
  854. def_anim_images("laserswitch-blink",
  855.                 repeatanim(pingpong(
  856.                             buildframes(framenames("st-fakeoxyd-blink", 1,4),
  857.                             50))), {loop=1})
  858. def_solidstone("st-laserswitch1", "laserswitch-blink")
  859.  
  860. def_stone("st-wood_001")
  861. def_stone("st-key0", "sh-round", {filename="st-key1"})
  862. def_stone("st-key1", "sh-round", {filename="st-key2"})
  863. def_stone("st-white1")
  864. def_stone("st-white2")
  865. def_stone("st-white3", "sh-grate1")
  866. def_stone("st-white4", "sh-white4")
  867. def_stone("st-yinyang1")
  868. def_stone("st-yinyang2")
  869. def_alias("st-yinyang3", "st-yinyang1")
  870. def_stone("st-bluegray", "sh-round")
  871. def_stone("st-bluegray_hole", "sh-round", {filename="st-bluegray"})
  872. def_stone("st-yellow")
  873. def_stone("st-dummy")
  874. def_stone("st-blackballs")
  875. def_stone("st-whiteballs")
  876.  
  877.  
  878. def_stone("st-rock3_cracked")
  879.  
  880. ---------------
  881. -- st-plain* --
  882. ---------------
  883. def_alias("st-plain", "st-rock3")
  884. def_alias("st-plain_hole", "st-rock3")
  885. def_alias("st-plain_breaking", "st-rock3_break-anim")
  886. def_alias("st-plain_break", "st-rock3")
  887. def_alias("st-plain_cracked", "st-rock3_cracked")
  888. def_alias("st-plain_move", "st-rock3")
  889. def_alias("st-plain_falling", "st-rock3-falling")
  890.  
  891. --------------------------
  892. -- pull and swap stones --
  893. --------------------------
  894.  
  895. --def_stone("st-swap", "sh-round")
  896.  
  897. do
  898.    def_subimages("st-pull",{modelname="st-pull-fg",h=5})
  899.    def_subimages("st-swap",{modelname="st-swap-fg",h=5})
  900.    def_subimages("sh-pull",{h=4,imgw=ShadowSize,imgh=ShadowSize})
  901.  
  902.    def_shmodel("st-pull",   "st-pull-fg1", "sh-glass")
  903.    def_shmodel("st-pull-n", "st-pull-fg2", "sh-pull1")
  904.    def_shmodel("st-pull-s", "st-pull-fg3", "sh-pull2")
  905.    def_shmodel("st-pull-e", "st-pull-fg4", "sh-pull3")
  906.    def_shmodel("st-pull-w", "st-pull-fg5", "sh-pull4")
  907.  
  908.    def_shmodel("st-swap",   "st-swap-fg1", "sh-round")
  909.    def_shmodel("st-swap-n", "st-swap-fg2", "sh-pull1")
  910.    def_shmodel("st-swap-s", "st-swap-fg3", "sh-pull2")
  911.    def_shmodel("st-swap-e", "st-swap-fg4", "sh-pull3")
  912.    def_shmodel("st-swap-w", "st-swap-fg5", "sh-pull4")
  913. end
  914.  
  915. -----------------
  916. -- Oxyd Stones --
  917. -----------------
  918.  
  919. -- Oxyd stones occur in different colors and different flavors and
  920. -- for each combination of these two attributes we need animations
  921. -- for the following internal states or state transitions:
  922. --
  923. --   (a) opening and closing
  924. --   (b) blinking
  925. --   (c) opened
  926. --
  927. -- Creating the required image files by hand would be tedious, so
  928. -- we use a couple of specialized functions and overlays to create
  929. -- them automatically.
  930.  
  931. do
  932.     local colorspots = framenames("st-oxydbtempl", 2,9)
  933.     local openovls = framenames("st-oxydbtempl", 10,14)
  934.  
  935. -- Define "fading in" and "fading out" animations for oxyd stones.
  936. -- These two animations are combined with the stone images to
  937. -- produce the opening and closing animations for oxyd stones.
  938.  
  939.     local baseimg = {
  940.         a="st-oxyda-open",
  941.         b="st-oxydb-open",
  942.         c="st-oxydc-open",
  943.         d="st-oxydd-open"
  944.     }
  945.     local shadow = {
  946.        a="sh-round",
  947.        b="sh-round",
  948.        c="sh-solid",
  949.        d="sh-solid",
  950.     }
  951.     local fopening = {
  952.         a = buildframes(def_subimages("st-oxyda-opening", {h=9}), 60),
  953.         b = buildframes(def_subimages("st-oxydb-opening", {h=14}), 40),
  954.         c = buildframes(def_subimages("st-oxydc-opening", {h=5}), 70),
  955.         d = buildframes(def_subimages("st-oxydd-opening", {h=5}), 70),
  956.     }
  957.     local fclosing = {
  958.         a = reverseframes(fopening["a"]),
  959.         b = reverseframes(fopening["b"]),
  960.         c = reverseframes(fopening["c"]),
  961.         d = reverseframes(fopening["d"]),
  962.     }
  963.  
  964.     function mkopenclose(flavor, color)
  965.         local n = "st-oxyd" .. flavor .. color
  966.         local fadein = "oxyd"..flavor.."-fadein"
  967.         local fadeout= "oxyd"..flavor.."-fadeout"
  968.  
  969.         def_overlay(n.."-base", {baseimg[flavor], colorspots[color+1]})
  970.         display.DefineComposite(n.."-opening-fg", n.."-base", fadein)
  971.         display.DefineComposite(n.."-closing-fg", n.."-base", fadeout)
  972.         def_shmodel (n.."-opening", n.."-opening-fg", shadow[flavor])
  973.         def_shmodel (n.."-closing", n.."-closing-fg", shadow[flavor])
  974.     end
  975.  
  976.     function mkblink(flavor, color)
  977.         local n = "st-oxyd"..flavor..color.."-blink"
  978.         local img={baseimg[flavor],colorspots[color+1], "st-oxyd-questmark"}
  979.         def_overlay(n..1, img)
  980.         def_overlay(n..2, {baseimg[flavor], colorspots[color+1]})
  981.         def_anim(n.."-anim", buildframes({n..1,n..2}, 500), 1)
  982.         def_shmodel(n, n.."-anim", shadow[flavor])
  983.     end
  984.  
  985.     function mkopened(flavor, color)
  986.         local n = "st-oxyd" .. flavor .. color .. "-open"
  987.         local names = {}
  988.  
  989.         for i=1,getn(openovls) do
  990.             local images={baseimg[flavor],colorspots[color+1],openovls[i]}
  991.             names[i] = n .. format("_%04d", i)
  992.             def_overlay(names[i], images)
  993.         end
  994.  
  995.         -- compose these images into an animation
  996.         frames = pingpong(buildframes(names, 100))
  997.         def_anim(n.."-anim", frames, TRUE)
  998.  
  999.         -- and finally add a shadow to make the model complete
  1000.         def_shmodel(n, n.."-anim", shadow[flavor])
  1001.     end
  1002.  
  1003.     function mkoxyd(flavor)
  1004.         def_stone("st-oxyd"..flavor, shadow[flavor])
  1005.         def_shmodel("st-likeoxyd"..flavor, "st-oxyd"..flavor, shadow[flavor])
  1006. --        def_solidstone("st-likeoxyd"..flavor, "st-oxyd"..flavor)
  1007.         img=def_image("st-oxyd"..flavor.."-open")
  1008.         def_shmodel("st-likeoxyd"..flavor.."-open", img, shadow[flavor])
  1009.  
  1010.         local fadein = "oxyd"..flavor.."-fadein"
  1011.         local fadeout= "oxyd"..flavor.."-fadeout"
  1012.         def_anim(fadein, fopening[flavor])
  1013.         def_anim(fadeout, fclosing[flavor])
  1014.  
  1015.         for color=0,7 do
  1016.             mkopenclose(flavor, color)
  1017.             mkblink(flavor, color)
  1018.             mkopened(flavor, color)
  1019.         end
  1020.     end
  1021.     mkoxyd("a")
  1022.     mkoxyd("b")
  1023. --    Progress(50)
  1024.     mkoxyd("d")
  1025.     mkoxyd("c")
  1026. end
  1027.  
  1028. def_alias("st-coffee", "st-oxydc")
  1029.  
  1030. --Progress(60)
  1031.  
  1032. -----------------
  1033. -- Laser stone --
  1034. -----------------
  1035. function make_laser(dir)
  1036.     laseron=framenames("st-laser"..dir, 1, 9)
  1037.  
  1038.     -- deactivated laser
  1039.     def_overlay("laser"..dir, {"st-laser-base", laseron[1]})
  1040.     def_roundstone("st-laser"..dir, "laser"..dir)
  1041.  
  1042.     -- activated laser
  1043.     names = {}
  1044.     for i=1,getn(laseron) do
  1045.     names[i] = "st-laseron"..dir .. format("_%04d", i)
  1046.     def_overlay (names[i], {"st-laser-base", laseron[i]})
  1047.     end
  1048.     frames = buildframes(names, 100)
  1049.     def_anim("st-laseron-anim"..dir, frames, 1)
  1050.     def_roundstone("st-laseron"..dir, "st-laseron-anim"..dir)
  1051. end
  1052.  
  1053. make_laser("-e")
  1054. make_laser("-s")
  1055. make_laser("-w")
  1056. make_laser("-n")
  1057.  
  1058. ---------------------
  1059. -- Fake oxyd stone --
  1060. ---------------------
  1061. def_stone("st-fakeoxyd", "sh-round", {filename="st-oxydb"})
  1062. def_anim_images("fakeoxyd-blink",
  1063.                 repeatanim(pingpong(
  1064.                             buildframes(framenames("st-fakeoxyd-blink", 1,4),
  1065.                                         50))))
  1066. def_roundstone("st-fakeoxyd-blink", "fakeoxyd-blink")
  1067.  
  1068. def_alias("st-fakeoxyda", "st-oxyda")
  1069.  
  1070. -- Fart stone
  1071. def_stone("st-fart", "sh-round", {filename="st-oxydb"})
  1072. def_anim_images("farting",
  1073.                 repeatanim(pingpong(
  1074.                             buildframes(framenames("st-fakeoxyd-blink", 1,4),
  1075.                                         50))))
  1076. def_roundstone("st-farting", "farting")
  1077.  
  1078. namelist = def_subimages("st-fart-break",{h=6})
  1079. def_anim("fartbreak-anim", buildframes(namelist,50))
  1080. def_roundstone("st-fartbreak-anim", "fartbreak-anim")
  1081.  
  1082. -- st-rock3_movebreak
  1083.  
  1084. namelist = def_subimages("st-rock3-break", {h=6})
  1085. def_anim("rock3_break-anim",buildframes(namelist,50))
  1086. def_solidstone("st-rock3_break-anim", "rock3_break-anim")
  1087. def_alias("st-rock3_movebreak", "st-rock3")
  1088.  
  1089. -- st-rock3-falling
  1090.  
  1091. do
  1092.     local n = def_subimages("st-rock3-falling", {h=4})
  1093.     def_anim("st-rock3-falling", buildframes(n, 100))
  1094. end
  1095.  
  1096. -- Breaking stone
  1097.  
  1098. def_alias("st-breaking", "st-rock3_break-anim")
  1099.  
  1100. -- Actor impulse stone
  1101. do
  1102.    namelist = def_subimages("st-actorimpulse", {h=3})
  1103.    shnamelist = def_subimages("sh-actorimpulse", {h=3,imgw=ShadowSize,imgh=ShadowSize})
  1104.  
  1105.    def_anim("st-ai-fg", pingpong(buildframes(namelist, 30)))
  1106.    def_anim("st-ai-sh", pingpong(buildframes(shnamelist, 30)))
  1107.    def_shmodel("st-actorimpulse-anim", "st-ai-fg", "st-ai-sh")
  1108.  
  1109.    def_shmodel("st-actorimpulse", namelist[1], shnamelist[1])
  1110. end
  1111.  
  1112. -- Stone impulse stone
  1113. --
  1114. -- Note: It's important that the duration of the closing animation
  1115. -- (anim2) is longer than the opening animation (anim1). Otherwise
  1116. -- impulse stones do not work properly!
  1117.  
  1118. do
  1119.    namelist = def_subimages("st-stoneimpulse", {h=4})
  1120.    def_roundstone("st-stoneimpulse", namelist[1])
  1121.    frames={}
  1122.    for i=1,4 do tinsert(frames, namelist[i]) end
  1123.    def_anim("stoneimpulse-anim1", buildframes(frames, 55))
  1124.    def_roundstone("st-stoneimpulse-anim1", "stoneimpulse-anim1")
  1125.    tinsert(frames, namelist[4]) -- add 1 frame to make closing anim longer!
  1126.    def_anim("stoneimpulse-anim2", reverseframes(buildframes(frames, 55)))
  1127.    def_roundstone("st-stoneimpulse-anim2", "stoneimpulse-anim2")
  1128. end
  1129.  
  1130. do
  1131.    namelist = def_subimages("st-stoneimpulse-hollow", {h=4})
  1132.    def_shmodel("st-stoneimpulse-hollow", namelist[1], "sh-floating")
  1133.    frames={}
  1134.    for i=1,4 do tinsert(frames, namelist[i]) end
  1135.    def_anim("stoneimpulse-hollow-anim1", buildframes(frames, 55))
  1136.    def_shmodel("st-stoneimpulse-hollow-anim1", "stoneimpulse-hollow-anim1", "sh-floating")
  1137.    tinsert(frames, namelist[4]) -- add 1 frame to make closing anim longer!
  1138.    def_anim("stoneimpulse-hollow-anim2", reverseframes(buildframes(frames, 55)))
  1139.    def_shmodel("st-stoneimpulse-hollow-anim2", "stoneimpulse-hollow-anim2", "sh-floating")
  1140. end
  1141.  
  1142. ---------------------------
  1143. -- Thief stone and floor --
  1144. ---------------------------
  1145. do
  1146.     -- Base images
  1147.  
  1148.     local stonebase = "st-bluegray"
  1149.     local floorbase = "fl-bluegray"
  1150.     local thiefovl = def_subimages("thief-template", {h = 7})
  1151.     local capturedovl = def_subimages("thief-captured-template", {h = 12})
  1152.  
  1153.     -- Creating st-thief
  1154.  
  1155.     local names = {}
  1156.     for j = 1, getn(thiefovl) do
  1157.         names[j] = "st-thief"..format("_%04d", j)
  1158.         display.DefineComposite(names[j], stonebase, thiefovl[j])
  1159.     end
  1160.  
  1161.     local f1 = buildframes(names, 80)
  1162.     def_anim("pre-st-thief-emerge", f1)
  1163.     def_anim("pre-st-thief-retreat", reverseframes(f1))
  1164.     def_roundstone("st-thief", stonebase)
  1165.     def_roundstone("st-thief-emerge", "pre-st-thief-emerge")
  1166.     def_roundstone("st-thief-retreat", "pre-st-thief-retreat")
  1167.  
  1168.     -- Creating st-thief-captured
  1169.     --
  1170.     --   Note that this is done without template, as the whole
  1171.     --   stone has to disappear (e.g. via shrinking)
  1172.  
  1173.     local img2 = def_subimages("st-thief-captured", {h = 12})
  1174.     local f2 = buildframes(img2, 80)
  1175.     def_anim("st-thief-captured", f2)
  1176.  
  1177.     -- Creating fl-thief
  1178.  
  1179.     local floornames = {}
  1180.     local floorcaptured = {}
  1181.     local floorbases = def_subimages(floorbase, {h=4, modelname="fl-thief-base"})
  1182.     for k = 1,4 do
  1183.       floornames[k] = {}
  1184.       for j = 1, getn(thiefovl) do
  1185.         floornames[k][j] = "fl-thief"..k..format("_%04d", j)
  1186.         display.DefineComposite(floornames[k][j], floorbases[k], thiefovl[j])
  1187.       end
  1188.       floorcaptured[k] = {}
  1189.       for j = 1, getn(capturedovl) do
  1190.         floorcaptured[k][j] = "fl-thief"..k.."-captured"..format("_%04d", j)
  1191.         display.DefineComposite(floorcaptured[k][j], floorbases[k], capturedovl[j])
  1192.       end
  1193.       local f3 = buildframes(floornames[k], 80)
  1194.       local f4 = buildframes(floorcaptured[k], 80)
  1195.       def_alias("fl-thief"..k, floorbases[k])
  1196.       def_anim("fl-thief"..k.."-emerge", f3)
  1197.       def_anim("fl-thief"..k.."-retreat", reverseframes(f3))
  1198.       def_anim("fl-thief"..k.."-captured", f4)
  1199.     end
  1200.  
  1201. --do
  1202. --    local img = def_subimages("fl-thief", {h=7})
  1203. --    local f = buildframes(img, 80)
  1204. --    def_anim("thief-emerge", f)
  1205. --    def_anim("thief-retreat", reverseframes(f))
  1206. --    def_roundstone("fl-thief", img[1])
  1207. --    def_roundstone("fl-thief-emerge", "thief-emerge")
  1208. --    def_roundstone("fl-thief-retreat", "thief-retreat")
  1209. --end
  1210.  
  1211. end
  1212.  
  1213. -----------------
  1214. -- Chess stone --
  1215. -----------------
  1216. function make_chess(colour)
  1217.     local img1 = def_subimages("st-chess"..colour, {h=5});
  1218.     --local img2 = def_subimages("st-chess"..colour.."-captured", {h=5});
  1219.     local f1 = buildframes(img1, 120)
  1220.     --local f2 = buildframes(img2, 40)
  1221.     local f2 = f1
  1222.     local f3 = buildframes(img1, 500)
  1223.     def_anim("st-chess"..colour.."-disappearing", f1);
  1224.     def_anim("st-chess"..colour.."-appearing", reverseframes(f1))
  1225.     def_anim("st-chess"..colour.."-captured", f2);
  1226.     def_anim("st-chess"..colour.."-swamp", f3);
  1227.     def_roundstone("st-chess"..colour, img1[1])
  1228. end
  1229.  
  1230. make_chess("_black")
  1231. make_chess("_white")
  1232.  
  1233. -----------------
  1234. -- Timer stone --
  1235. -----------------
  1236. do
  1237.     local img = def_subimages("st-timer", {h=4})
  1238.     def_anim("timer-anim", buildframes(img, 120), 1)
  1239.     def_roundstone("st-timer", "timer-anim")
  1240.     def_roundstone("st-timeroff", "st-timer1")
  1241. end
  1242.  
  1243. -----------------
  1244. -- Bomb Stones --
  1245. -----------------
  1246.  
  1247. function make_bombstone(name)
  1248.     local n=def_subimages(name, {h=7})
  1249.     def_roundstone(name, name.."1")
  1250.     def_anim(name.."-anim", buildframes(n,50))
  1251. end
  1252.  
  1253. make_bombstone("st-bombs")
  1254. make_bombstone("st-dynamite")
  1255. make_bombstone("st-whitebombs")
  1256.  
  1257. ----------------
  1258. -- Mail stone --
  1259. ----------------
  1260. do
  1261.     local n=def_subimages("st-mail", {h=4})
  1262.     def_solidstone("st-mail-n", "st-mail1")
  1263.     def_solidstone("st-mail-e", "st-mail2")
  1264.     def_solidstone("st-mail-s", "st-mail4")
  1265.     def_solidstone("st-mail-w", "st-mail3")
  1266. end
  1267.  
  1268. function def_solidstone_with_anim(name, npictures, frametime)
  1269.     local n=def_subimages(name, {h=npictures})
  1270.     def_anim(name.."-animfg", buildframes(n,frametime))
  1271.     def_solidstone(name.."-anim", name.."-animfg")
  1272.     def_solidstone(name, n[1])
  1273. end
  1274. function def_roundstone_with_anim(name, npictures, frametime)
  1275.     local n=def_subimages(name, {h=npictures})
  1276.     def_anim(name.."-animfg", buildframes(n,frametime))
  1277.     def_roundstone(name.."-anim", name.."-animfg")
  1278.     def_roundstone(name, n[1])
  1279.  end
  1280.  
  1281. def_solidstone_with_anim ("st-window", 4, 80)
  1282. def_solidstone_with_anim ("st-stone_break", 10, 50)
  1283. def_solidstone_with_anim ("st-break_bolder", 10, 50)
  1284. def_roundstone_with_anim ("st-break_acwhite", 10, 50)
  1285. def_roundstone_with_anim ("st-break_acblack", 10, 50)
  1286. def_roundstone_with_anim ("st-break_gray", 10, 50)
  1287. def_roundstone_with_anim ("st-death", 3, 140)
  1288.  
  1289.  
  1290. -- Flash stone --
  1291. do
  1292.     local n=def_subimages("st-flash", {h=1})
  1293.     def_solidstone("st-flash", "st-flash1")
  1294. end
  1295.  
  1296. -- Surprise stone --
  1297. do
  1298.     def_stone ("st-surprise")
  1299. end
  1300.  
  1301. -- Charge stones --
  1302. do
  1303.     function def_chargestone(basename)
  1304.         local n=def_subimages(basename, {h=2})
  1305.         def_solidstone(basename, n[1])
  1306.         def_anim(basename.."-animfg", {{n[2], 140}})
  1307.         def_solidstone(basename.."-anim", basename.."-animfg")
  1308.     end
  1309.     def_chargestone("st-chargeplus")
  1310.     def_chargestone("st-chargeminus")
  1311.     def_chargestone("st-chargezero")
  1312. end
  1313.  
  1314. ---------------
  1315. -- Turnstile --
  1316. ---------------
  1317. do
  1318.    local img = def_subimages("st-turnstile", {h=2})
  1319.    def_anim("turnstile-anim", reverseframes(buildframes(img, 30)))
  1320.    def_solidstone("st-turnstile", img[1])
  1321.    def_solidstone("st-turnstile-anim", "turnstile-anim")
  1322. end
  1323.  
  1324. do
  1325.    local img = def_subimages("st-turnstile-green", {h=2})
  1326.    def_anim("turnstile-green-anim", reverseframes(buildframes(img, 30)))
  1327.    def_solidstone("st-turnstile-green", img[1])
  1328.    def_solidstone("st-turnstile-green-anim", "turnstile-green-anim")
  1329. end
  1330.  
  1331. ----------------
  1332. -- Timeswitch --
  1333. ----------------
  1334. do
  1335.     def_stone("st-timeswitch")
  1336.     local img = def_subimages("st-time1switch", {h=2})
  1337.     def_anim("st-time1switch-anim", buildframes (img, 180), 1)
  1338.     def_solidstone("st-time1switch", "st-time1switch-anim")
  1339. end
  1340.  
  1341. --Progress(70)
  1342.  
  1343. -------------
  1344. -- Mirrors --
  1345. -------------
  1346.  
  1347. -- naming scheme for mirror models:
  1348. --
  1349. --    st-{3mirror,pmirror}-{m,s}{o,t}[1234]
  1350. --
  1351. -- {m,s} -> movable or static
  1352. -- {o,t} -> opaque or transparent
  1353. --
  1354. -- The numbers map to actual orientations as follows:
  1355. --
  1356. --   NUMBER    TRIANG.M.   PLANE M.
  1357. --    1    south      "v"        "-"
  1358. --    2    west      "<"        "\"
  1359. --    3    north      "^"        "|"
  1360. --    4    east      ">"        "/"
  1361.  
  1362. function make_mirror(basename, baseimg, overlays)
  1363.     for i=1,4 do
  1364.     mname = basename .. i
  1365.     def_overlay (mname .. "-ovl", {baseimg, overlays[i]})
  1366.     def_shmodel(mname, mname .. "-ovl", "sh-round2")
  1367.     end
  1368. end
  1369.  
  1370. mirror3_opaque = framenames("st-mirrortempl", 1, 4)
  1371. mirror3_transp = framenames("st-mirrortempl", 5, 8)
  1372. mirrorp_opaque = framenames("st-mirrortempl", 9, 12)
  1373. mirrorp_transp = framenames("st-mirrortempl", 13, 16)
  1374.  
  1375. make_mirror("st-3mirror-mo", "st-mirror-movable", mirror3_opaque)
  1376. make_mirror("st-3mirror-so", "st-mirror-static",  mirror3_opaque)
  1377. make_mirror("st-3mirror-mt", "st-mirror-movable", mirror3_transp)
  1378. make_mirror("st-3mirror-st", "st-mirror-static",  mirror3_transp)
  1379.  
  1380. make_mirror("st-pmirror-mo", "st-mirror-movable", mirrorp_opaque)
  1381. make_mirror("st-pmirror-so", "st-mirror-static",  mirrorp_opaque)
  1382. make_mirror("st-pmirror-mt", "st-mirror-movable", mirrorp_transp)
  1383. make_mirror("st-pmirror-st", "st-mirror-static",  mirrorp_transp)
  1384.  
  1385. -- OneWay --
  1386. do
  1387.    local model_names = {  
  1388.        "st-oneway-e", "st-oneway-n", "st-oneway-s", "st-oneway-w",
  1389.        "st-oneway_black-e", "st-oneway_black-n", "st-oneway_black-s", "st-oneway_black-w",
  1390.        "st-oneway_white-e", "st-oneway_white-n", "st-oneway_white-s", "st-oneway_white-w"
  1391.    }
  1392.    def_subimages("st-oneway", {modelname="st-onewayx",w=3,h=4})
  1393.    for i=1,12 do def_floatingstone(model_names[i], "st-onewayx"..i) end
  1394. end
  1395.  
  1396. ---------------
  1397. -- Coin slot --
  1398. ---------------
  1399. do
  1400.     def_stone("st-coinslot")
  1401.     local img=def_subimages("st-coin2slot", {h=18})
  1402.     def_anim("st-coin2slot-anim", buildframes(img, 20))
  1403.     def_solidstone("st-coin2slot", "st-coin2slot-anim")
  1404.     def_solidstone("st-coinslot-active", "st-coin2slot18")
  1405. end
  1406.  
  1407.  
  1408. --Progress(80)
  1409.  
  1410. -------------------
  1411. -- Puzzle stones --
  1412. -------------------
  1413. do
  1414.     def_subimages("st-puzzle", {modelname="st-puzzlex",w=8,h=4})
  1415.     for i=2,16  do def_solidstone("st-puzzle"..i, "st-puzzlex"..i) end
  1416.     for i=18,32 do def_solidstone("st-puzzle"..i, "st-puzzlex"..i) end
  1417.     def_shmodel("st-puzzle1", "st-puzzlex1", "sh-puzzle1")
  1418.     def_shmodel("st-puzzle17", "st-puzzlex17", "sh-puzzle1")
  1419. end
  1420.  
  1421. def_alias("st-turnstile-e", "st-puzzle2")
  1422. def_alias("st-turnstile-w", "st-puzzle5")
  1423. def_alias("st-turnstile-s", "st-puzzle9")
  1424. def_alias("st-turnstile-n", "st-puzzle3")
  1425. --def_stone("st-turnstile")
  1426.  
  1427. ---------------
  1428. -- Big brick --
  1429. ---------------
  1430.  
  1431. do
  1432.    def_subimages("st-bigbrick", {modelname="st-bigbrickx",w=4,h=4})
  1433.    for i=1,16 do def_solidstone("st-bigbrick"..i, "st-bigbrickx"..i) end
  1434. end
  1435.  
  1436. --def_alias("st-bigbrick", "st-bigbrick1");
  1437. --def_alias("st-bigbrick-n", "st-bigbrick9");
  1438. --def_alias("st-bigbrick-e", "st-bigbrick5");
  1439. --def_alias("st-bigbrick-s", "st-bigbrick3");
  1440. --def_alias("st-bigbrick-w", "st-bigbrick2");
  1441. --def_alias("st-bigbrick-ne", "st-bigbrick13");
  1442. --def_alias("st-bigbrick-nw", "st-bigbrick10");
  1443. --def_alias("st-bigbrick-es", "st-bigbrick7");
  1444. --def_alias("st-bigbrick-sw", "st-bigbrick4");
  1445. --def_alias("st-bigbrick-ns", "st-bigbrick11");
  1446. --def_alias("st-bigbrick-ew", "st-bigbrick6");
  1447. --def_alias("st-bigbrick-nes", "st-bigbrick15");
  1448. --def_alias("st-bigbrick-new", "st-bigbrick14");
  1449. --def_alias("st-bigbrick-nsw", "st-bigbrick12");
  1450. --def_alias("st-bigbrick-esw", "st-bigbrick8");
  1451. --def_alias("st-bigbrick-nesw", "st-bigbrick16");
  1452.  
  1453. -----------------
  1454. -- BigBlueSand --
  1455. -----------------
  1456.  
  1457. do
  1458.    def_subimages("st-bigbluesand", {modelname="st-bigbluesandx",w=4,h=4})
  1459.    for i=1,16 do def_solidstone("st-bigbluesand"..i, "st-bigbluesandx"..i) end
  1460. end
  1461.  
  1462. -----------
  1463. -- Doors --
  1464. -----------
  1465. do
  1466.     local f,img,sh
  1467.  
  1468.     img=def_subimages("st-doorh", {h=7})
  1469.     sh=def_subimages("sh-doorh", {h=7,imgw=ShadowSize,imgh=ShadowSize})
  1470.     def_shmodel("st-doorh-open", img[1], sh[1])
  1471.     def_shmodel("st-doorh-closed", img[7], sh[7])
  1472.     def_anim("doorh-opening-fg", reverseframes(buildframes(img, 60)))
  1473.     def_anim("doorh-opening-bg", reverseframes(buildframes(sh, 60)))
  1474.     def_shmodel("st-doorh-opening", "doorh-opening-fg", "doorh-opening-bg")
  1475.     def_anim("doorh-closing-fg", buildframes(img, 60))
  1476.     def_anim("doorh-closing-bg", buildframes(sh, 60))
  1477.     def_shmodel("st-doorh-closing", "doorh-closing-fg", "doorh-closing-bg")
  1478.  
  1479.  
  1480.     img=def_subimages("st-doorv", {w=7})
  1481.     sh=def_subimages("sh-doorv", {w=7,imgw=ShadowSize,imgh=ShadowSize})
  1482.     def_shmodel("st-doorv-open", img[1], sh[1])
  1483.     def_shmodel("st-doorv-closed", img[7], sh[7])
  1484.     def_anim("doorv-opening-fg", reverseframes(buildframes(img, 60)))
  1485.     def_anim("doorv-opening-bg", reverseframes(buildframes(sh, 60)))
  1486.     def_shmodel("st-doorv-opening", "doorv-opening-fg", "doorv-opening-bg")
  1487.     def_anim("doorv-closing-fg", buildframes(img, 60))
  1488.     def_anim("doorv-closing-bg", buildframes(sh, 60))
  1489.     def_shmodel("st-doorv-closing", "doorv-closing-fg", "doorv-closing-bg")
  1490. end
  1491.  
  1492. -- Door_a --
  1493. do
  1494.     def_alias("st-door_a-open", "st-grate1")
  1495.     def_alias("st-door_a-closed", "st-oxyda")
  1496.     local f = buildframes({"st-door_a-closed", "st-door_a-open"},60)
  1497.     def_anim("st-door_a-opening", f)
  1498.     def_anim("st-door_a-closing", reverseframes(f))
  1499. end
  1500.  
  1501. -- Door_b --
  1502. do
  1503.     def_alias("st-door_b-open", "invisible")
  1504.     def_alias("st-door_b-closed", "st-plain")
  1505.     local img=def_subimages("st-doorb", {modelname="doorb", h=8})
  1506.     local f = buildframes(img,60)
  1507.     def_anim("st-door_b-opening", f)
  1508.     def_anim("st-door_b-closing", reverseframes(f))
  1509. end
  1510.  
  1511. -- Door_c --
  1512. do
  1513.     def_alias("st-door_c-open", "st-grate2")
  1514.     def_alias("st-door_c-closed", "st-plain")
  1515.     frames=buildframes({"st-door_c-closed","st-door_c-open"},60)
  1516.     def_anim("st-door_c-opening", frames)
  1517.     def_anim("st-door_c-closing", reverseframes(frames))
  1518. end
  1519.  
  1520. ------------------
  1521. -- Knight stone --
  1522. ------------------
  1523. do
  1524.     local n = def_subimages("st-knight", {modelname="knight", h=5})
  1525.     for i=1,getn(n) do
  1526.         def_solidstone("st-knight"..i, n[i])
  1527.     end
  1528. end
  1529.  
  1530. -------------------
  1531. -- Shogun stones --
  1532. -------------------
  1533. do
  1534.     def_images{"sh-shogun1","sh-shogun2", "sh-shogun4"}
  1535.     def_subimages("st-shogun", {modelname="st-shogun-fg",h=7})
  1536.  
  1537.     def_shmodel("st-shogun1", "st-shogun-fg1", "sh-shogun1")
  1538.     def_shmodel("st-shogun2", "st-shogun-fg2", "sh-shogun2")
  1539.     def_shmodel("st-shogun3", "st-shogun-fg3", "sh-shogun1")
  1540.     def_shmodel("st-shogun4", "st-shogun-fg4", "sh-shogun4")
  1541.     def_shmodel("st-shogun5", "st-shogun-fg5", "sh-shogun1")
  1542.     def_shmodel("st-shogun6", "st-shogun-fg6", "sh-shogun2")
  1543.     def_shmodel("st-shogun7", "st-shogun-fg7", "sh-shogun1")
  1544. end
  1545.  
  1546. --Progress(90)
  1547.  
  1548. -------------------
  1549. -- Bolder stones --
  1550. -------------------
  1551.  
  1552. do
  1553.     local img=def_subimages("st-bolder", {w=4,h=3})
  1554.     local imgfall=def_subimages("st-bolder-fall", {w=4,h=3})
  1555.  
  1556.     function def_bolder(orient, start)
  1557.        local animname="st-bolder"..orient.."a"
  1558.        local frames={img[start], img[start+1], img[start+2]}
  1559.        def_anim(animname, buildframes(frames, 120), FALSE)
  1560.        def_shmodel("st-bolder-"..orient, animname, "sh-round")
  1561.  
  1562.        animname="st-bolder-"..orient.."-fall-anim"
  1563.        frames={imgfall[start],imgfall[start+1],imgfall[start+2]}
  1564.        def_anim(animname, buildframes(frames, 120), FALSE)
  1565.     end
  1566.  
  1567.     def_bolder("n",1)
  1568.     def_bolder("e",4)
  1569.     def_bolder("s",7)
  1570.     def_bolder("w",10)
  1571. end
  1572.  
  1573. -- Invisible stone --
  1574. def_alias("st-invisible", "invisible")
  1575. def_alias("st-invisible_magic", "invisible")
  1576. def_alias("st-stonebrush", "invisible")
  1577. def_alias("st-break_invisible", "invisible")
  1578. def_alias("st-actorimpulse_invisible", "invisible")
  1579. def_alias("st-death_invisible", "invisible")
  1580.  
  1581. ----------------------
  1582. -- Magic stones :-) --
  1583. ----------------------
  1584. do
  1585.     local img = def_subimages("st-magic", {h=4, modelname="st-magic-fg"})
  1586.     local nlist = {}
  1587.     for i=1,getn(img) do
  1588.         nlist[i] = "st-magic"..i
  1589.         def_roundstone(nlist[i], img[i])
  1590.     end
  1591.     display.DefineRandModel("st-magic", getn(nlist), nlist)
  1592. end
  1593.  
  1594. -------------------
  1595. -- Spitter stone --
  1596. -------------------
  1597. do
  1598.     def_alias ("st-spitter", "st-timeswitch")
  1599.     def_alias ("st-spitter-loading", "st-fakeoxyd-blink")
  1600.     def_alias ("st-spitter-spitting", "st-fakeoxyd-blink")
  1601. end
  1602.  
  1603. ---------------------------
  1604. -- Light Passenger Stone --
  1605. ---------------------------
  1606. do
  1607.     local img = def_subimages("st-lightpassenger", {h=7})
  1608.     def_shmodel("st-lightpassenger", img[1], "sh-glass")
  1609.     def_alias("st-lightpassenger_off", "st-glass2")
  1610.     local frames={img[2], img[3], img[4], img[5], img[6], img[7]}
  1611.     def_anim("st-lightpassenger-blink1", pingpong(buildframes(frames, 75)), TRUE)
  1612.     def_shmodel("st-lightpassenger-blink", "st-lightpassenger-blink1", "sh-glass")
  1613.     img = def_subimages("st-lightpassenger-break-v", {h=7})
  1614.     def_anim("st-lightpassenger-break-v", buildframes(img, 50), FALSE)
  1615.     img = def_subimages("st-lightpassenger-break-h", {h=7})
  1616.     def_anim("st-lightpassenger-break-h", buildframes(img, 50), FALSE)
  1617.     img = def_subimages("st-lightpassenger-break-hv", {h=7})
  1618.     def_anim("st-lightpassenger-break-hv", buildframes(img, 50), FALSE)
  1619. end
  1620.  
  1621. -------------
  1622. -- Effects --
  1623. -------------
  1624.  
  1625. Sprite{
  1626.     name     = "ring-anim", 
  1627.     nimages  = 8,
  1628.     framelen = 50,
  1629.     padding = 0.3
  1630. }
  1631.  
  1632. Sprite{
  1633.     name    = "ac-drowned",
  1634.     nimages = 5,
  1635.     framelen = 80,
  1636.     padding = 0.3
  1637. }
  1638.  
  1639. -- Halo --
  1640. Sprite{
  1641.     name     = "halo",
  1642.     nimages  = 2,
  1643.     framelen = 30,
  1644.     loop     = TRUE
  1645. }
  1646. Sprite{
  1647.     name     = "halo-blink",
  1648.     nimages  = 2,
  1649.     framelen = 30,
  1650.     loop     = TRUE
  1651. }
  1652.  
  1653. -- Halo for small balls --
  1654. Sprite{
  1655.     name     = "halo-small",
  1656.     nimages  = 2,
  1657.     framelen = 30,
  1658.     loop     = TRUE
  1659. }
  1660. Sprite{
  1661.     name     = "halo-small-blink",
  1662.     nimages  = 2,
  1663.     framelen = 30,
  1664.     loop     = TRUE
  1665. }
  1666.  
  1667. Progress(100, "Loading Enigma levels")
  1668.