title Tunnel Rat
author James Noeckel
noundo
again_interval 0.07
youtube SG1uBb104Is
========
OBJECTS
========
Background
#4c352b #4e382f #533c30
01010
02211
20010
00012
12102

PlayerS
#a65200 red #6f3c0a
.0.0.
.000.
21012
20002
22022

PlayerU
#a65200 red #6f3c0a
.0.0.
.101.
20002
22022
.2.2.

inflow
yellow orange white
00000
00000
22222
11111
11111

exit
green
.0.0.
0.0.0
.0.0.
0.0.0
.0.0.

tempwall
blue

DirtM
#82642b #876b35 #927538
01010
02211
20010
00012
12102

DirtU
#82642b #876b35 #927538 #b19154
22222
33333
00000
01012
12102


Rock
#e0e0e0 #a4a4a4 #8a8a8a #7c7c7c
.000.
01112
11123
11223
.233.

enemy
white #ff7070 black #880000 red
01414
14343
14343
14443
43232

h_grav
black
.....
.....
..0..
.....
.....

h_step
red
.....
.....
..0..
.....
.....

(h_dead
black
)
pickupoverlay
pink

enemyoverlay
pink

destroy
red
0...0
.0.0.
..0..
.0.0.
0...0
scrolling
blue
.....
.....
..0..
.....
.....

Shoes
#ff11f7 #9711ff #641d9a
...0.
...10
...01
.1111
.2222

Eraser
#00ff12 #99ffa0 #008509
..10.
.1000
10000
.2000
..20.

Unraser
#00ff12 #99ffa0 #008509
.01..
0001.
00001
0002.
.02..

Shoesworn
purple pink
.....
.....
.....
.....
10.01


=======
LEGEND
=======
# = Dirtm
. = Background
P = playerS
o = Rock
s = shoes
x = enemy
@ = dirtm and destroy
$ = dirtm and inflow
e = exit and Dirtm
% = unraser

dirt = dirtm or dirtu
Player = PlayerS or PlayerU
Helpers = h_grav or scrolling or h_step
Pickups = shoes or Eraser or Unraser
Heldpickups = shoesworn
Solid = Dirt or Player or Rock or Pickups or enemy
Heavy = Rock or Pickups or enemy
overlays = pickupoverlay or enemyoverlay
Everything = Solid or tempwall or overlays

=======
SOUNDS
=======
SFX1 36137902
SFX2 78903905
SFX3 14420703
SFX4 25525902
SFX5 49701704
SFX6 98046907
SFX7 16284302
SFX8 96668708
SFX9 86449100
================
COLLISIONLAYERS
================

helpers
Background
tempwall, solid
Heldpickups
overlays
destroy, inflow, exit


======
RULES
======

up [ > PlayerU ] -> cancel
down [ > PlayerU ] -> [ PlayerS ]

(digging/jumping up)
up [ > PlayerS | no Solid | no Solid no inflow ] -> [ | | PlayerU scrolling ] SFX2
up [ > PlayerS | no Solid | Dirt no inflow ] -> [ | | PlayerU scrolling ] SFX7
up [ > PlayerS | no Solid no inflow ] -> [ | PlayerU scrolling ] SFX2
up [ > PlayerS | Dirt no inflow ] -> [ | PlayerU scrolling ] SFX7

(scrolling and terraingen)
[ scrolling ] [ Everything destroy ] -> [ scrolling ] [ destroy ]
[ scrolling ] [ inflow no Player ] -> [ scrolling ] [ inflow tempwall ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow random overlays ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow random overlays ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow random overlays ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow random overlays ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow enemyoverlay ]
random [ scrolling ] [ inflow ] -> [ scrolling ] [ inflow enemyoverlay ]



startloop
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ dirtm ]
random [ tempwall ] -> [ ]
random [ tempwall ] -> [ ]
random down [ tempwall | solid ] -> [ rock | Solid ]
random down [ tempwall | solid ] -> [ rock | Solid ]
endloop


[ pickupoverlay rock ] -> [ random pickups]
[ enemyoverlay rock ] -> [ enemy ]

random down [ Solid inflow | rock | rock ] -> [ rock inflow | rock | rock ]
[ no Solid | inflow Solid | no Solid ] -> [ | inflow | ]
[ no Solid | inflow Solid | inflow Solid | no Solid ] -> [ | inflow | inflow | ]


down [ scrolling ] [ Everything ] -> [ scrolling ] [ > Everything ]


(gravity)
down [ Heavy ] -> [ down Heavy ] again

(up [ > PlayerS | no Solid ] [ Everything destroy ] -> [ > PlayerS scrolling | ] [ destroy ]
up [ > PlayerS | Dirt ] [ Everything destroy ] -> [ > PlayerS scrolling | dirt ] [ destroy ]
down [ Everything ] [ Player scrolling ] -> [ > Everything ] [ PlayerU scrolling ]
)

(movement in general)
horizontal [ > PlayerU | Dirt ] -> [ | PlayerS ] SFX1
horizontal [ > PlayerU ] -> [ > PlayerS ]

[ action PlayerU ] -> [ PlayerS ]
[ > Player | Dirt ] -> [ | Player ] SFX1


