home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Inne / Gry / Enigma / Enigma-1.01-w7.exe / data / levels / lib / libterrain.xml < prev    next >
Extensible Markup Language  |  2009-12-13  |  3KB  |  95 lines

  1. <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
  2. <el:level xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://enigma-game.org/schema/level/1 level.xsd" xmlns:el="http://enigma-game.org/schema/level/1">
  3.   <el:protected>
  4.     <el:info el:type="library">
  5.       <el:identity el:title="" el:id="lib/libterrain"/>
  6.       <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
  7.       <el:author  el:name="Raoul Bourquin" el:email="" el:homepage=""/>
  8.       <el:copyright>Copyright ┬⌐ 2006 Raoul Bourquin</el:copyright>
  9.       <el:license el:type="GPL v2.0 or above" el:open="true"/>
  10.       <el:compatibility el:enigma="0.92">
  11.       </el:compatibility>
  12.       <el:modes el:easy="false" el:single="false" el:network="false"/>
  13.       <el:comments>
  14.         <el:code>Lua 5.1 and XML converted by Leveladministrators</el:code>
  15.       </el:comments>
  16.       <el:score el:easy="-" el:difficult="-"/>
  17.     </el:info>
  18.     <el:luamain><![CDATA[
  19. -- libterrain, a Library for Enigma
  20. -- Version 1.0
  21. -- Lua-lib zum einfachen erstellen von Bergen und Taelern.
  22.  
  23. ----------------------------------------------------
  24. --MOUNTAIN/VALLEY-RING:
  25.  
  26. function draw_ring(x0,y0,xw,yw,was)
  27.  
  28. --x0,y0: obere linke ecke
  29. --xw,yw: breite, hoehe des rings
  30. --was:entscheidet ob mountain- oder valleyring
  31. --was=0: tal, was=1: berg
  32.  
  33.  --Machbarkeits-Test:
  34.  if xw<2 or yw<2 then
  35.   set_item("it-document",x0,y0,{text="ERROR: To small Values!"})
  36.   return
  37.  end
  38.  
  39.  if was==1 then
  40.   --Ecken:
  41.   set_floor("fl-gradient12",x0,y0)
  42.   set_floor("fl-gradient10",x0+xw-1,y0)
  43.   set_floor("fl-gradient11",x0,y0+yw-1)
  44.   set_floor("fl-gradient9",x0+xw-1,y0+yw-1)
  45.   --Kanten:
  46.   draw_floor("fl-gradient2",{x0+1,y0},{1,0},xw-2)
  47.   draw_floor("fl-gradient1",{x0+1,y0+yw-1},{1,0},xw-2)
  48.   draw_floor("fl-gradient4",{x0,y0+1},{0,1},yw-2)
  49.   draw_floor("fl-gradient3",{x0+xw-1,y0+1},{0,1},yw-2)
  50.  
  51.  else --was==0
  52.   --Ecken:
  53.   set_floor("fl-gradient5",x0,y0)
  54.   set_floor("fl-gradient6",x0+xw-1,y0)
  55.   set_floor("fl-gradient7",x0,y0+yw-1)
  56.   set_floor("fl-gradient8",x0+xw-1,y0+yw-1)
  57.   --Kanten:
  58.   draw_floor("fl-gradient1",{x0+1,y0},{1,0},xw-2)
  59.   draw_floor("fl-gradient2",{x0+1,y0+yw-1},{1,0},xw-2)
  60.   draw_floor("fl-gradient3",{x0,y0+1},{0,1},yw-2)
  61.   draw_floor("fl-gradient4",{x0+xw-1,y0+1},{0,1},yw-2)
  62.  end
  63.  
  64. end
  65. ----------------------------------------------------
  66. --MOUNTAIN/VALLEY-FULL
  67.  
  68. function draw_full(x0,y0,xw,yw,was)
  69.  
  70.  ok=TRUE
  71.  xwm=xw
  72.  ywm=yw
  73.  x0m=x0
  74.  y0m=y0
  75.  
  76.  while ok==TRUE do
  77.   draw_ring(x0m,y0m,xwm,ywm,was)
  78.  
  79.   xwm=xwm-2
  80.   ywm=ywm-2
  81.   x0m=x0m+1
  82.   y0m=y0m+1
  83.  
  84.   if xwm<2 or ywm<2 then
  85.    ok=FALSE
  86.   end
  87.  end
  88. end
  89. ----------------------------------------------------
  90.     ]]></el:luamain>
  91.     <el:i18n>
  92.     </el:i18n>
  93.   </el:protected>
  94. </el:level>
  95.