Skip to content

Instantly share code, notes, and snippets.

@raggy
Forked from anonymous/readme.txt
Last active July 4, 2022 15:30
Show Gist options
  • Save raggy/d18ddaa36e2913a05b87 to your computer and use it in GitHub Desktop.
Save raggy/d18ddaa36e2913a05b87 to your computer and use it in GitHub Desktop.
Spear & Crate
title SPEAR & CRATE
author Benjamin Davis
homepage http://benjamindav.is
again_interval 0.1
(flickscreen 7x7)
require_player_movement
(verbose_logging)
run_rules_on_level_start
color_palette 4
========
OBJECTS
========
Background
DarkBlue
Hole
Black
Wall
DarkRed
Water
DarkGreen
PlayerEmpty
LightBrown Red Brown
..0..
.111.
01110
.111.
.2.2.
SpearHandleUp
Brown
..0..
..0..
..0..
..0..
.....
SpearHandleDown
Brown
.....
..0..
..0..
..0..
..0..
SpearHandleLeft
Brown
.....
.....
0000.
.....
.....
SpearHandleRight
Brown
.....
.....
.0000
.....
.....
PlayerSpearUp
LightBrown Red Brown
.02..
110..
111..
111..
2.2..
SpearUp
LightGray Red Brown
..0..
..1..
..2..
..2..
..2..
SpearUpToLeft
LightGray Red Brown
..0..
.012.
01222
.....
.....
SpearUpToRight
LightGray Red Brown
..0..
.210.
22210
.....
.....
PlayerSpearDown
LightBrown Red Brown
...0.
..111
..201
..011
..2.2
SpearDown
LightGray Red Brown
..2..
..2..
..2..
..1..
..0..
SpearDownToLeft
LightGray Red Brown
.....
.....
01222
.012.
..0..
SpearDownToRight
LightGray Red Brown
.....
.....
22210
.210.
..0..
PlayerSpearLeft
LightBrown Red Brown
..0..
.111.
02221
.110.
.2.2.
SpearLeft
LightGray Red Brown
.....
.....
01222
.1...
.....
SpearLeftToUp
LightGray Red Brown
..0..
.01..
012..
.22..
..2..
SpearLeftToDown
LightGrey Red Brown
..2..
.22..
012..
.01..
..0..
PlayerSpearRight
LightBrown Red Brown
..0..
.111.
12220
.011.
.2.2.
SpearRight
LightGray Red Brown
.....
.....
22210
...1.
.....
SpearRightToUp
LightGray Red Brown
..0..
..10.
..210
..22.
..2..
SpearRightToDown
LightGray Red Brown
..2..
..22.
..210
..10.
..0..
BoxMetal
DarkGrey Gray
00000
01110
01110
01110
00000
BoxMetalInWater
DarkGray
BoxWood
DarkBrown Brown
00000
01110
01110
01110
00000
CageMetal
DarkGrey Gray
.0.0.
01110
.1.1.
01110
.0.0.
CageMetalInWater
DarkGray DarkGreen
10101
00000
10101
00000
10101
CageWood
DarkBrown DarkBrown
.0.0.
01110
.1.1.
01110
.0.0.
Falling
DarkGrey
.....
.....
..0..
.....
.....
Save
Transparent
Jelly
Purple Pink
00000
01000
00001
00000
10000
JellySplat
Purple Pink
.....
.....
.....
.100.
00001
Button
Grey DarkGrey
.....
.000.
.000.
.111.
.....
DoorHClosed
DarkGrey DarkBrown
11111
11111
00000
11111
11111
DoorHOpen
DarkGrey DarkBrown
00000
.....
.....
.....
00000
DoorVClosed
DarkGrey DarkBrown
11011
11011
11011
11011
11011
DoorVOpen
DarkGrey DarkBrown
0...0
0...0
0...0
0...0
0...0
Processing
LightBlue
.....
.....
00000
.....
.....
Processed
LightGreen
....0
...0.
0.0..
.0...
.....
=======
LEGEND
=======
PlayerSpear = PlayerSpearUp or PlayerSpearDown or PlayerSpearLeft or PlayerSpearRight
SpearHandle = SpearHandleUp or SpearHandleDown or SpearHandleLeft or SpearHandleRight
SpearHandleH = SpearHandleLeft or SpearHandleRight
SpearHandleV = SpearHandleUp or SpearHandleDown
Spear = SpearUp or SpearDown or SpearLeft or SpearRight
Cage = CageMetal or CageWood
Box = BoxMetal or BoxWood
Door = DoorHClosed or DoorHOpen or DoorVClosed or DoorVOpen
Player = PlayerEmpty or PlayerSpear
DoorClosed = DoorHClosed or DoorVClosed
DoorOpen = DoorHOpen or DoorVOpen
Pushable = Box or Cage
Falls = Player or Box or Cage
Floats = CageWood or BoxWood
Sinks = CageMetal or BoxMetal
BlocksPushable = Pushable or Jelly or Wall or DoorClosed
PushesButton = Box or Cage or Player
SpearH = SpearLeft or SpearRight
SpearV = SpearUp or SpearDown
SpearToUp = SpearLeftToUp or SpearRightToUp
SpearToDown = SpearLeftToDown or SpearRightToDown
SpearToLeft = SpearUpToLeft or SpearDownToLeft
SpearToRight = SpearUpToRight or SpearDownToRight
SpearTo = SpearToUp or SpearToDown or SpearToLeft or SpearToRight
_ = Hole
░ = Water
. = Background
▓ = Wall
x = Save
▲ = PlayerSpearUp
▼ = PlayerSpearDown
◄ = PlayerSpearLeft
► = PlayerSpearRight
↑ = SpearUp
↓ = SpearDown
← = SpearLeft
→ = SpearRight
╬ = CageMetal
┼ = CageWood
■ = BoxMetal
□ = BoxWood
j = Jelly
b = Button
═ = DoorHClosed
║ = DoorVClosed
=======
SOUNDS
=======
(Player move 52207107)
Falling create 38545107
Pushable move 16207707
sfx0 48982904
================
COLLISIONLAYERS
================
Background
Hole, Save, Water, BoxMetalInWater, CageMetalInWater, JellySplat, Button, Door
Spear, SpearTo, SpearHandle
Player, Wall, Box, Cage, Falling, Jelly
Processing, Processed
======
RULES
======
late [ Player Save ] -> [ Player ] checkpoint
( Player can't walk on water )
[ > Player | Water ] -> [ Player | Water ]
( Player can't walk on cages in water )
([ > Player | CageMetalInWater ] -> [ Player | CageMetalInWater ])
( Player can't move through closed doors )
[ > Player | DoorClosed ] -> [ Player | DoorClosed ]
( Move the spear straight forwards and backwards )
[ parallel PlayerSpear | Spear ] -> [ parallel PlayerSpear | parallel Spear ]
( Pull a crate if spear stuck in it )
[ ^ PlayerSpear | stationary Spear Cage ] -> [ ^ PlayerSpear | ^ Spear ^ Cage ]
[ v PlayerSpear | stationary Spear Cage ] -> [ v PlayerSpear | v Spear v Cage ]
( Rotate the spear if no crate )
[ ^ PlayerSpear | stationary Spear ] -> [ ^ PlayerSpear | < Spear ]
[ v PlayerSpear | stationary Spear ] -> [ v PlayerSpear | < Spear ]
( Push stuff with the player )
[ > Player | Box ] -> [ > Player | > Box ]
[ > Player | Cage no SpearHandle ] -> [ > Player | > Cage ]
[ > PlayerSpear | > Spear | Box ] -> [ > PlayerSpear | > Spear | > Box ]
( Spear moves with pushed cage )
[ > Player | Cage Spear ] -> [ > Player | > Cage > Spear ]
up [ moving SpearDown | SpearHandleDown ] -> [ moving SpearDown | moving SpearHandleDown ]
down [ moving SpearUp | SpearHandleUp ] -> [ moving SpearUp | moving SpearHandleUp ]
left [ moving SpearRight | SpearHandleRight ] -> [ moving SpearRight | moving SpearHandleRight ]
right [ moving SpearLeft | SpearHandleLeft ] -> [ moving SpearLeft | moving SpearHandleLeft ]
( Stop spear if trapped in two cages )
up [ moving SpearDown Cage | moving SpearHandleDown Cage ] -> [ SpearDown stationary Cage | SpearHandleDown stationary Cage]
down [ moving SpearUp Cage | moving SpearHandleUp Cage ] -> [ SpearUp stationary Cage | SpearHandleUp stationary Cage ]
left [ moving SpearRight Cage | moving SpearHandleRight Cage ] -> [ SpearRight stationary Cage | SpearHandleRight stationary Cage ]
right [ moving SpearLeft Cage | moving SpearHandleLeft Cage ] -> [ SpearLeft stationary Cage | SpearHandleLeft stationary Cage ]
( Rotate the player )
late up [ PlayerSpear | Spear ] -> [ PlayerSpearUp | Spear ]
late down [ PlayerSpear | Spear ] -> [ PlayerSpearDown | Spear ]
late left [ PlayerSpear | Spear ] -> [ PlayerSpearLeft | Spear ]
late right [ PlayerSpear | Spear ] -> [ PlayerSpearRight | Spear ]
( Rotate the spear )
late [ SpearToUp ] -> [ SpearUp ]
late [ SpearToDown ] -> [ SpearDown ]
late [ SpearToLeft ] -> [ SpearLeft ]
late [ SpearToRight ] -> [ SpearRight ]
( Transition the spear )
late up [ PlayerSpear | SpearLeft ] -> [ PlayerSpear | SpearLeftToUp ] again
late up [ PlayerSpear | SpearRight ] -> [ PlayerSpear | SpearRightToUp ] again
late down [ PlayerSpear | SpearLeft ] -> [ PlayerSpear | SpearLeftToDown ] again
late down [ PlayerSpear | SpearRight ] -> [ PlayerSpear | SpearRightToDown ] again
late left [ PlayerSpear | SpearUp ] -> [ PlayerSpear | SpearUpToLeft ] again
late left [ PlayerSpear | SpearDown ] -> [ PlayerSpear | SpearDownToLeft ] again
late right [ PlayerSpear | SpearUp ] -> [ PlayerSpear | SpearUpToRight ] again
late right [ PlayerSpear | SpearDown ] -> [ PlayerSpear | SpearDownToRight ] again
( Stop pushables moving into things )
[ > Pushable | BlocksPushable ] -> [ Pushable | BlocksPushable ]
[ > SpearHandle | Wall ] -> [ SpearHandle | Wall ]
[ > Box | SpearHandle ] -> [ Box | SpearHandle ]
[ > SpearHandle | Box ] -> [ SpearHandle | Box ]
[ > SpearHandle | DoorClosed ] -> [ SpearHandle | DoorClosed ]
[ > SpearHandle | Jelly ] -> [ SpearHandle | Jelly ]
vertical [ > Cage | SpearHandleH ] -> [ Cage | SpearHandleH ]
horizontal [ > Cage | SpearHandleV ] -> [ Cage | SpearHandleV ]
vertical [ > SpearHandleH | Cage ] -> [ SpearHandleH | Cage ]
horizontal [ > SpearHandleV | Cage ] -> [ SpearHandleV | Cage ]
( Stop spear and cage if handle stops )
up [ stationary SpearHandleUp | moving SpearUp moving Cage ] -> [ SpearHandleUp | SpearUp Cage ]
down [ stationary SpearHandleDown | moving SpearDown moving Cage ] -> [ SpearHandleDown | SpearDown Cage ]
left [ stationary SpearHandleLeft | moving SpearLeft moving Cage ] -> [ SpearHandleLeft | SpearLeft Cage ]
right [ stationary SpearHandleRight | moving SpearRight moving Cage ] -> [ SpearHandleRight | SpearRight Cage ]
( Stop spear if moving perpendicularly in a cage )
[ vertical SpearH stationary Cage ] -> [ SpearH Cage ]
[ horizontal SpearV stationary Cage ] -> [ SpearV Cage ]
( Drop spear if going to leave it behind )
up [ horizontal PlayerSpearUp | stationary SpearUp ] -> [ horizontal PlayerEmpty SpearHandleUp | SpearUp ]
down [ horizontal PlayerSpearDown | stationary SpearDown ] -> [ horizontal PlayerEmpty SpearHandleDown | SpearDown ]
left [ vertical PlayerSpearLeft | stationary SpearLeft ] -> [ vertical PlayerEmpty SpearHandleLeft | SpearLeft ]
right [ vertical PlayerSpearRight | stationary SpearRight ] -> [ vertical PlayerEmpty SpearHandleRight | SpearRight ]
( Pick up spear )
late [ PlayerEmpty SpearHandleUp ] -> [ PlayerSpearUp ]
late [ PlayerEmpty SpearHandleDown ] -> [ PlayerSpearDown ]
late [ PlayerEmpty SpearHandleLeft ] -> [ PlayerSpearLeft ]
late [ PlayerEmpty SpearHandleRight ] -> [ PlayerSpearRight ]
( Can't move more than one pushable at a time )
( e.g. if moving a cage with a spear and moving into a box )
random [ moving Pushable Background ] -> [ moving Pushable action Background ]
[ moving Pushable stationary Background ] -> cancel
[ action Background ] -> [ Background ]
( Splat and unsplat jelly )
late [ Spear Jelly ] -> [ Spear JellySplat ] sfx0
late [ JellySplat no Spear no SpearHandle no Player ] -> [ Jelly ]
( Open/close doors)
late [ DoorOpen Player ] -> [ DoorOpen Player Processed ]
late [ DoorOpen Spear ] -> [ DoorOpen Spear Processed ]
late [ DoorOpen Pushable ] -> [ DoorOpen Pushable Processed ]
late [ DoorHOpen no Processed ] -> [ DoorHClosed ]
late [ DoorVOpen no Processed ] -> [ DoorVClosed ]
startloop
late random [ Button PushesButton no Processed ] -> [ Button PushesButton Processing ]
late [ Button Processing ] [ DoorHClosed no Processing no Processed ] -> [ Button Processing ] [ DoorHOpen Processing ]
late [ Button Processing ] [ DoorVClosed no Processing no Processed ] -> [ Button Processing ] [ DoorVOpen Processing ]
late [ Button Processing ] [ DoorHOpen no Processing no Processed ] -> [ Button Processing ] [ DoorHClosed Processing ]
late [ Button Processing ] [ DoorVOpen no Processing no Processed ] -> [ Button Processing ] [ DoorVClosed Processing ]
late [ Button Processing ] -> [ Button Processed ]
late [ Door Processing ] -> [ Door ]
endloop
late [ Processing ] -> []
late [ Processed ] -> []
( Spear shouldn't overlap )
late [ Spear Wall ] -> cancel
late [ Spear Box ] -> cancel
late [ Spear DoorClosed ] -> cancel
( Things fall in holes )
late [ Box Hole no Spear ] -> again
late [ Cage Hole no Spear ] -> again
late [ Player Hole ] -> again
( Things fall in the water )
late [ BoxMetal Water no Spear no SpearHandle ] -> [ BoxMetalInWater ]
late [ CageMetal Water no Spear no SpearHandle ] -> [ CageMetalInWater ]
( Remove spear when player falls in hole )
[ Player Hole | Spear ] -> [ Player Hole | ]
[ Player Hole | SpearTo ] -> [ Player Hole | ]
( Animate falling )
[ Falling Hole ] -> [ Hole ]
[ stationary Falls Hole ] -> [ Falling Hole ] again
==============
WINCONDITIONS
==============
=======
LEVELS
=======
.......
.▓▓▓▓▓▓
▓▓.╬...
►→.╬.▓▓
▓▓.╬.▓.
.▓▓▓▓▓.
.......
.......
▓▓▓▓▓▓▓
►→.╬.j.
▓▓.╬.▓▓
.▓.╬.▓.
.▓▓▓▓▓.
.......
.......
▓▓▓▓▓▓▓
►→.╬.j.
▓▓.■.▓▓
.▓.╬..▓
.▓▓▓▓▓▓
.......
.........
▓▓▓▓▓▓▓▓.
►→.....▓.
▓▓....╬▓.
.▓▓▓b▓□▓.
.▓.....▓.
.▓...□□▓.
.▓▓▓║▓▓▓.
...▓.▓...
....░.....
▓▓▓▓▓▓▓▓▓.
►→.╬░b..▓▓
▓▓..░░..═.
░▓░.■░..▓▓
.▓▓▓▓▓▓▓▓.
..░░░░....
....░░....
....░.....
....░.....
(_______
_▓▓▓▓▓_
▓▓...▓_
►→╬..▓_
▓▓.╬╬▓_
_▓▓.▓▓_
__▓.▓__)
(.......
.▓▓▓▓▓▓
▓▓.═...
►→.╬.▓▓
▓▓.╬.▓.
.▓▓▓▓▓.
.......
__▓▼▓__
_▓▓↓▓▓_
_▓...▓_
_▓╬╬╬▓_
_▓...▓_
_▓▓.▓▓_
__▓.▓__
_____________
_▓▓▓▓▓_______
_▓..╬▓__...__
___........__
_▓...▓__...__
▓▓▓▓.▓___.___
►→.╬.▓___....
▓▓.▓.▓_______
__.═.▓__...__
_▓.╬.▓__...__
_▓.╬.▓__...__
_▓▓▓▓▓_______
_____________)
(▓▓▓▼▓__
▓..↓▓__
▓═══▓▓▓
▓...║..
▓.▓.║.▓
▓...║.▓
▓▓▓▓▓▓▓)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment