-
Notifications
You must be signed in to change notification settings - Fork 10
/
water.wl
56 lines (51 loc) · 1.44 KB
/
water.wl
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
/*
* water.wl: a demonstration of the Boom water routines
* both using the basic water* routines and the more advanced
* owater* routines (at the same time)
*
* part of WadC
*
* Copyright © 2015-2017 Jonathan Dowland <[email protected]>
*
* Distributed under the terms of the GNU GPL Version 2
* See file LICENSE.txt
*/
#"standard.h"
#"water.h"
#"control.h"
main {
controlinit
movestep(0,64) -- out of the way of control sectors
waterinit_fwater(-16)
pushpop(movestep(32,32) thing)
!main
-- a ramp of rooms, descending in floor and ceiling height
fori(0, 7,
set("floorheight", sub(0, mul(i,24)))
set("ceilheight", add(128, get("floorheight")))
water(
box(get("floorheight"), get("ceilheight"), 200, 256, 256),
get("floorheight"),
get("ceilheight"),
)
movestep(-256,0)
)
^main movestep(256,256) rotright
-- again, but with a custom water variable
set("newwater", onew)
pushpop( -- control sectors again
movestep(0,-64)
owaterinit(get("newwater"), -32, "SLIME01", "WATERMAP", 40)
)
fori(1, 7,
set("floorheight", sub(0, mul(i,24)))
set("ceilheight", add(128, get("floorheight")))
owater(
get("newwater"),
box(get("floorheight"), get("ceilheight"), 200, 256, 256),
get("floorheight"),
get("ceilheight"),
)
movestep(256,0)
)
}