-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample.zlv
103 lines (88 loc) · 3.02 KB
/
sample.zlv
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
95
96
97
98
99
100
101
102
103
// Sample Zenderer level file.
// This file contains a simple side-scroller level with
// a single raised platform, a tiled floor, a light,
// a player, and two enemies / spawn points.
// SECTION: Metadata [optional]
// This is typically ignored, but could be used for providing
// the player with details while the level is being loaded.
author=george
description=A sample level provided for testing purposes
// SECTION: Entities
// This section contains mesh data for creating a variety of
// textured primitives. See the entity-mesh file format for
// more details.
// The game background that cannot be interacted with.
// It's just a simple quad placed at (0, 0, 1) in the game world.
<entity>
depth=0
position=0,0
texture=sky.png
</entity>
// The ground. This uses a special parameter to indicate that the
// entity should tile the texture to fit the vertices, rather than
// stretching. Here we also see the emergence of the 'attributes' value
// in the entity specification. This is a flag carrier that has a variety
// of options that can be enabled in it. In this case, 0x01 indicates
// that the entity reacts physically with the world, with collision
// detection and such.
<entity>
depth=1
position=0,0
vertex=0,0
vertex=0,800
vertex=800,600
vertex=600,0
stretch=false
texture=rock.png
attributes=0x01
</entity>
// 2 platforms on which the enemies will stand on.
<entity>
depth=2
texture=platform.png
attributes=0x01
</entity>
// SECTION: Spawn Points
// This section contains detailed spawn point info, specifying who's
// allowed to spawn where.
//
// The 'whitelist' attribute can be used to specify exactly who is
// allowed to spawn at a certain point, whereas 'blacklist' can be
// used to allowed all but those on the list to spawn at a point.
// Since we try to maintain ambiguity about the functionality of the
// game, white/blacklists can only be defined based on a texture name.
//
// We define the spawn type with an XML-like attribute
// syntax. We prefer to use all caps for the values to prevent
// dealing with mixed-case string comparisons when loading.
// Players are defined by a spawn point (or multiple,
// in which case one is chosen at random), and an entity mesh. Since
// we defined the entity mesh above, we must provide the spawn point
// now, as well.
<spawn type="PLAYER">
position=10,400
</spawn>
<spawn type="ENEMY">
position=100, 300
whitelist=enemy1.png,enemy2.png
</spawn>
<spawn type="ENEMY">
position=100,700
whitelist=enemy1.png
</spawn>
// SECTION: Lighting
// Lighting is critical to the ambience and realism of a level. We define
// several types of lights and create them very similarly to the spawn
// point specification.
// Ambient light to illuminate the whole scene slightly.
<light type="AMBIENT">
color=1.00,1.00,1.00
brightness=0.50
</light>
// A "torch," but without a texture.
<light type="POINT">
position=100,100
color=1.00,1.00,0.00
brightness=0.15
attenuation=0.05,0.01,0.00
</light>