title Extended Bodies:Multiple Parallel Players, Multiple Extended Object
author Anonymous
homepage www.puzzlescript.net

verbose_logging

(
    
THIS IS A DELIBERATELY BROKEN GAME, JUST FOR ILLUSTRATION

see https://www.puzzlescript.net/Documentation/rigidbodies.html#parallel_many
)


========
OBJECTS
========

Background 
white  

Target 
DarkBlue    

Wall 
DarkGrey

Player
Blue
..0..
..0.0
00000
.000.
.0.0.

( three multi-cells blocks )
Crate 
orange

Chest
green

Box
red

( 1-cell small block )
Small
darkred
.....
.000.
.000.
.000.
.....

( sticky, multicellular block when in contact )
Glue
pink
.000.
00000
00000
00000
.000.

( a flag to know what is allowed move )
Wanna_Move
#ff00ff
.....
.....
..0..
.....
.....

=======
LEGEND
=======

. = Background
# = Wall
P = Player
* = Crate
+ = Box
% = Chest
o = Small
g = Glue

( blocks that can be moved by the player )
Movable = Crate or Box or Chest or Small or Glue

( all things that can move and push blocks )
Mover = Player or Movable

( things that can stop a movement if they are stationary )
Obstacle = Wall or Mover

=======
SOUNDS
=======

================
COLLISIONLAYERS
================

Background
Target
Obstacle
Wanna_Move

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

( 1. Propagate movements forward )
[ > Mover | Movable ] -> [ > Mover | > Movable  ]
+ [ > Box    ] [ Box   ] -> [ > Box    ] [ > Box    ]
+ [ > Crate  ] [ Crate ] -> [ > Crate  ] [ > Crate  ]
+ [ > Chest  ] [ Chest ] -> [ > Chest  ] [ > Chest  ]
+ [ moving Glue | Glue ] -> [ moving Glue | moving Glue ]

( 2. Propagate obstructions backwards )
[ > Mover  | stationary Obstacle ] -> [ stationary Mover | Obstacle ]
+ [ > Crate  ] [ stationary Crate ] -> [ stationary Crate ] [ Crate ]
+ [ > Box    ] [ stationary Box   ] -> [ stationary Box   ] [ Box   ]
+ [ > Chest  ] [ stationary Chest ] -> [ stationary Chest ] [ Chest ]
+ [ moving Glue | stationary Glue ] -> [ stationary Glue | Glue ]

( 3. remove all movement, keep a flag )
[ > Movable ] -> [ Movable wanna_move ]

( 4. propagate movement only on wanna_move things )
(    ie redo step 1 but with WANNA_MOVE added to the first line below )
[ > Mover  | Movable WANNA_MOVE ] -> [ > Mover | > Movable ]
+ [ > Box   ] [ Box   ] -> [ > Box   ] [ > Box   ]
+ [ > Crate ] [ Crate ] -> [ > Crate ] [ > Crate ]
+ [ > Chest ] [ Chest ] -> [ > Chest ] [ > Chest ]
+ [ moving Glue | Glue ] -> [ moving Glue | moving Glue ]

( 5. cleanup, remove flag )
[ wanna_move ] -> [ ]

==============
WINCONDITIONS
==============

=======     
LEVELS
=======

###################
#.................#
#.................#
#...*..g.g.#......#
#...*......#...g###
#...*...o.%%%.....#
#...+++.o.%.......#
#....+....%%%.....#
#....+.....P...g..#
#....p.gg.........#
###################
