Skip to content

Instantly share code, notes, and snippets.

@sfiera
Last active June 30, 2021 06:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sfiera/344552b9b5d24d3f5142ca13bd6369e9 to your computer and use it in GitHub Desktop.
Save sfiera/344552b9b5d24d3f5142ca13bd6369e9 to your computer and use it in GitHub Desktop.
(Written for the Thinky Puzzle Game Jam (June 2021)
https://itch.io/jam/thinky-puzzle-game-jam
This work is licensed under CC-BY-SA 4.0:
https://creativecommons.org/licenses/by-sa/4.0/)
title A Room for Elephant
author sfiera
homepage sfiera.net
key_repeat_interval 0.15
again_interval 0.1
norepeat_action
run_rules_on_level_start
background_color lightgray
text_color black
========
OBJECTS
========
Background .
LightBlue
Wallpaper
Blue Yellow
00100
01000
10000
00001
00010
Ground -
Green
HeadLowL
Gray Black
....0
...00
...00
...01
...00
HeadLowR \
Gray Black
0....
00...
00...
10...
00...
HeadMidR
Gray Black
00000
00000
.....
.....
.....
HeadMidL
Gray Black
00000
00000
.....
.....
.....
HeadHighR
Gray Black
00000
10000
00...
00...
00...
HeadHighL
Gray Black
00000
00001
...00
...00
...00
BackR {
Gray
BackL
Gray
TailL
Gray
0000.
00000
00000
00000
00000
TailR /
Gray
.0000
00000
00000
00000
00000
TrunkLowL
Gray
...00
...00
...00
00000
00000
TrunkLowR L
Gray
00...
00...
00...
00000
00000
TrunkMidL
Gray Black
....0
...00
00.00
00.01
00.00
TrunkMidR
Gray Black
0....
00...
00.00
10.00
00.00
TrunkHighL
Gray Black
00...
00...
00...
00...
00...
TrunkHighR
Gray Black
...00
...00
...00
...00
...00
LegL
Gray DarkGray
00000
00000
00000
.1100
.1100
LegR H
Gray DarkGray
00000
00000
00000
0011.
0011.
RedBox R
LightRed Red DarkRed
00000
01112
01112
01112
22222
OrangeBox O
Yellow Orange Brown
00000
01112
01112
01112
22222
YellowBox Y
White Yellow Orange
00000
01112
01112
01112
22222
GreenBox G
LightGreen Green DarkGreen
00000
01112
01112
01112
22222
BlueBox B
#0cf #079 #023
00000
01112
01112
01112
22222
IndigoBox I
Blue DarkBlue Black
00000
01112
01112
01112
22222
PurpleBox P
Pink Purple Black
00000
01112
01112
01112
22222
Falling
Transparent
Lit
Transparent
LitH
Transparent
LitV
Transparent
Win
Transparent
=======
LEGEND
=======
TrunkLow = TrunkLowR or TrunkLowL
TrunkMid = TrunkMidR or TrunkMidL
TrunkHigh = TrunkHighR or TrunkHighL
TrunkR = TrunkLowR or TrunkMidR or TrunkHighR
TrunkL = TrunkLowL or TrunkMidL or TrunkHighL
Trunk = TrunkLow or TrunkMid or TrunkHigh
HeadLow = HeadLowR or HeadLowL
HeadMid = HeadMidR or HeadMidL
HeadHigh = HeadHighR or HeadHighL
Head = HeadLow or HeadMid or HeadHigh
Back = BackR or BackL
Tail = TailR or TailL
Leg = LegR or LegL
Elephant = Head or Back or Tail or Trunk or Leg
Player = Elephant
Box = R or O or Y or G or B or I or P
Opaque = Box or Ground
Darken = Opaque or Wallpaper
Lighting = Wallpaper or Lit or LitH or LitV
Solid = Player or Ground or Box
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Wallpaper
Lit
LitH
LitV
Ground
Box
Trunk
Head
Back
Leg
Tail
Falling
Win
======
RULES
======
(Flip a right-facing elephant to left-facing.)
right [||| action HeadLowR ] -> [HeadLowL |||]
right [||| action HeadMidR ] -> [HeadMidL |||]
right [||| action HeadHighR ] -> [HeadHighL |||]
right [||| action TrunkLowR ] -> [TrunkLowL |||]
right [||| action TrunkMidR ] -> [TrunkMidL |||]
right [||| action TrunkHighR ] -> [TrunkHighL |||]
right [|| action BackR |] -> [| BackL ||]
right [|action LegR | action LegR |] -> [| LegL | LegL|]
right [|action TailR ||] -> [|| TailL |]
(Flip a left-facing elephant to right-facing.)
left [||| action HeadLowL ] -> [HeadLowR |||]
left [||| action HeadMidL ] -> [HeadMidR |||]
left [||| action HeadHighL ] -> [HeadHighR |||]
left [||| action TrunkLowL ] -> [TrunkLowR |||]
left [||| action TrunkMidL ] -> [TrunkMidR |||]
left [||| action TrunkHighL ] -> [TrunkHighR |||]
left [|| action BackL |] -> [| BackR ||]
left [|action LegL | action LegL |] -> [| LegR | LegR|]
left [|action TailL ||] -> [|| TailR |]
(If any of the above caused overlap with a box, cancel.
This is easier than doing the checking beforehand.)
[Elephant Box] -> cancel
(Sorry, Dumbo.)
down [Leg | no Ground] -> cancel
(Remove vertical movement, except on the trunk.
The head will move later if necessary.
Limit motion to the three low/mid/hight levels.)
[vertical Elephant no Trunk] -> [Elephant]
up [> TrunkHigh] -> cancel
down [> TrunkLow] -> cancel
(Send falling boxes downward (only during again ticks).
Transmit pushes from the elephant or one box to another.
Move the object in front of the trunk together with it.
Keep solid objects of one color together.)
[Falling Box] -> [down Box]
startloop
[> Solid | Box] -> [> Solid | > Box]
right [up TrunkR | Box] -> [up TrunkR | up Box]
right [horizontal TrunkR | Box] -> [horizontal TrunkR | horizontal Box]
left [up TrunkL | Box] -> [up TrunkL | up Box]
left [horizontal TrunkL | Box] -> [horizontal TrunkL | horizontal Box]
[moving R | R] -> [moving R | moving R]
[moving O | O] -> [moving O | moving O]
[moving Y | Y] -> [moving Y | moving Y]
[moving G | G] -> [moving G | moving G]
[moving B | B] -> [moving B | moving B]
[moving I | I] -> [moving I | moving I]
[moving P | P] -> [moving P | moving P]
endloop
(Change up the trunk/head appropriately for the movement)
up [> TrunkLowR | HeadLowR] -> [HeadMidR | TrunkMidR]
up [> TrunkLowL | HeadLowL] -> [HeadMidL | TrunkMidL]
up [HeadMidR | > TrunkMidR] -> [> HeadHighR | > TrunkHighR]
up [HeadMidL | > TrunkMidL] -> [> HeadHighL | > TrunkHighL]
down [> TrunkMidR | HeadMidR] -> [HeadLowR | TrunkLowR]
down [> TrunkMidL | HeadMidL] -> [HeadLowL | TrunkLowL]
down [> TrunkHighR | HeadHighR] -> [> TrunkMidR | > HeadMidR]
down [> TrunkHighL | HeadHighL] -> [> TrunkMidL | > HeadMidL]
(Move objects manually.
Solid objects are actually on different layers,
so standard PuzzleScript movement won’t work right.)
[> Solid | no Solid] -> [| Solid]
[> Solid] -> cancel
(Start boxes falling if they aren’t supported.)
late [Box] -> [Falling Box]
startloop
late down [Falling Box | no Falling Solid] -> [Box | Solid]
late [Falling Box | Trunk] -> [Box | Trunk]
late [Falling R | no Falling R] -> [R | R]
late [Falling O | no Falling O] -> [O | O]
late [Falling Y | no Falling Y] -> [Y | Y]
late [Falling G | no Falling G] -> [G | G]
late [Falling B | no Falling B] -> [B | B]
late [Falling I | no Falling I] -> [I | I]
late [Falling P | no Falling P] -> [P | P]
endloop
late [Falling] -> again
(Put wallpaper on a closed loop.)
late [Lighting] -> []
late down [Darken | no Opaque] -> [Darken | Wallpaper]
late [no Wallpaper no Opaque] -> [Lit]
startloop
late [Lit | Wallpaper] -> [Lit | Lit]
late vertical [Lit | Opaque] -> [Lit | LitV Opaque]
late horizontal [Lit | Opaque] -> [Lit | LitH Opaque]
late vertical [LitH | Wallpaper] -> [LitH | Lit]
late horizontal [LitV | Wallpaper] -> [LitV | Lit]
endloop
late random [no Win Elephant Wallpaper] -> [Win Elephant Wallpaper] again
==============
WINCONDITIONS
==============
all Elephant on Win
no Falling
=======
LEVELS
=======
(All levels are 15x10. Seems big enough.)
message Every elephant needs a room.
message But sometimes an elephant needs to build its own.
message 1 of 10
...............
.RRRRRRRRRRRRR.
.R...........R.
.R.............
.R........G....
.R........G....
..........G....
....../{\......
......HHL......
---------------
message 2 of 10
...............
.....RRRRRR....
....RR....RR...
....R..........
....R......O...
....R.....G....
..........G....
....../{\......
......HHL......
---------------
message 3 of 10
...............
...............
....BBBBBBBB...
...............
...........O...
.........RG....
.........RG....
...../{\.R.....
.....HHL.......
---------------
message 4 of 10
...............
...............
....BBBBB......
....B...B......
...............
..........G....
..........GR...
...../{\...R...
.....HHL.......
---------------
message Press X to turn (if you have space)
message 5 of 10
...............
...............
....OOOOOOO....
.P..O.....O....
.P..........Y..
.P..........Y..
............Y..
....../{\......
......HHL......
---------------
message 6 of 10
...............
...............
.....O...G.....
...............
....BBB.PPP....
....B.....P....
...............
....../{\......
......HHL......
---------------
message 7 of 10
...............
..........I....
...RRR...III...
....R..........
...............
...O.B...Y.G...
...............
....../{\......
......HHL......
---------------
message 8 of 10
...............
...............
...............
...............
...R......OOO..
...RB..........
....B..........
....../{\.III..
......HHL......
---------------
message 9 of 10
...............
...............
...............
..........G....
...YY.....G....
..R........I...
..R.......III..
....../{\...I..
......HHL......
---------------
message 10 of 10
...............
.......G.......
...RR..G..BB...
...............
...OO.....II...
...............
...............
....Y./{\.P....
......HHL......
---------------
message Thanks for playing!
(
...............
...............
.GGGRRYYYIIIII.
.G.R.RY.YI.I.I.
.G.RRRYYYI.I.I.
.....PPPPP.....
...............
...../{\.......
.....HHL.......
---------------
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment