Skip to content

Instantly share code, notes, and snippets.

@jcmiller11
Created November 28, 2021 20:35
Show Gist options
  • Select an option

  • Save jcmiller11/c46c112c88390465ef85fd2f4682d4ee to your computer and use it in GitHub Desktop.

Select an option

Save jcmiller11/c46c112c88390465ef85fd2f4682d4ee to your computer and use it in GitHub Desktop.
City road builder (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title City road builder
author Stingby12
homepage https://confoundingcalendar.itch.io/
background_color #60117f
text_color #f9960f
run_rules_on_level_start
========
OBJECTS
========
Background
#151244
HouseNeut
#bc2f01
.....
.000.
.000.
.000.
.....
HouseWonrg
#922a95
.....
.000.
.000.
.000.
.....
HouseRight
#680703
.....
.000.
.000.
.000.
.....
Intersect
#922a95
.....
..0..
.000.
..0..
.....
Wall
#60117f
Player
#f9cb60 #f9960f
.....
.0.0.
..1..
.0.0.
.....
PlayerDone
#f9cb60 #f9960f
.....
.....
..1..
.....
.....
Startpos
#be7dbc
.....
.0.0.
..0..
.0.0.
.....
PathL
#f9960f
.....
.....
000..
.....
.....
PathR
#f9960f
.....
.....
..000
.....
.....
PathU
#f9960f
..0..
..0..
..0..
.....
.....
PathD
#f9960f
.....
.....
..0..
..0..
..0..
Corner
transparent
Straight
transparent
Cantmove
#be7dbc
.....
.....
..0..
.....
.....
Win1
transparent
CornerWonrg
#680703
..0..
.0.0.
0...0
.0.0.
..0..
CantWin
transparent
=======
LEGEND
=======
. = Background
# = Wall
O = HouseNeut
+ = Intersect
P = Player and Startpos
Path = PathL or PathR or PathU or PathD
House = HouseNeut or HouseWonrg or HouseRight
Wonrg = HouseWonrg or HouseNeut or CornerWonrg
=======
SOUNDS
=======
endlevel 83744503
startgame 92244503
================
COLLISIONLAYERS
================
Background
Corner
Straight
CornerWonrg
Startpos
House
Intersect
PathL
PathR
PathU
PathD
Player, PlayerDone
Wall
Cantmove
Win1
CantWin
======
RULES
======
(clearing)
[Straight] -> []
[Corner] -> []
[Cantmove no Path] -> []
[Cantwin] -> []
(moves)
(forward move)
right [right Player|no Wall no Cantmove] -> [PathR|PathL Player]
right [no Wall no Cantmove|left Player] -> [Player PathR|PathL]
down [down Player|no Wall no Cantmove] -> [PathD|PathU Player]
down [no Wall no Cantmove|up Player] -> [Player PathD|PathU]
(backwards undo moves)
right [> Player PathR | PathL ] -> [|Player]
down [> Player PathD | PathU ] -> [|Player]
left [> Player PathL | PathR ] -> [|Player]
up [> Player PathU | PathD ] -> [|Player]
(check win conditions)
[Player] [CornerWonrg] -> [Player CantWin] [CornerWonrg]
[Player] [HouseNeut] -> [Player CantWin] [HouseNeut]
[Player] [HouseWonrg] -> [Player CantWin] [HouseWonrg]
[> Player no CantWin|Startpos] -> Win
(VERY IMPORTANT)
[> Player] -> [Player]
(game complete)
[Path] -> [Path Cantmove]
[Startpos] -> [Win1 Startpos]
late [Win1] [Wonrg] -> [] [Wonrg]
late [Win1 Cantmove] -> [Win1]
(paths)
(straight)
late [PathL PathR] -> [PathL PathR Straight]
late [PathU PathD] -> [PathU PathD Straight]
(corner)
late [PathL PathU] -> [PathL PathU Corner]
late [PathU PathR] -> [PathU PathR Corner]
late [PathR PathD] -> [PathR PathD Corner]
late [PathD PathL] -> [PathD PathL Corner]
(can't turn on empty)
late [Corner no House no Intersect] -> [Corner CornerWonrg]
[CornerWonrg no Corner] -> []
(turning)
late [Corner HouseNeut] -> [Corner HouseRight]
late [Straight HouseNeut] -> [Straight HouseWonrg]
[HouseRight no Corner] -> [HouseNeut]
[HouseWonrg] -> [HouseNeut]
==============
WINCONDITIONS
==============
=======
LEVELS
=======
message Build a road that turns at every houses, then return to his original position, forming a loop.
++..+.+o+
.........
.o.+o....
....+.o++
.p.####..
...####..
.+.....o+
...+.o..+
+..+.+...
message You are hired !
message -- Made for The CONFOUNDING Calendar --
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment