Created
April 21, 2024 08:38
-
-
Save floriancargoet/b0ddbe61759738b69d6997bff25cdca3 to your computer and use it in GitHub Desktop.
Lawnmower (PuzzleScript Script)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
title Lawnmower | |
author CrocMiam | |
homepage www.puzzlescript.net | |
noaction | |
run_rules_on_level_start | |
======== | |
OBJECTS | |
======== | |
Background * | |
transparent | |
LongGrass | |
#33aa33 #337733 | |
00000 | |
00001 | |
01010 | |
01010 | |
01010 | |
Grass | |
#33aa33 #339933 | |
00000 | |
00000 | |
00000 | |
01000 | |
01010 | |
Wall | |
#33aa33 Grey Lightgrey White | |
00200 | |
00300 | |
12321 | |
00200 | |
00100 | |
Player | |
black orange white blue | |
.000. | |
.111. | |
22222 | |
.333. | |
.3.3. | |
MowerLeft | |
darkgrey black red | |
.1.1. | |
00000 | |
0220. | |
00000 | |
.1.1. | |
MowerRight | |
darkgrey black red | |
.1.1. | |
00000 | |
.0220 | |
00000 | |
.1.1. | |
MowerDown | |
darkgrey black red | |
.0.0. | |
10001 | |
.020. | |
10201 | |
.000. | |
MowerUp | |
darkgrey black red | |
.000. | |
10201 | |
.020. | |
10001 | |
.0.0. | |
MowerAuto (use this if you don't know the orientation, it will be auto-fixed) | |
transparent | |
WillUp | |
transparent | |
WantsUp | |
transparent | |
WillDown | |
transparent | |
WantsDown | |
transparent | |
WillLeft | |
transparent | |
WantsLeft | |
transparent | |
WillRight | |
transparent | |
WantsRight | |
transparent | |
======= | |
LEGEND | |
======= | |
, = LongGrass | |
. = Grass | |
# = Wall | |
Ä = Player and Grass | |
À = Player and LongGrass | |
M = MowerAuto and Grass | |
AnyMower = MowerLeft or MowerRight or MowerDown or MowerUp or MowerAuto | |
Wants = WantsUp or WantsDown or WantsLeft or WantsRight | |
======= | |
SOUNDS | |
======= | |
================ | |
COLLISIONLAYERS | |
================ | |
Background | |
Grass, LongGrass | |
Player, Wall, AnyMower | |
Wants, WillUp, WillDown, WillLeft, WillRight | |
====== | |
RULES | |
====== | |
(auto fix mower orientation) | |
late right [ Player | AnyMower ] -> [ Player | MowerRight ] | |
late left [ Player | AnyMower ] -> [ Player | MowerLeft ] | |
late up [ Player | AnyMower ] -> [ Player | MowerUp ] | |
late down [ Player | AnyMower ] -> [ Player | MowerDown ] | |
(push) | |
[ > Player | Anymower ] -> [ > Player | > Anymower ] | |
(pull) | |
[ < Player | Anymower ] -> [ < Player | < Anymower ] | |
(rotate around mower) | |
( This rules work for all directions) | |
( Remove Wants* flag if the other has lost it ) | |
[ Player Wants | AnyMower no Wants ] -> [ Player | AnyMower ] | |
[ Player no Wants | AnyMower Wants ] -> [ Player | AnyMower ] | |
(rotate up) | |
(If the player presses up while the lawnmower is horizontally next to it, put a WantsUp flag on both) | |
horizontal [ up Player | AnyMower ] -> [ Player WantsUp | AnyMower WantsUp ] | |
( Remove WantsUp flag from player if something is blocking above him ) | |
up [ Player WantsUp | Wall ] -> [ Player | Wall ] | |
( Remove WantsUp flag from lawnmower if something is blocking above it ) | |
up [ AnyMower WantsUp | Wall ] -> [ AnyMower | Wall ] | |
( Move the player to the mower and add WillUp flag ) | |
horizontal [ Player WantsUp | AnyMower WantsUp ] -> [ | Player WillUp ] | |
( Move the player up, add the mower below it ) | |
late up [Player WillUp | ] -> [MowerDown | Player ] | |
(rotate down) | |
horizontal [ down Player | AnyMower ] -> [ Player WantsDown | AnyMower WantsDown ] | |
down [ Player WantsDown | Wall ] -> [ Player | Wall ] | |
down [ AnyMower WantsDown | Wall ] -> [ AnyMower | Wall ] | |
horizontal [ Player WantsDown | AnyMower WantsDown ] -> [ | Player WillDown ] | |
late down [Player WillDown | ] -> [MowerUp | Player ] | |
(rotate left) | |
vertical [ left Player | AnyMower ] -> [ Player WantsLeft | AnyMower WantsLeft ] | |
left [ Player WantsLeft | Wall ] -> [ Player | Wall ] | |
left [ AnyMower WantsLeft | Wall ] -> [ AnyMower | Wall ] | |
vertical [ Player WantsLeft | AnyMower WantsLeft ] -> [ | Player WillLeft ] | |
late left [Player WillLeft | ] -> [MowerRight | Player ] | |
(rotate right) | |
vertical [ right Player | AnyMower ] -> [ Player WantsRight | AnyMower WantsRight ] | |
right [ Player WantsRight | Wall ] -> [ Player | Wall ] | |
right [ AnyMower WantsRight | Wall ] -> [ AnyMower | Wall ] | |
vertical [ Player WantsRight | AnyMower WantsRight ] -> [ | Player WillRight ] | |
late right [Player WillRight | ] -> [MowerLeft | Player ] | |
(mow grass) | |
late [ LongGrass AnyMower ] -> [ Grass AnyMower ] | |
============== | |
WINCONDITIONS | |
============== | |
No LongGrass | |
======= | |
LEVELS | |
======= | |
######### | |
#......,# | |
#..Ä....# | |
#..M....# | |
#.......# | |
#...,,..# | |
#..,,,..# | |
#.......# | |
#.......# | |
######### | |
*********** | |
*####****** | |
*#,À#****** | |
##,M#****** | |
#,,,######* | |
#,,,,,,,,#* | |
##########* | |
*********** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment