Skip to content

Instantly share code, notes, and snippets.

@patrickgh3
Created April 24, 2022 20:20
Show Gist options
  • Select an option

  • Save patrickgh3/7c6a362fc672b436d54731731cdbbc74 to your computer and use it in GitHub Desktop.

Select an option

Save patrickgh3/7c6a362fc672b436d54731731cdbbc74 to your computer and use it in GitHub Desktop.
Making a mountain out of a molehill (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Making a mountain out of a molehill
again_interval 0.1
run_rules_on_level_start
========
OBJECTS
========
Background .
lightblue
Dirt #
darkbrown
DirtMarker
#292219
DirtMarker2
transparent
DirtMarkerH
red
.....
.....
..0..
.....
.....
DirtMarkerV
blue
.....
.....
...0.
.....
.....
DarkDirt X
darkgray
Goal g
yellow
0.0.0
.000.
00000
.000.
0.0.0
Mole
gray lightred
.....
.000.
00001
0000.
.1.1.
MoleDirt d
gray lightred darkbrown
.222.
22222
00001
0000.
.1.1.
(
.222.
22222
00001
0000.
.1.1.
)
MoleLeft
gray lightred
..1..
1000.
.000.
1000.
.00..
MoleRight
gray lightred
..1..
.0001
.000.
.0001
..00.
MoleUp
gray lightred
.1.1.
0000.
00001
.000.
.....
MoleDown p
gray lightred
.....
.000.
00001
0000.
.1.1.
MoleLeftD
gray lightred darkbrown
..12.
10022
.0022
10022
.002.
MoleRightD
gray lightred darkbrown
.21..
22001
2200.
22001
.200.
MoleUpD
gray lightred darkbrown
.1.1.
0000.
00001
22222
.222.
MoleDownD
gray lightred darkbrown
.222.
22222
00001
0000.
.1.1.
(
MoleDown
gray lightred
.....
.000.
00001
0000.
.1.1.
)
MolePickup
transparent
MolePickup2
white
.....
.....
..0..
.....
.....
MolePickup2No
red
.....
.....
..0..
.....
.....
Fall
white
..0..
.....
..0..
..0..
.....
MolePlacing
transparent
MolePlacing2
white
.....
.....
..0..
.....
.....
MolePlacing2No
red
.....
.....
..0..
.....
.....
=======
LEGEND
=======
Player = Mole or MoleDirt or MoleLeft or MoleRight or MoleUp or MoleDown or MoleLeftD or MoleRightD or MoleUpD or MoleDownD
Solid = Dirt or DarkDirt
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
DirtMarker
DirtMarker2
DirtMarkerH
DirtMarkerV
Goal
Dirt DarkDirt
Player
MolePlacing MolePlacing2 MolePlacing2No MolePickup MolePickup2 MolePickup2No
Fall
======
RULES
======
( Remove markers )
[ DirtMarker ] -> [ ]
[ DirtMarker2 ] -> [ ]
[ DirtMarkerH ] -> [ ]
[ DirtMarkerV ] -> [ ]
( Retransform player )
[ MoleLeft ] -> [ Mole ]
[ MoleRight ] -> [ Mole ]
[ MoleUp ] -> [ Mole ]
[ MoleDown ] -> [ Mole ]
[ MoleLeftD ] -> [ MoleDirt ]
[ MoleRightD ] -> [ MoleDirt ]
[ MoleUpD ] -> [ MoleDirt ]
[ MoleDownD ] -> [ MoleDirt ]
[ Fall ] -> [ ]
( Place dirt markers )
[ Solid ] -> [ Solid DirtMarker ]
up [ Solid | no Solid ] -> [ Solid | DirtMarker ]
right [ Solid | DirtMarker ] -> [ Solid | DirtMarker DirtMarker2 ]
right [ Solid | no Solid ] -> [ Solid | DirtMarker ]
left [ Solid | DirtMarker ] -> [ Solid | DirtMarker DirtMarker2 ]
left [ Solid | no Solid ] -> [ Solid | DirtMarker ]
down [ Solid | DirtMarker ] -> [ Solid | DirtMarker DirtMarker2 ]
down [ Solid | no Solid ] -> [ Solid | DirtMarker ]
horizontal [ DirtMarker | no Solid ] -> [ DirtMarker | DirtMarkerH ]
vertical [ DirtMarker | no Solid ] -> [ DirtMarker | DirtMarkerV ]
[ DirtMarkerH DirtMarkerV ] -> [ DirtMarker DirtMarkerH DirtMarkerV ]
[ DirtMarkerH ] -> [ ]
[ DirtMarkerV ] -> [ ]
( Can't walk into solids )
[ > Player no MolePickup | Solid ] -> [ Player | Solid ]
( Pick up dirt )
([ > Mole | Dirt ] -> [ MoleDirt | no Dirt ])
[ action Mole no MolePickup ] -> [ Mole MolePickup ]
[ action Mole MolePickup ] -> [ Mole no MolePickup ]
[ > Mole MolePickup | Dirt ] -> [ MoleDirt no MolePickup | no Dirt ] again
[ > Mole MolePickup ] -> [ Mole MolePickup ] ( fail to pick up )
( Mole already has hands full )
([ > MoleDirt | Dirt ] -> [ MoleDirt | Dirt ])
( Place dirt )
[ action MoleDirt no MolePlacing ] -> [ MoleDirt MolePlacing ]
[ action MoleDirt MolePlacing ] -> [ MoleDirt no MolePlacing ]
([ > MoleDirt MolePlacing | no Solid ] -> [ Mole no MolePlacing | Dirt ])
[ > MoleDirt MolePlacing | no Solid DirtMarker ] -> [ Mole no MolePlacing | Dirt DirtMarker ] again
[ > MoleDirt MolePlacing ] -> [ MoleDirt MolePlacing ] ( fail to place )
( If floating in air, fall downwards )
[ > Player ] -> [ > Player ] again
down [ Player no DirtMarker | no Solid ] -> [ Fall | Player ] again
( Animate player )
late down [ Mole | Solid ] -> [ MoleDown | Solid ]
late left [ Mole | Solid ] -> [ MoleLeft | Solid ]
late right [ Mole | Solid ] -> [ MoleRight | Solid ]
late up [ Mole | Solid ] -> [ MoleUp | Solid ]
late [ Mole ] -> [ MoleDown ]
late down [ MoleDirt | Solid ] -> [ MoleDownD | Solid ]
late left [ MoleDirt | Solid ] -> [ MoleLeftD | Solid ]
late right [ MoleDirt | Solid ] -> [ MoleRightD | Solid ]
late up [ MoleDirt | Solid ] -> [ MoleUpD | Solid ]
late [ MoleDirt ] -> [ MoleDownD ]
( Pickup and placing graphics )
[ MolePickup2 ] -> [ ]
[ MolePickup2No ] -> [ ]
([ MolePickup | ] -> [ MolePickup | MolePickup2No ])
[ MolePickup | Dirt ] -> [ MolePickup | MolePickup2 Dirt ]
[ MolePlacing2 ] -> [ ]
[ MolePlacing2No ] -> [ ]
([ MolePlacing | ] -> [ MolePlacing | MolePlacing2No ])
[ MolePlacing | no Solid DirtMarker ] -> [ MolePlacing | MolePlacing2 DirtMarker ]
(up [ action MoleDirt | no Dirt ] -> [ Mole | Dirt ])
([ > Mole | Dirt ] -> [ | MoleDirt Dirt ])
([ > MoleDirt | Dirt ] -> [ MoleDirt | Dirt ])
([ > Player no Dirt | no Dirt ] -> [ Player | ])
([ action MoleDirt no Dirt ] -> [ Mole Dirt ])
([ action Mole Dirt ] -> [ MoleDirt no Dirt ])
==============
WINCONDITIONS
==============
all Goal on Player
=======
LEVELS
=======
message Arrow keys to move. You can only stand on dirt.
message Press X and then an arrow key to dig dirt and place dirt.
message These are just testing levels, not actual puzzles.
...............
...............
.......g.......
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
...............
.......##......
......####.....
xx#.###.p####xx
xx#.###.#####xx
xx#.....#####xx
xx###########xx
xxxxxxxxxxxxxxx
xxxxxxxxxxxxxxx
.................
.................
.................
.................
........g........
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
.................
..p....###.......
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
.................
.................
...p........g....
...##.#..........
...##............
...##............
.................
.................
.................
.................
.................
.................
.................
.................
...........##....
...........##....
xxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment