-- Smutty Smurf 2003 levelw = 20 levelh = 13 create_world(levelw, levelh) oxyd_default_flavor = "d" -- Default flavor for oxyd stones. fill_floor("fl-sahara", 0,0, level_width,level_height) function renderLine( line, pattern) for i=1, strlen(pattern) do local c = strsub( pattern, i, i) if c == "G" then set_stone("st-glass",i-1,line) elseif c=="a" then doorh( i-1,line, {name="door1"}) elseif c=="b" then doorv( i-1,line, {name="door2"}) elseif c=="c" then doorv( i-1,line, {name="door3"}) elseif c=="d" then doorh( i-1,line, {name="door4"}) elseif c=="1" then set_stone("st-fourswitch", i-1,line, {action="callback", target="s1"}) elseif c=="2" then set_stone("st-fourswitch", i-1,line, {action="callback", target="s2"}) elseif c=="3" then set_stone("st-fourswitch", i-1,line, {action="callback", target="s3"}) elseif c=="4" then set_stone("st-fourswitch", i-1,line, {action="callback", target="s4"}) elseif c=="w" then set_stone("st-bolder", i-1,line, {name="bolder1", direction=NORTH}) elseif c=="x" then set_stone("st-bolder", i-1,line, {name="bolder2", direction=NORTH}) elseif c=="y" then set_stone("st-bolder", i-1,line, {name="bolder3", direction=NORTH}) elseif c=="z" then set_stone("st-bolder", i-1,line, {name="bolder4", direction=NORTH}) elseif c == "O" then oxyd(i-1,line) elseif c == "B" then set_actor("ac-blackball", i-.5,line+.5, {player=0}) set_item("it-yinyang",i,line+1) elseif c == "W" then set_actor("ac-whiteball", i-.5,line+.5, {player=1}) set_item("it-yinyang",i-1,line) end end end -- 01234567890123456789 renderLine(00, "G12GGGGGGGGGGGGGGGGG") renderLine(01, "GB Gw xG") renderLine(02, "G G G") renderLine(03, "G34G G") renderLine(04, "GGG G") renderLine(05, "Gy G") renderLine(06, "G G") renderLine(07, "G G G") renderLine(08, "G GOGG") renderLine(09, "G GGaGG") renderLine(10, "G GObWcO") renderLine(11, "G zGGdGG") renderLine(12, "GGGGGGGGGGGGGGGGGOGG") -- 01234567890123456789 set_item ("it-trigger", 7, 4, {action="openclose", target="door1"}) set_item ("it-trigger", 12, 4, {action="openclose", target="door2"}) set_item ("it-trigger", 7, 8, {action="openclose", target="door3"}) set_item ("it-trigger", 12, 8, {action="openclose", target="door4"}) hitcounter1=0 hitcounter2=0 hitcounter3=0 hitcounter4=0 function s1() if hitcounter1 == 0 then set_attribs(enigma.GetNamedObject("bolder1"), {direction=EAST}) end if hitcounter1 == 1 then set_attribs(enigma.GetNamedObject("bolder1"), {direction=SOUTH}) end if hitcounter1 == 2 then set_attribs(enigma.GetNamedObject("bolder1"), {direction=WEST}) end if hitcounter1 == 3 then set_attribs(enigma.GetNamedObject("bolder1"), {direction=NORTH}) end hitcounter1 = hitcounter1 + 1 if hitcounter1 == 4 then hitcounter1 = 0 end end function s2() if hitcounter2 == 0 then set_attribs(enigma.GetNamedObject("bolder2"), {direction=EAST}) end if hitcounter2 == 1 then set_attribs(enigma.GetNamedObject("bolder2"), {direction=SOUTH}) end if hitcounter2 == 2 then set_attribs(enigma.GetNamedObject("bolder2"), {direction=WEST}) end if hitcounter2 == 3 then set_attribs(enigma.GetNamedObject("bolder2"), {direction=NORTH}) end hitcounter2 = hitcounter2 + 1 if hitcounter2 == 4 then hitcounter2 = 0 end end function s3() if hitcounter3 == 0 then set_attribs(enigma.GetNamedObject("bolder3"), {direction=EAST}) end if hitcounter3 == 1 then set_attribs(enigma.GetNamedObject("bolder3"), {direction=SOUTH}) end if hitcounter3 == 2 then set_attribs(enigma.GetNamedObject("bolder3"), {direction=WEST}) end if hitcounter3 == 3 then set_attribs(enigma.GetNamedObject("bolder3"), {direction=NORTH}) end hitcounter3 = hitcounter3 + 1 if hitcounter3 == 4 then hitcounter3 = 0 end end function s4() if hitcounter4 == 0 then set_attribs(enigma.GetNamedObject("bolder4"), {direction=EAST}) end if hitcounter4 == 1 then set_attribs(enigma.GetNamedObject("bolder4"), {direction=SOUTH}) end if hitcounter4 == 2 then set_attribs(enigma.GetNamedObject("bolder4"), {direction=WEST}) end if hitcounter4 == 3 then set_attribs(enigma.GetNamedObject("bolder4"), {direction=NORTH}) end hitcounter4 = hitcounter4 + 1 if hitcounter4 == 4 then hitcounter4 = 0 end end oxyd_shuffle()