-- A level for Enigma -- Name: -- Filename: -- Copyright: (C) Oct 2003 Ralf Westram -- Contact: address@hidden -- License: GPL v2.0 or above dofile(enigma.FindDataFile("levels/ralf.lua")) --debug_mode() level={ "T###################", "# #", "# #", "# #", "# o#", "# #", "# a #", "# o#", "# #", "# #", "# #", "# #", "####################", } cells={} floor_normal="fl-bluegray" floor_cursor="fl-sahara" stone_cursor="st-glass" cells[" "] = cell{floor=floor_normal} cells["#"] = cell{stone="st-marble"} cells["o"] = cell{oxyd} cells["a"] = cell{actor={"ac-blackball", {player=0, name="ball"}}} cells["T"] = cell{stone={face="st-timer",attr={action="callback", target="tick",interval=0.03}}} -- lighted=0 lightedx=-1 lightedy=-1 function tick() local x,y = enigma.GetPos(enigma.GetNamedObject("ball")) local insert=0 print(format("x=%i y=%i", x,y)) if (lighted==0) then lighted=1 insert=1 else if ((x ~= lightedx) or (y ~= lightedy)) then set_floor(floor_normal,lightedx,lightedy) enigma.KillStone(mapw-lightedx-1, maph-lightedy-1) insert=1 end end if (insert==1) then lightedx=x lightedy=y set_floor(floor_cursor,lightedx,lightedy) set_stone(stone_cursor,mapw-lightedx-1, maph-lightedy-1) end end -- rs_create_world(level,cells) oxyd_shuffle()