(use pickup)

up [ action PlayerS shoesworn | Solid | no inflow no exit ] -> [ | Solid | PlayerS ] SFX4
up [ action PlayerS shoesworn | | Solid | no inflow no exit ] -> [ | | Solid | PlayerS ] SFX4
up [ action PlayerS shoesworn | | | | no inflow no exit ] -> [ | | | | PlayerU ] SFX4

(pushing)
Horizontal [ > Player | Heavy ] -> [ > Player | > Heavy ] SFX6
Horizontal [ > Heavy | Heavy ] -> [ > Heavy | > Heavy ]
Horizontal [ > Enemy | Dirt ] -> [ > Enemy | ] SFX1
Horizontal [ > Enemy | pickups | Solid ] -> [ > Enemy | | Solid ] SFX4
([Enemy h_dead no h_grav] -> message flattened to death)
(down [ Enemy h_dead | destroy ] -> [ Enemy | destroy ] message flattened to death)
([ > Enemy | Player ] -> [ | Enemy h_dead ] SFX5)
([ moving Enemy h_dead ] -> [ moving Enemy moving h_dead ])
[ moving Enemy h_grav ] -> [ moving Enemy moving h_grav ]
down [ > Enemy h_grav | Solid no Player no Enemy ] -> [ | Enemy ] SFX4
down [ > Enemy | Player ] -> [ > Enemy | ] SFX4




(pickup)

[ > Player | shoes ] -> [ | stationary Player shoesworn ] SFX3

[ > Player | Eraser ] [ Solid no Player no Pickups ] -> [ > Player | Eraser ] [ DirtM ]
startloop
random [ > Player | Unraser ] [ Solid no Player | no Solid ] -> [ > Player | Unraser ] [ Solid | Rock ]
random [ > Player | Unraser ] [ Solid no Player | no Solid ] -> [ > Player | Unraser ] [ Solid | Dirtm ]
random [ > Player | Unraser ] [ Solid no Player | no Solid ] -> [ > Player | Unraser ] [ Solid | Dirtm ]
random [ > Player | Unraser ] [ Solid no Player | no Solid ] -> [ > Player | Unraser ] [ Solid | Dirtm ]
endloop
[ > Player | Pickups ] -> [ | stationary Player ] SFX8

(steps)
up [ PlayerS | no Solid ] -> [ PlayerS | h_step ]
[ moving PlayerS ] [ h_step ] -> [ moving PlayerS ] [ moving h_step ]

(late steps)
late down [ h_step | Player ] -> [ | Player ]
late [h_grav] [h_step] -> [h_grav] []
late down [ h_step no Solid | no Player ] [ PlayerS ] -> [ PlayerS | ] [ ]
late down [ h_step Dirt | no Player ] [ PlayerS ] -> [ PlayerS | ] [ ] SFX1

(player gravity)
late down [ PlayerS | h_grav ] -> [ | PlayerS ]
late down [ PlayerS | no Solid ] -> [ PlayerS | h_grav ]

late [ Player no shoesworn] [ shoesworn ] -> [ Player shoesworn ] [ ]

(enemy gravity)
late down [ enemy | no Solid ] -> [ enemy h_grav | ]
late down [ enemy | Player ] -> [ enemy h_grav | ]


(cleanup)
late [scrolling] -> []
late [overlays] -> []
late [h_step] -> []

(beautify)
late up [ Dirtm | no Dirt ] -> [ DirtU | ]
late up [ DirtU | Dirt ] -> [ Dirtm | Dirt ]

(death)
[ Player destroy ] -> [ destroy ] SFX4

(life)
late [ Player exit ] [ exit no Player ] -> [ Player exit ] [ ] SFX9
==============
WINCONDITIONS
==============
all exit on player
=======
LEVELS
=======

message Survive. x to use held item.
$$$$$$$$$$$$$$$$$$$
eeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeee
###################
###################
###################
###################
###################
###################
###################
###################
###################
###################
###################
###################
###################
#########P#########
###################
###################
###################
###################
###################
###################
@@@@@@@@@@@@@@@@@@@

message Is that a light at the end of the tunnel?
$$$$$$$$$$$$$$$$$$$$$$$$$
eeeeeeeeeeeeeeeeeeeeeeeee
eeeeeeeeeeeeeeeeeeeeeeeee
o.......................o
o.......................o
o..x.x.x.x.xpx.x.x.x.x..o
o#.#.#.#.#.#x#.#.#.#.#.#o
o.#.#.#.#.#.#.#.#.#.#.#.o
o#.#.#.#.#.#.#.#.#.#.#.#o
o.#.#.#.#.#.#.#.#.#.#.#.o
o#.#.#.#.#.#.#.#.#.#.#.#o
o.#.#.#.#.#.#.#.#.#.#.#.o
o#.#.#.#.#.#.#.#.#.#.#.#o
o.......................o
o.......................o
o.......................o
o.......................o
o......#................o
o.....##..............#.o
o....###...%...#..#..##.o
###..############.#######
########.##.#############
####.#####..#############
########.....############
#########################
#########################
@@@@@@@@@@@@@@@@@@@@@@@@@