Skip to content

Instantly share code, notes, and snippets.

@instr3
Created June 29, 2021 14:04
Show Gist options
  • Save instr3/dc937a924f852ccd27227ef50d12afac to your computer and use it in GitHub Desktop.
Save instr3/dc937a924f852ccd27227ef50d12afac to your computer and use it in GitHub Desktop.
Elephant Express (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Elephant Express
author Alith
homepage alith.itch.io
run_rules_on_level_start
norepeat_action
again_interval 0.2
========
OBJECTS
========
Background
#DDDDFF #CCCCFF
00000
01000
00000
00010
00000
Wall
Brown #884400
10001
00000
00000
00000
10001
WallBorderR
#884400
....0
....0
....0
....0
....0
WallBorderL
#884400
0....
0....
0....
0....
0....
WallBorderU
#884400
00000
.....
.....
.....
.....
WallBorderD
#884400
.....
.....
.....
.....
00000
Elephant1
gray darkgray
.....
..111
.1000
11011
0001.
Elephant2
gray darkgray
111..
.....
.....
.....
.....
Elephant3
gray darkgray black
.....
1111.
00001
10200
10000
Elephant4
gray darkgray lightgray
01022
00001
11001
.1001
.1111
Elephant5
gray darkgray
.....
..111
.1000
10000
10000
Elephant6
gray darkgray
10000
10000
10011
1001.
1111.
NoseBackL
darkgray
.....
00...
00...
00...
.....
NoseBackR
darkgray
.....
...00
...00
...00
.....
NoseBackU
darkgray
.000.
.000.
.....
.....
.....
NoseBackD
darkgray
.....
.....
.....
.000.
.000.
NoseFrontL
gray
.....
.....
000..
.....
.....
NoseFrontR
gray
.....
.....
..000
.....
.....
NoseFrontU
gray
..0..
..0..
..0..
.....
.....
NoseFrontD
gray
.....
.....
..0..
..0..
..0..
Player
darkgray
.....
.....
..0..
.....
.....
PlayerTrace
darkgray
.....
..0..
.000.
..0..
.....
Crate1
lightred red
..1..
.111.
10001
10001
.111.
Crate2
lightgreen green
..1..
.111.
10001
10001
.111.
Crate3
#7777aa purple
.111.
10101
.111.
.101.
..1..
Target1
lightred
.....
.000.
.000.
.000.
.....
Target2
lightgreen
.....
.000.
.000.
.000.
.....
Target3
#7777aa
.....
.000.
.000.
.000.
.....
Unsatisfied
brown
.....
.....
..0..
.....
.....
WindL
white #eeeeee
111..
.....
1111.
.....
111..
WindR
white #eeeeee
..111
.....
.1111
.....
..111
WindU
white #eeeeee
1.1.1
1.1.1
1.1.1
..1..
.....
WindD
white #eeeeee
.....
..1..
1.1.1
1.1.1
1.1.1
WindPlaceHolder
transparent
ElephantPlaceHolder
transparent
MessageBlock
transparent
HungryPlaceHolder
transparent
EatPlaceHolder
transparent
=======
LEGEND
=======
. = Background
AllWall = Wall and WallBorderR and WallBorderL and WallBorderU and WallBorderD
Wind = WindL or WindR or WindU or WindD
# = AllWall
1 = Crate1
2 = Crate2
3 = Crate3
Crate = Crate1 or Crate2 or Crate3
Target = Target1 or Target2 or Target3
! = Target1 and AllWall and Unsatisfied
@ = Target2 and AllWall and Unsatisfied
$ = Target3 and AllWall and Unsatisfied
ElephantBody = Elephant1 or Elephant3 or Elephant4 or Elephant5 or Elephant6
NoseFront = NoseFrontL or NoseFrontR or NoseFrontU or NoseFrontD
NoseBack = NoseBackL or NoseBackR or NoseBackU or NoseBackD
StartingNose = NoseFrontL and NoseBackL and Player
Obstacles = PlayerTrace or Wall or ElephantBody
E = ElephantPlaceHolder
X = ElephantPlaceHolder and HungryPlaceHolder
M = MessageBlock
=======
SOUNDS
=======
sfx0 3030907
sfx1 63698306
sfx2 67740703
sfx3 51452703 (*6451103*)
sfx4 90417500
sfx5 59902509
================
COLLISIONLAYERS
================
Background
Elephant2
Crate
NoseBackL
NoseBackR
NoseBackU
NoseBackD
PlayerTrace
NoseFrontL
NoseFrontR
NoseFrontU
NoseFrontD
Player, Wall, ElephantBody
WallBorderL
WallBorderR
WallBorderU
WallBorderD
Target
Unsatisfied
ElephantPlaceHolder
MessageBlock
Wind
WindPlaceHolder
HungryPlaceHolder
EatPlaceHolder
======
RULES
======
(* preprocess *)
down [ WallBorderD | WallBorderU ] -> [ | ]
right [ WallBorderR | WallBorderL ] -> [ | ]
down [ ElephantPlaceHolder | ElephantPlaceHolder ] -> [ ElephantPlaceHolder | ]
right [ ElephantPlaceHolder | ElephantPlaceHolder | ElephantPlaceHolder ] -> [ Elephant5 ElephantPlaceHolder | Elephant3 ElephantPlaceHolder | Elephant1 ElephantPlaceHolder ]
down [ ElephantPlaceHolder Elephant1 | ] -> [ Elephant1 ElephantPlaceHolder | Elephant2 ]
down [ ElephantPlaceHolder Elephant3 | ] -> [ Elephant3 | Elephant4 ]
down [ ElephantPlaceHolder Elephant5 | ] -> [ Elephant5 | Elephant6 ]
right [ Elephant1 ElephantPlaceHolder | ] -> [ Elephant1 | StartingNose ]
[ Crate Elephant2 no HungryPlaceHolder ] -> [ Crate Elephant2 ] message These are for my customers. Probably I should not eat them... (Z to undo)
[ EatPlaceHolder Crate ] -> [ ] message yummy yummy!
(* logic *)
[ > Player MessageBlock Crate ] -> message Press X to deliver
[ > Player | Obstacles ] -> [ Player | Obstacles ]
left [ left Player Crate | no Obstacles no Crate ] -> [ NoseBackL NoseFrontL PlayerTrace | NoseBackR NoseFrontR Player Crate]
right [ right Player Crate | no Obstacles no Crate ] -> [ NoseBackR NoseFrontR PlayerTrace | NoseBackL NoseFrontL Player Crate]
up [ up Player Crate | no Obstacles no Crate ] -> [ NoseBackU NoseFrontU PlayerTrace | NoseBackD NoseFrontD Player Crate]
down [ down Player Crate | no Obstacles no Crate ] -> [ NoseBackD NoseFrontD PlayerTrace | NoseBackU NoseFrontU Player Crate]
[ > Player no Crate | Crate no Obstacles ] -> sfx0
left [ left Player no Crate | no Obstacles ] -> [ NoseBackL NoseFrontL PlayerTrace | NoseBackR NoseFrontR Player]
right [ right Player no Crate | no Obstacles ] -> [ NoseBackR NoseFrontR PlayerTrace | NoseBackL NoseFrontL Player]
up [ up Player no Crate | no Obstacles ] -> [ NoseBackU NoseFrontU PlayerTrace | NoseBackD NoseFrontD Player]
down [ down Player no Crate | no Obstacles ] -> [ NoseBackD NoseFrontD PlayerTrace | NoseBackU NoseFrontU Player]
[ > Player ] -> [ Player ]
[ action Player Crate1 | Unsatisfied Target1 no Crate ] -> [ Player | Target1 ] sfx4
[ action Player Crate2 | Unsatisfied Target2 no Crate ] -> [ Player | Target2 ] sfx4
[ action Player Crate3 | Unsatisfied Target3 no Crate ] -> [ Player | Target3 ] sfx4
(* wind *)
left [ NoseBackR Player no Crate | Crate Wind no WindPlaceHolder ] -> [ NoseBackR Player Crate | ]
right [ NoseBackL Player no Crate | Crate Wind no WindPlaceHolder ] -> [ NoseBackL Player Crate | ]
up [ NoseBackD Player no Crate | Crate Wind no WindPlaceHolder ] -> [ NoseBackD Player Crate | ]
down [ NoseBackU Player no Crate | Crate Wind no WindPlaceHolder ] -> [ NoseBackU Player Crate | ]
[ Wind ] -> [ ]
[ WindPlaceHolder ] -> [ ]
left [ NoseBackR action Player Crate | no Obstacles no Crate ] -> [ NoseBackR Player | Crate WindR WindPlaceHolder ] sfx2 again
right [ NoseBackL action Player Crate | no Obstacles no Crate ] -> [ NoseBackL Player | Crate WindL WindPlaceHolder ] sfx2 again
up [ NoseBackD action Player Crate | no Obstacles no Crate ] -> [ NoseBackD Player | Crate WindD WindPlaceHolder ] sfx2 again
down [ NoseBackU action Player Crate | no Obstacles no Crate ] -> [ NoseBackU Player | Crate WindU WindPlaceHolder ] sfx2 again
left [ NoseBackR action Player no Crate | ] -> [ NoseBackR Player | WindR ] sfx3 again
right [ NoseBackL action Player no Crate | ] -> [ NoseBackL Player | WindL ] sfx3 again
up [ NoseBackD action Player no Crate | ] -> [ NoseBackD Player | WindD ] sfx3 again
down [ NoseBackU action Player no Crate | ] -> [ NoseBackU Player | WindU ] sfx3 again
[ Crate Elephant2 HungryPlaceHolder no EatPlaceHolder ] -> [ Crate Elephant2 HungryPlaceHolder EatPlaceHolder ] sfx5 again
==============
WINCONDITIONS
==============
No Crate
=======
LEVELS
=======
message Alith the elephant is working at a fruit warehouse
message Level 1 / 12: Press WSAD to move
#!#......
#M#######
#.......#
#######.#
#EEE...1#
#EEE#####
message Level 2 / 12
###########
#2.......1#
#..#####..#
#.........#
#..#!#@#..#
#.........#
#EEE......#
#EEE#######
message Level 3 / 12
#######
#.....#
!.2.1.@
#.....#
@.1.2.!
#.....#
#EEE..#
#EEE..#
message Level 4 / 12: When carrying a fruit, press X to exhale (and drop it)
...#######
####.....#
!....###.#
####.....#
...#1##2.#
####.#...#
#EEE.@...#
#EEE.#####
message Level 5 / 12
.###########
.#.........#
.$....2....@
##3..###...#
#EEE..1..#.!
#EEE########
message Level 6 / 12
############
#EEE..2....@
#EEE..1....!
############
message Level 7 / 12
##!$@##
#.....#
#.....#
#.....#
#.132.#
#.....#
#EEE..#
#EEE###
message Level 8 / 12: While facing a fruit, press X to inhale (and drag it)
###@#!###
#3......#
#.......#
$..###..#
##..2...#
#..###.##
#EEE...1#
#EEE#####
message level 9 / 12
#########
#.......#
#..2.1..#
#.#!.@#.#
#.......#
EEE.....#
EEE######
message level 10 / 12
...########
..##2.....#
.##1......#
##2....@@##
#1....!!..#
#....@@...#
#...!!...2#
#.......1##
#EEE...2##.
#EEE..1##..
########...
message level 11 / 12
########@#
!..#.....#
#.......2#
!.......##
#.......1#
!.......##
#.......1#
$..3....##
#EEE....1#
#EEE######
message The work is done, but Alith the elephant is tired and hungry...
############
#EEE....1..#
#EEX.......#
############
############
#EEE.......#
#EEX.......#
###......###
#.2......3.#
#..........#
############
message Alith is now happy! You win!
message P.S. Here are also some challenging but optional tasks ahead!
message level Ex. 1 / 2
###!##$@###
!.1.......#
$.#....##2#
#.#.....#.#
#.........#
#..1..3.3.@
#.......#.#
#EEE....2.#
#EEE#######
message level Ex. 2 / 2
##########
#........#
#........#
#........#
#....$...#
#...2....!
#..31....@
#EEE.....#
#EEE######
message Well done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment