File: libterrain.xml

package info (click to toggle)
enigma 1.30%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 76,132 kB
  • sloc: xml: 162,251; cpp: 67,393; ansic: 28,606; makefile: 1,986; sh: 1,298; yacc: 288; perl: 84; sed: 16
file content (94 lines) | stat: -rw-r--r-- 2,725 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<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">
  <el:protected>
    <el:info el:type="library">
      <el:identity el:title="" el:id="lib/libterrain"/>
      <el:version el:score="1" el:release="1" el:revision="0" el:status="released"/>
      <el:author  el:name="Raoul Bourquin" el:email="" el:homepage=""/>
      <el:copyright>Copyright © 2006 Raoul Bourquin</el:copyright>
      <el:license el:type="GPL v2.0 or above" el:open="true"/>
      <el:compatibility el:enigma="0.92">
      </el:compatibility>
      <el:modes el:easy="false" el:single="false" el:network="false"/>
      <el:comments>
        <el:code>Lua 5.1 and XML converted by Leveladministrators</el:code>
      </el:comments>
      <el:score el:easy="-" el:difficult="-"/>
    </el:info>
    <el:luamain><![CDATA[
-- libterrain, a Library for Enigma
-- Version 1.0
-- Lua-lib zum einfachen erstellen von Bergen und Taelern.

----------------------------------------------------
--MOUNTAIN/VALLEY-RING:

function draw_ring(x0,y0,xw,yw,was)

--x0,y0: obere linke ecke
--xw,yw: breite, hoehe des rings
--was:entscheidet ob mountain- oder valleyring
--was=0: tal, was=1: berg

 --Machbarkeits-Test:
 if xw<2 or yw<2 then
  set_item("it-document",x0,y0,{text="ERROR: To small Values!"})
  return
 end

 if was==1 then
  --Ecken:
  set_floor("fl-gradient12",x0,y0)
  set_floor("fl-gradient10",x0+xw-1,y0)
  set_floor("fl-gradient11",x0,y0+yw-1)
  set_floor("fl-gradient9",x0+xw-1,y0+yw-1)
  --Kanten:
  draw_floor("fl-gradient2",{x0+1,y0},{1,0},xw-2)
  draw_floor("fl-gradient1",{x0+1,y0+yw-1},{1,0},xw-2)
  draw_floor("fl-gradient4",{x0,y0+1},{0,1},yw-2)
  draw_floor("fl-gradient3",{x0+xw-1,y0+1},{0,1},yw-2)

 else --was==0
  --Ecken:
  set_floor("fl-gradient5",x0,y0)
  set_floor("fl-gradient6",x0+xw-1,y0)
  set_floor("fl-gradient7",x0,y0+yw-1)
  set_floor("fl-gradient8",x0+xw-1,y0+yw-1)
  --Kanten:
  draw_floor("fl-gradient1",{x0+1,y0},{1,0},xw-2)
  draw_floor("fl-gradient2",{x0+1,y0+yw-1},{1,0},xw-2)
  draw_floor("fl-gradient3",{x0,y0+1},{0,1},yw-2)
  draw_floor("fl-gradient4",{x0+xw-1,y0+1},{0,1},yw-2)
 end

end
----------------------------------------------------
--MOUNTAIN/VALLEY-FULL

function draw_full(x0,y0,xw,yw,was)

 ok=TRUE
 xwm=xw
 ywm=yw
 x0m=x0
 y0m=y0

 while ok==TRUE do
  draw_ring(x0m,y0m,xwm,ywm,was)

  xwm=xwm-2
  ywm=ywm-2
  x0m=x0m+1
  y0m=y0m+1

  if xwm<2 or ywm<2 then
   ok=FALSE
  end
 end
end
----------------------------------------------------
    ]]></el:luamain>
    <el:i18n>
    </el:i18n>
  </el:protected>
</el:level>