Skip to content

Instantly share code, notes, and snippets.

@Draknek
Last active July 9, 2024 11:35
Show Gist options
  • Save Draknek/bf4be9842212ac2bde63ddfa03841507 to your computer and use it in GitHub Desktop.
Save Draknek/bf4be9842212ac2bde63ddfa03841507 to your computer and use it in GitHub Desktop.
Bombs and Boxes and Bombs in Boxes (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Bombs and Boxes and Bombs in Boxes
author Alan Hazelden
homepage alan.draknek.org
(verbose_logging)
========
OBJECTS
========
Background
lightgreen green
11111
01111
11101
11111
10111
Target
darkblue
.....
.000.
.0.0.
.000.
.....
Wall
brown darkbrown
00010
11111
01000
11111
00010
PlayerRight
#990c33 #ffffff #c83242 #cf5c50 #640821
.000.
.221.
.222.
.333.
.3.3.
PlayerLeft
#990c33 #ffffff #c83242 #cf5c50 #640821
.000.
.122.
.222.
.333.
.3.3.
PlayerUp
#990c33 #ffffff #c83242 #cf5c50 #640821
.000.
.222.
.222.
.333.
.3.3.
PlayerDown
#990c33 #ffffff #c83242 #cf5c50 #640821
.000.
.121.
.222.
.333.
.3.3.
CrateRight
orange brown
00000
0...0
0....
0...0
00000
CrateEmpty
brown
CrateCanEat
#925415
CrateFull
brown
00000
00000
00.00
00000
00000
CrateRightBarfing
#925415
00000
00000
000.0
00000
00000
CrateEating
#925415
Bomb
darkblue white
.....
.00..
0000.
0000.
.00..
BombTriggered
darkblue red
.....
.00..
0110.
0110.
.00..
(RemoveMarker
red)
QuickActionMarker
yellow
BombInBox
darkblue
.....
.000.
.000.
.000.
.....
BombTriggeredInBox
red
.....
.000.
.000.
.000.
.....
PlayerInBox
#990c33
.....
.000.
.000.
.000.
.....
CrateRightInBox
orange
.....
.000.
.000.
.000.
.....
BombInBoxInBox
transparent
BombTriggeredInBoxInBox
transparent
BombInBarfingBoxInBox
transparent
BombTriggeredInBarfingBoxInBox
transparent
CrateEatingInBox
transparent
Explosion
red
.....
.0...
...0.
..0..
.....
ShowCanActivate
yellow
0...0
.....
.....
.....
0...0
=======
LEGEND
=======
PlayerNormal = PlayerLeft or PlayerRight or PlayerUp or PlayerDown
Player = PlayerNormal or PlayerInBox
Crate = CrateRight
BoxInBox = CrateRightInBox
CrateState = CrateEmpty or CrateFull or CrateEating or CrateRightBarfing or CrateCanEat
InBox = BombInBox or BombTriggeredInBox or PlayerInBox or BoxInBox
InBoxInBox = BombInBoxInBox or BombTriggeredInBoxInBox or CrateEatingInBox or BombInBarfingBoxInBox or BombTriggeredInBarfingBoxInBox
Pushable = Crate or Bomb or BombTriggered or PlayerNormal
Solid = Wall or Pushable or Player
Triggerable = Crate or Bomb or BombTriggered
Destroyable = Solid or InBox or InBoxInBox or CrateState
. = Background
# = Wall
P = PlayerDown
* = CrateRight and CrateEmpty
O = Target
! = Bomb
=======
SOUNDS
=======
Crate move 36772507
================
COLLISIONLAYERS
================
Background
Target
InBoxInBox
InBox
CrateState
Wall, Pushable
QuickActionMarker, Explosion
ShowCanActivate
======
RULES
======
[ CrateCanEat ] -> [ CrateEmpty ]
[ > PlayerInBox ] -> [ PlayerInBox ]
[ action PlayerInBox Crate ] -> [ PlayerInBox action Crate ]
left [ > Player | no Solid ] -> [ | PlayerLeft ]
right [ > Player | no Solid ] -> [ | PlayerRight ]
up [ > Player | no Solid ] -> [ | PlayerUp ]
down [ > Player | no Solid ] -> [ | PlayerDown ]
[ left Player no PlayerLeft ] -> [ PlayerLeft QuickActionMarker ]
[ right Player no PlayerRight ] -> [ PlayerRight QuickActionMarker ]
[ up Player no PlayerUp ] -> [ PlayerUp QuickActionMarker ]
[ down Player no PlayerDown ] -> [ PlayerDown QuickActionMarker ]
left [ action PlayerLeft | Triggerable ] -> [ PlayerLeft | action Triggerable ]
right [ action PlayerRight | Triggerable ] -> [ PlayerRight | action Triggerable ]
up [ action PlayerUp | Triggerable ] -> [ PlayerUp | action Triggerable ]
down [ action PlayerDown | Triggerable ] -> [ PlayerDown | action Triggerable ]
(Quick actions don't take any time, so don't let other objects do things)
[ QuickActionMarker ] [ BombTriggered ] -> [ QuickActionMarker ] [ QuickActionMarker BombTriggered ]
(Pushing)
[ > Player | Pushable ] -> [ > Player | > Pushable ]
[ > Pushable | Pushable ] -> [ > Pushable | > Pushable ]
[ > Pushable | Wall ] -> cancel
[ > Crate CrateState InBox InBoxInBox | no Solid ] -> [ | Crate CrateState InBox InBoxInBox ]
+ [ > Crate CrateState InBox | no Solid ] -> [ | Crate CrateState InBox ]
+ [ > Crate CrateState no InBox | no Solid ] -> [ | Crate CrateState ]
+ [ > Pushable no Crate | no Solid ] -> [ | Pushable ]
(Triggered objects)
(Box triggering)
[ action CrateRight CrateRightBarfing ] -> [ CrateRight CrateFull ]
[ CrateRightBarfing InBox ] -> [ CrateRightBarfing right InBox ]
[ action CrateRight CrateEating ] -> [ CrateRight CrateEmpty ]
[ CrateRight CrateEating ] -> [ CrateRight right CrateEating ]
[ action CrateRight no InBox ] -> [ CrateRight right CrateEating ]
[ action CrateRight InBox ] -> [ CrateRight right InBox CrateRightBarfing ]
(Box eating)
[ > CrateEating | Bomb ] -> [ CrateFull BombInBox | ]
[ > CrateEating | BombTriggered ] -> [ CrateFull BombTriggeredInBox | ]
[ > CrateEating | Player ] -> [ CrateFull PlayerInBox | ]
[ > CrateEating | CrateRight CrateEating ] -> [ CrateFull CrateRightInBox CrateEatingInBox | no CrateState ]
[ > CrateEating | CrateRight BombInBox CrateRightBarfing ] -> [ CrateFull CrateRightInBox BombInBarfingBoxInBox | no CrateState ]
[ > CrateEating | CrateRight BombTriggeredInBox CrateRightBarfing ] -> [ CrateFull CrateRightInBox BombTriggeredInBarfingBoxInBox | no CrateState ]
[ > CrateEating | CrateRight BombInBox ] -> [ CrateFull CrateRightInBox BombInBoxInBox | no CrateState ]
[ > CrateEating | CrateRight BombTriggeredInBox ] -> [ CrateFull CrateRightInBox BombTriggeredInBoxInBox | no CrateState ]
[ > CrateEating | CrateRight no InBox ] -> [ CrateFull CrateRightInBox | no CrateState ]
[ stationary Crate moving CrateEating ] -> [ Crate CrateEating ]
(Box barfing - pushing things out of the way)
[ > InBox | Pushable ] -> [ > InBox | > Pushable ]
[ > Pushable | Pushable ] -> [ > Pushable | > Pushable ]
[ > Pushable | stationary Solid ] -> [ Pushable | Solid ]
[ > Crate CrateState InBox InBoxInBox | no Solid ] -> [ | Crate CrateState InBox InBoxInBox ]
+ [ > Crate CrateState InBox | no Solid ] -> [ | Crate CrateState InBox ]
+ [ > Crate CrateState no InBox | no Solid ] -> [ | Crate CrateState ]
+ [ > Pushable no Crate | no Solid ] -> [ | Pushable ]
(Box barfing - blocked, so pushes things behind it)
[ Pushable | > InBox | stationary Solid ] -> [ < Pushable | > InBox | Solid ]
[ > Pushable | Pushable ] -> [ > Pushable | > Pushable ]
[ > Pushable | stationary Solid ] -> [ Pushable | Solid ]
[ > Crate CrateState InBox InBoxInBox | no Solid ] -> [ | Crate CrateState InBox InBoxInBox ]
+ [ > Crate CrateState InBox | no Solid ] -> [ | Crate CrateState InBox ]
+ [ > Crate CrateState no InBox | no Solid ] -> [ | Crate CrateState ]
+ [ > Pushable no Crate | no Solid ] -> [ | Pushable ]
[ no Solid | Crate CrateState InBoxInBox > InBox | stationary Solid ] -> [ Crate CrateState InBoxInBox > InBox | | Solid ]
[ no Solid | Crate CrateState > InBox | stationary Solid ] -> [ Crate CrateState > InBox | | Solid ]
(Box barfing - actual barfing)
[ > BombInBox | no Solid ] -> [ CrateEmpty | Bomb ]
[ > BombTriggeredInBox | no Solid ] -> [ CrateEmpty | BombTriggered QuickActionMarker ] again
[ > CrateRightInBox CrateEatingInBox | no Solid ] -> [ CrateEmpty | CrateRight CrateEating ] again
[ > CrateRightInBox BombInBarfingBoxInBox | no Solid ] -> [ CrateEmpty | CrateRight BombInBox CrateRightBarfing ] again
[ > CrateRightInBox BombInBoxInBox | no Solid ] -> [ CrateEmpty | CrateRight BombInBox CrateFull ]
[ > CrateRightInBox BombTriggeredInBoxInBox | no Solid ] -> [ CrateEmpty | CrateRight BombTriggeredInBox CrateFull ]
[ > CrateRightInBox BombTriggeredInBarfingBoxInBox | no Solid ] -> [ CrateEmpty | CrateRight BombTriggeredInBox CrateRightBarfing ] again
[ > CrateRightInBox | no Solid ] -> [ CrateEmpty | CrateRight CrateEmpty ]
left [ > PlayerInBox | no Solid ] -> [ CrateEmpty | PlayerLeft ]
right [ > PlayerInBox | no Solid ] -> [ CrateEmpty | PlayerRight ]
up [ > PlayerInBox | no Solid ] -> [ CrateEmpty | PlayerUp ]
down [ > PlayerInBox | no Solid ] -> [ CrateEmpty | PlayerDown ]
[ > InBox ] -> [ InBox ]
(Bomb)
[ action BombTriggered ] -> [ Bomb ]
[ Explosion Bomb ] -> [ BombTriggered ]
[ Explosion Destroyable ] -> [ Explosion ]
[ Explosion ] -> [] again
[ | BombTriggered no QuickActionMarker | ] -> [ > Explosion | BombTriggered | < Explosion ]
[ ^ Explosion | no Explosion ] -> [ ^ Explosion | Explosion ]
[ v Explosion | no Explosion ] -> [ v Explosion | Explosion ]
[ moving Explosion ] -> [ Explosion ]
[ BombTriggered no QuickActionMarker ] -> [ Explosion ]
[ Explosion ] -> again
[ Explosion Bomb ] -> [ BombTriggered ]
[ action Bomb ] -> [ BombTriggered ]
(Visual indicator for activatability)
[ ShowCanActivate ] -> []
[ PlayerInBox ] -> [ PlayerInBox ShowCanActivate ]
left [ PlayerLeft | Triggerable ] -> [ PlayerLeft | Triggerable ShowCanActivate ]
right [ PlayerRight | Triggerable ] -> [ PlayerRight | Triggerable ShowCanActivate ]
up [ PlayerUp | Triggerable ] -> [ PlayerUp | Triggerable ShowCanActivate ]
down [ PlayerDown | Triggerable ] -> [ PlayerDown | Triggerable ShowCanActivate ]
(cleanup)
[ QuickActionMarker ] -> []
right [ CrateRight CrateEmpty | Pushable ] -> [ CrateRight CrateCanEat | Pushable ]
==============
WINCONDITIONS
==============
all Target on Player
=======
LEVELS
=======
#############
#############
##...###...##
##p!...#....o
##...###...##
#############
#############
######o#
######.#
#..###.#
#.!#...#
#..#####
p.######
########
############
############
##...#######
##.!.###...#
##p!.###...o
##.!.###...#
##...#######
############
############
####o###
###...##
###...##
#.#...##
#.######
#p..####
#.######
#.##...#
#..*..!#
#..#####
########
(############
############
##.p.#######
##.!.#######
##...###...#
####.###...o
####...#...#
####.#######
##...#######
##.*.#######
##...#######
############
############)
(##############
##############
##.....#######
##..p..#######
##.....#######
##.*.!.###...#
##.....###...o
######...#...#
######.#######
######.#######
##############
##############)
############
############
###...######
###.#.##...#
###....#...o
####p!##...#
##...#######
##.*.#######
##...#######
############
############
(leftover unretriveable box and crate)
#########
#########
###.!####
###.!.###
#.p.#####
#.*.#...#
#...#...#
######o##
##########
##########
###..#####
##*..#...#
##..##...o
##.!.#...#
###.p#####
##########
##########
(salvageable crate)
#######o##
######...#
##...#...#
##.*.#...#
##...#...#
###.######
###.######
###p!#####
###.*#####
##...#####
##..######
##########
##########
(salvageable crate)
###########
###########
###..#..###
###!.#.!###
###..######
##.p#######
##...##...#
##.*.##...o
##...##...#
###########
###########
(this level would still work and be more interesting with one of the crates being upwards or downwards, with stored activation)
(two salvageable crates)
###############
###############
###############
###...#####...#
###p*...!##...#
###.*...!##...o
###...#####...#
###############
###############
###############
(salvageable crate)
############
############
###..#######
##*..###...#
##.p####...o
##.!####...#
##.!########
##..#...####
#####.*.####
#####...####
############
############
###########
###########
##..#######
##...######
###..##...#
####p!#...o
##.*..#...#
##...##...#
###########
###########
###########
###########
#####...###
#####...###
#####...###
#####.#####
#####.#####
#####.!####
#####.!####
##....#####
##.p.*#...#
##...*#...o
##....#...#
###########
###########
##########
##########
###..p..##
###.*.!.##
##..######
##...#####
##########
#####...##
#####...##
#####...##
######o###
(salvageable crate)
(deemed redundant)
(##############
##########...#
##########...o
######..##...#
##...!..######
##.p.#.##...##
##...#.##.*.##
##...!..#...##
######..######
##############
##############)
########o##
#######...#
###...#...#
###.###...#
###.#######
###..######
##...p...##
##.*.*.!.##
##.......##
###########
###########
message Almost there...
############
############
###..#######
###..#######
###..###...#
###*..##...o
####.###...#
##...#######
##p!!#######
##...#######
############
############
(full success: get a box to the exit)
(redundant with an earlier more compact level)
(###############
###########...#
###########...o
#######..##...#
##..!....######
##p###..##...##
##.###..##.*.##
##..!....#...##
#######..######
###############
###############)
(merge)
(#############
#############
##..!########
....!#!######
.#..!###...##
.#######.*.##
.#######...##
p###!!!######
.###...##...#
.###...##...o
..###.###...#
...##.#######
......#######)
(I think this level is possible if one of the boxes is upwards. Requires box-in-box-in-box to be supported)
(##########
#######..#
#######..o
##...#####
##.*.#.###
##.*..!.##
##....####
##.#*.####
##....####
##....####
##########
##########)
(I think this level is possible if one of the boxes is downwards. Requires primed empty boxes)
(###########
###########
##....#####
##..*.#####
##.*!.#####
##...p..###
#######.###
###########
######...##
######...##
######...##
#######o###)
message Thanks for playing :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment