source wt.tcl

# texture

set tile [texture stone2.gif]
set stone [texture stone1.gif]
# This sky texture sort of bites, but I'm at a loss to find anything better
# which I feel I can distribute legally.
set sky [texture desktop/misty.gif]
set lake [texture bluefrac.gif]
set water [texture desktop/coolwater.gif]
set dirt [texture desktop/dirt.gif]

# vertex

vertex -1.5 -2.1
vertex 68.8 -2.3
vertex 69.7 39.7
vertex -1.7 39.1

vertex 12.6 7.0	
vertex 20.4 16.6
vertex 9.0 17.0	

vertex 34.5 13.9
vertex 33.3 12.2
vertex 37.3 9.7
vertex 43.6 10.0
vertex 48.6 16.1
vertex 47.8 26.3
vertex 41.2 33.2
vertex 30.2 28.4
vertex 29.0 20.4
vertex 31.0 20.2
vertex 32.6 27.7
vertex 40.5 30.4
vertex 45.3 25.5
vertex 46.3 16.6
vertex 42.9 12.3
vertex 38.0 11.8
vertex 29.9 15.5
vertex 32.0 16.2
vertex 32.7 32.1
vertex 34.3 29.8
vertex 59.1 12.1
vertex 56.3 19.0
vertex 59.2 27.9
vertex 64.0 23.2
vertex 66.0 18.2
vertex 62.0 15.8

# region

region 10 10  $tile $tile
region  0 10  $tile $dirt
region -0.2 10 $lake $dirt
region -0.2 10 $water $dirt
region 10 10  $tile $dirt

# wall

skywall [wall 3 0 $sky  1 4  0.05 1.0 0 0.5] 3
skywall [wall 0 1 $sky  1 4  0.05 1.0 0 0.5] 3
skywall [wall 1 2 $sky  1 4  0.05 1.0 0 0.5] 3
skywall [wall 2 3 $sky  1 4  0.05 1.0 0 0.5] 3

wall 4 5 $stone  2 1  0.1 0.1 0 0
wall 5 6 $stone  2 1  0.1 0.1 0 0
wall 6 4 $stone  2 1  0.1 0.1 0 0

wall 8 7 $stone  1 0  0.1 0.1 0 0
wall 9 8 $stone  1 0  0.1 0.1 0 0
wall 10 9 $stone  1 0  0.1 0.1 0 0
wall 11 10 $stone  1 0  0.1 0.1 0 0
wall 12 11 $stone  1 0  0.1 0.1 0 0
wall 13 12 $stone  1 0  0.1 0.1 0 0
wall 18 13 $stone  1 0  0.1 0.1 0 0
wall 19 18 $stone  1 0  0.1 0.1 0 0
wall 20 19 $stone  1 0  0.1 0.1 0 0
wall 21 20 $stone  1 0  0.1 0.1 0 0
wall 22 21 $stone  1 0  0.1 0.1 0 0
wall 7 22 $stone  1 0  0.1 0.1 0 0

wall 23 15 $stone  1 0  0.1 0.1 0 0	
wall 15 14 $stone  1 0  0.1 0.1 0 0	
wall 14 25 $stone  1 0  0.1 0.1 0 0	
wall 25 26 $stone  1 0  0.1 0.1 0 0	
wall 26 17 $stone  1 0  0.1 0.1 0 0	
wall 17 16 $stone  1 0  0.1 0.1 0 0	
wall 16 24 $stone  1 0  0.1 0.1 0 0	
wall 24 23 $stone  1 0  0.1 0.1 0 0	

wall 29 28 $stone  3 1  0.1 0.1 0 0	
wall 30 29 $stone  3 1  0.1 0.1 0 0	
wall 31 30 $stone  3 1  0.1 0.1 0 0	
wall 32 31 $stone  3 1  0.1 0.1 0 0	
wall 27 32 $stone  3 1  0.1 0.1 0 0	
wall 28 27 $stone  3 1  0.1 0.1 0 0	

set water_rest -0.3
set water_level -0.15
set water_v 0.0

proc foo { } {
	global floor_height water_rest water_level water_v
	set water_accel [expr ($water_rest-$water_level)/20.0]
	set water_v [expr $water_v+$water_accel]
	set water_level [expr $water_level+$water_v]
	setregion 2 $floor_height $water_level
	setregion 3 $floor_height $water_level
}

addupdater foo
