Skip to content

Instantly share code, notes, and snippets.

@ncrecc
Created September 24, 2019 01:35
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 ncrecc/b6aff9be5aec17ac631bb2ed19fcc476 to your computer and use it in GitHub Desktop.
Save ncrecc/b6aff9be5aec17ac631bb2ed19fcc476 to your computer and use it in GitHub Desktop.
What Gophers Eat (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
(M: I have a lust for puns and portmanteus, and so I propose changing the name to "What Gophers Go For", but I think that'd be in violation of the rules)
(ncrecc agrees with this proposal, if that means anything)
title What Gophers Eat
background_color darkbrown
again_interval .09
run_rules_on_level_start
noaction
verbose_logging
(=== log book entry #1023
- find and replace 'brown' -> 'gopher', background is darkbrown now
- renamed Yellow to Pellet
- renamed Green to SlidePellet, gave it a more distinct shape to help with differentiation
- created blocking pellets (BlockPellet and BlockSlidePellet)
- added visual feedback for when you can't do a thing (like push a gopher into a wall) and for when player is on top of pellets
- one (hopefully) difficult level, sorry only one level allowed so no room for tutorialization :D
===)
(uh, i guess this deserves a logbook entry sorta thing?)
(i added one mechanic that branches into some really cool stuff that's a logical extension of that mechanic: a gopher that can split into two other particular gophers under certain circumstances. for the sake of avoiding spoilers i won't detail it here, scroll down to the bottom of the rules section to read more. -ncr)
========
OBJECTS
========
(Historical note: In prehistoric times, gophers were called 'browns'. Most records of that circumstance have disappeared.)
(Gophers prefer to walk on sky blue surfaces. It is known.)
Background
#68b6ff
Nothing
darkbrown
(What do Browns look like? Everyone knows they look like this:)
Gopher_r
brown white black
02020
00000
0.1.1
0....
00000
Gopher_l
brown white black
02020
00000
1.1.0
....0
00000
(What does Gopher food look like? Something like this:)
Pellet
#C7E23C #B9C42D #A9A722 #978B18
.323.
32123
21012
32123
.323.
SlidePellet
#7bbf4b #5a992c #6cc42d
..1..
.101.
10201
.101.
..1..
BlockPellet
#5F78EF #4488B5 #3A85CB #4381DF
.323.
32123
21212
32123
.323.
BlockSlidePellet
#5F78EF #4488B5 #3A85CB #4381DF
..2..
.212.
21312
.212.
..2..
(Gopher keepers look something like this:)
PlayerNormal
blue #202080
.000.
01010
01010
00000
.000.
(These two are visual feedback for when player is on a pellet)
PlayerPellet
blue #B9C42D
.000.
01010
01010
00000
.000.
PlayerSlide
blue #6cc42d
.000.
01010
01010
00000
.000.
(Even a gopher keeper who says his prayers at night...)
PlayerGopherRight
brown blue white
.000.
01010
00000
0.2.2
.000.
PlayerGopherLeft
brown blue white
.000.
01010
00000
2.2.0
.000.
(This game is disturbing.)
MatableGopherRight
brown black white
00000
01010
00000
0.2.2
00000
MatableGopherLeft
brown black white
00000
01010
00000
2.2.0
00000
Wall
gray #909080
00001
01000
00010
10000
00100
Pit
#464038 #413735 #303030
00000
01110
01210
01110
00000
(Unusually dark and well-lit areas of the floor)
Shadow
#99cbd3 #88bac3
10101
01010
11111
10101
01010
Light
#b1ddd6 #c1fdff
10110
01101
10110
01101
10110
(If a Brown must plummet to its doom, let it be pleasingly animated as follows:)
FallingGopher1
#7D5936
.....
.000.
.0...
.000.
.....
FallingGopher2
#5F4C3B
.....
.....
..0..
.....
.....
(Also players can walk into a hole while there's multiple of them in a level. When you're a hivemind commanding multiple members, you can risk losing a few.)
(feel free to adjust the colors on these sprites!)
FallingPlayer1
#202080
.....
..0..
.000.
..0..
.....
FallingPlayer2
#101040
.....
.....
..0..
.....
.....
(explosions aren't used!)
Explosion_base
red
Explosion_v
orange
Explosion_h
#ff3d0c
(sliders make gophers slide after eating green pellets)
slider_R
transparent
slider_L
transparent
slider_U
transparent
slider_D
transparent
(visual feedback for things that aren't happening)
CantGoP
red
.0.0.
0...0
.....
0...0
.0.0.
CantGoS
red
..0..
.....
0...0
.....
..0..
cantgoph
brown red
10.01
.....
.....
.....
.....
cantgoph_m
brown red
.....
10.01
.....
.....
.....
(humm, maybe introduce cantgo eyes for player groundskeeper, and let player gopher use cantgoph_m?)
match_H
transparent
match_V
transparent
=======
LEGEND
=======
. = Background
# = wall
P = PlayerNormal
ꟼ = PlayerGopherRight
Ѻ = Gopher_l and Light
Ѽ = Gopher_r and Shadow
b = Gopher_l
y = Pellet
g = SlidePellet
ƃ = SlidePellet and Light
q = SlidePellet and Shadow
u = BlockSlidePellet
l = BlockPellet
Pellets = Pellet or SlidePellet or BlockPellet or BlockSlidePellet
SlidePellets = SlidePellet or BlockSlidePellet
Blocks = BlockPellet or BlockSlidePellet
~ = Pit
_ = nothing
+ = Shadow
- = Light
> = MatableGopherLeft
slider = slider_R or slider_L or slider_U or slider_D
match = match_H or match_V
PlayerGopher = PlayerGopherRight or PlayerGopherLeft
MatableGopher = MatableGopherRight or MatableGopherLeft
Gopher_ = Gopher_r or Gopher_l
Gopher = Gopher_ or PlayerGopher or MatableGopher
explosion = Explosion_base or Explosion_v or Explosion_h
PlayerFeedback = PlayerPellet or PlayerSlide
Player = PlayerNormal or PlayerGopher
cantGo = cantGoP or cantGoS or cantGoph or cantgoph_m
anim = FallingGopher1 or FallingGopher2 or FallingPlayer1 or FallingPlayer2
=======
SOUNDS
=======
(Added some sounds, feel free to change any of them)
startgame 70718308
restart 29315708
showmessage 85829508
undo 95809908
Player move 18310708
Player cantmove 21633704
FallingGopher1 create 78319708
(PlayerGopher create)
sfx0 13543108
(PlayerNormal create)
sfx1 62333108
pellet destroy 2074901
SlidePellet destroy 28507301
(gopher creation)
sfx2 4744309
(playergopher creation)
sfx3 81672909
================
COLLISIONLAYERS
================
Background
Nothing, Shadow, Light
Pellet, SlidePellets, BlockPellet, Pit
Player, Gopher, wall, FallingGopher1, FallingGopher2, explosion, FallingPlayer1, FallingPlayer2
PlayerFeedback, CantGo
slider, match
======
RULES
======
(visual feedback and animation clear)
[ PlayerFeedback ] -> [ ]
[ > Player ] [ CantGo ] -> [ > Player ] [ ]
(player eye color adapts to pellet color below it)
late [ PlayerNormal Pellet ] -> [ PlayerPellet PlayerNormal Pellet ]
late [ PlayerNormal SlidePellet ] -> [ PlayerSlide PlayerNormal SlidePellet ]
(Player pushes Gopher)
[ > Player | Gopher ] -> [ > Player | > Gopher ]
(Player can't walk into pits, unless there are multiple)
random [> Player|Pit] -> [action Background > Player|Pit]
[> Player action Background|Pit] [stationary Background Player] -> [> Background > Player|Pit] [Background Player]
[> Player action Background|Pit] -> [Player Background|Pit]
[Background] -> [stationary Background]
(Gophers that aren't sliding fall into pits)
[ FallingGopher2 Pit ] -> [ Pit ] again
[ FallingGopher1 Pit ] -> [ FallingGopher2 Pit ] again
[ Gopher no Slider Pit ] -> [ FallingGopher1 Pit ] again
late [ Gopher no Slider Pit ] -> [ Gopher Pit ] again
(as do players)
[FallingPlayer2 Pit] -> [Pit] again
[FallingPlayer1 Pit] -> [FallingPlayer2 Pit] again
[Player no Gopher Pit] -> [FallingPlayer1 Pit] again
late [Player no Gopher Pit] -> again
(initiate movement from any existing slider)
[ Gopher slider_R ] -> [ right Gopher right slider_R ]
[ Gopher slider_L ] -> [ left Gopher left slider_L ]
[ Gopher slider_U ] -> [ up Gopher up slider_U ]
[ Gopher slider_D ] -> [ down Gopher down slider_D ]
(Player can't walk into Block pellets)
[ > PlayerNormal | BlockPellet ] -> [ PlayerNormal | BlockPellet CantGoP ] again
[ > PlayerNormal | BlockSlidePellet ] -> [ PlayerNormal | BlockSlidePellet CantGoS ] again
(Gophers get blocked by walls and other gophers)
[ > Gopher_ no slider | Wall ] -> [ Gopher_ cantGoph | Wall ] again
[ > Gopher_ no slider | Gopher ] -> [ Gopher_ CantGoph | Gopher ] again
[ > MatableGopher no slider | Wall ] -> [ MatableGopher cantGoph_M | Wall ] again
[ > MatableGopher no slider | Gopher ] -> [ MatableGopher cantGoph_M | Gopher ] again
(create a slider based on the direction that a Gopher approaches a SlidePellet)
right [ right Gopher | SlidePellets ] -> [ right Gopher | slider_R ]
left [ left Gopher | SlidePellets ] -> [ left Gopher | slider_L ]
down [ down Gopher | SlidePellets ] -> [ down Gopher | slider_D ]
up [ up Gopher | SlidePellets ] -> [ up Gopher | slider_U ]
(destroy the slider when a Gopher collides with another Gopher)
[ > Gopher Slider | Gopher ] -> [ Gopher | Gopher ]
(Eat the delicious Pellet - NOM!)
(and clear any sliders when Gopher reaches a Pellet)
late [ Gopher Pellets ] -> [ Gopher no slider ]
(run another turn when we still have a Gopher on a slider, otherwise clear the slider)
late [ Gopher Slider ] -> again
late [ Slider no Gopher ] -> [ ]
(select rows of three Gophers)
horizontal [ Gopher | Gopher | Gopher ] -> [ action Gopher | action Gopher match_H | action Gopher ]
vertical [ Gopher | Gopher | Gopher ] -> [ action Gopher | action Gopher match_V | action Gopher ]
(mark mating)
[Background action MatableGopher|action PlayerGopher] -> [left Background action MatableGopher|action PlayerGopher]
[Background action PlayerGopher|Background action PlayerGopher] -> [left Background action PlayerGopher|left Background action PlayerGopher]
[action Gopher_|left Background action PlayerGopher] -> [action Background action Gopher_|action Background action PlayerGopher]
(remove selected Gophers)
[ stationary Background action MatableGopher ] -> [ action Background ]
[ action Gopher] -> [ no Cantgoph no cantgoph_m ]
(add the results of matches)
horizontal [|left Background match_V|] -> [PlayerGopherLeft|Background|PlayerGopherRight] sfx3
vertical [|left Background match_H|] -> [PlayerGopherLeft|Background|PlayerGopherRight] sfx3
horizontal [|action Background match_v|] -> [MatableGopherLeft|Background|MatableGopherRight] sfx2
vertical [|action Background match_h|] -> [MatableGopherLeft|Background|MatableGopherRight] sfx2
horizontal [ | match_V | ] -> [ Gopher_l | | Gopher_r ] sfx2
vertical [ | match_H | ] -> [ Gopher_l || Gopher_r ] sfx2
(run another turn while three Gophers are in a row)
late [ Gopher | Gopher | Gopher ] -> again
(a terrifying transformation)
late [ PlayerGopher Light no slider ] -> [ PlayerNormal Light ] again sfx1
late [ PlayerNormal Shadow no slider ] -> [ PlayerGopherRight Shadow ]again sfx0
(Based on the direction of a Gopher object, make it face right or left)
[ right Gopher_l ] -> [ right Gopher_r ]
[ left Gopher_r ] -> [ left Gopher_l ]
(same goes for direction of gopherized player)
[right PlayerGopherLeft] -> [right PlayerGopherRight]
[left PlayerGopherRight] -> [left PlayerGopherLeft]
(and matable gopher)
[right MatableGopherLeft] -> [right MatableGopherRight]
[left MatableGopherRight] -> [left MatableGopherLeft]
(dunno where i should put this, here's a summary of how multiplayer works:)
(this all stems off a gopher type known as "matablegopher")
(match 3'ing a matablegopher normally causes it to split into two matablegophers...)
(but match3'ing a matablegopher you're adjacent to causes it to split into two playergophers!)
(while there are multiple players on the screen, no players are protected from walking into a hole)
(match3'ing a playergopher between a regular gopher and a matable gopher, or between a regular gopher and another playergopher, gives you a matable gopher)
(this might have more potential than i'd expected! or maybe less...)
==============
WINCONDITIONS
==============
No Pellet
No SlidePellets
No BlockPellet
no slider
no Gopher on Pit
no Player on Pit
no Anim
No explosion
=======
LEVELS
=======
(ncr: i was only able to complete, like, half of these levels... difficulty ramps up quickly!)
message What with the state of the world I decided I needed a change...
message So I became a gopher keeper...
message ...but it's harder than I expected!
#######
#p....#
#.b...#
#..yy##
#..yy#_
#..###_
####___
message Gophers, it turns out, eat a varied and sometimes slippery diet!
#########
#.......#
#.b.g.y.#
#..g.g..#
#.p.g.y.#
#y.y.#.##
########_
##########
#........#
#.g......#
#....P.g.#
#..b.....#
#...b....#
#.....g..#
#........#
##########
_#####__
_#y..##_
_#b...##
_#..g..#
_#..g..#
_#..ybp#
##g.g..#
#yg.g..#
##g....#
_#.....#
_#######
message I read somewhere that it's a very bad idea to make three gophers in a line.
__########__
_##......##_
##........##
#..g....g..#
#.....p....#
#....b.....#
#..g....g..#
#..........#
##........##
_###ybby###_
___######___
(ncr: ohh, sneaky. sort of out-of-nowhere introduction to match 4 but i can live with it)
___#########___
___#..~y~..#___
####..b~b..####
#......g......#
#y...........y#
##b#...b...#b##
#y.g..bpb.g~.y#
##b#...b...#b##
#y.....g.....y#
#.....#~#.....#
####..byb..####
___#..#~#..#___
___#########___
(M: I was stuck on this one below forever, I honestly have no idea how to do this, I just gave up )
##############
#.......~~...#
#.bgggb.~~...#
#..gbg.P~~.yy#
#.bgggb.~~...#
#.......~~...#
##############
(Hmm, this next one is kind of dirty, but I'm not sure if I'm allowed to change it...)
(M: I actually could finish this one, even with the "one weird trick")
############
#.......##y#
#p.b..b.##.#
#....b..##.#
###bb#######
######______
#y..#_______
#...#_______
#...#_______
#..b#_______
#####_______
(M:One below took forever, and I'm not sure it feels very clean, it's kinda like you just have to try all the possibilities)
___############_
####y.........#_
#......p....#.#_
#g..####.##.y.#_
#.#.b.b...##.##_
#...b.b...#..##_
##.##.##..g...#_
#.........#..##_
#............#__
##############__
_###############
##....#.......y#
#....b#....b#.##
#.p.b.~..gb.##y#
#....b#....b#.##
##....#.......y#
_###############
message A gopher bit me! Hopefully this won't cause any... long-term issues.
#############
#-----.+++++#
#-----#+++++#
#.p...#.....#
#.....##g#y##
#.b.y.#.....#
#~~~~~~~~~~~#
#.y.b.......#
#############
(M: I'm almost certain the following is impossible, due to the green pellet up top, I ran marcosd's autosolver and it crashed before finding one solution, so I'd be surprised if I was wrong)
_______######__
########~~~~###
#~~~~~~~~g.~~~#
#~....+-..g..~#
#~....+-.g.g.~#
#~gggb#~gbpbg~#
#~....+-.g.g.~#
#~....+-..g..~#
#~~~~~~~~..~~~#
########~~~~###
_______######__
( I apologise in advance. But being a gopher keeper is supposed to be *hard*, after all... anyways re: the tutorial comment for the level after this one, is this a good enough tutorial? :P)
############
#####yy#####
############
############
############
############
#b########b#
#.b######b.#
#..b####b..#
#.b.b##b.b.#
#..b....b..#
#.b.buub.b.#
#..buuuub..#
#....p.....#
############
(made the block mechanic and several levels to go with it. decided for a challenging level instead of tutorializazion, so perhaps someone can make a nice n' easy level with both blue pegs)
message I have unwillingly become one of them! But who will herd us now?
(block hurl bridge)
___###___________
####y#__###______
#...~##_#y#______
#..--y###~#######
###--..~g..u..g.#
_##-~#-~.....b..#
_#..g~l~+++##..##
_#..g~.#+++~-g##_
_#..g~.~+b..l~y#_
_##..-g~.gbbg###_
_###.#~#....~#___
_#++l..-+.ꟼ~y#___
_#+++####..###___
_#####__####_____
(wow there is no way to predict the chain reactions, this is the most fiddly of all match3 levels. Also propably has several solutions?)
(ncr: player could just start as gopher here)
###########
#........y#
#b.bb.bb.b#
#.bb.bb.bb#
#b..b..b..#
#.bb.bb.bb#
#b.bb.bb.b#
#bb.bb.bb.#
#.........#
#.g.g.g.g.#
#.b.b.b.b.#
#....+....#
#####p#####
(This gag might be just gross? You can rewrite it)
message Aha, a like-minded individual who's not afraid to match with me!
message I've always wanted to have an ideal family.
~~~~~~~~~~~~~~~~~~~__
~#################~~~
~####.##.....#######~
~#ꟼ.>.b#..>..#######~
~####.##.....#.....#~
~####.##...#.#.....#~
~#....##.#.#.#######~
~#.>.##..####~#~..##~
~#...##..###~g~g..##~
~##.##...~##~g~g..##~
~#.......~###~#~..##~
~#######.~##~g~g..##~
~######..~##~g~g..##~
~~~#################~
__~~~~~~~~~~~~~~~~~~~
message How bizarre - I have no idea why my acquired instincts would lead me to toss myselves down those holes only to get some food pellets.
message Perhaps I and my brethern are not gophers, but lemmings!
message I should've known that job listing website was rubbish...
(lemmings don't actually toss themselves down holes. but hey, "common knowledge" tends to be common, and i kinda like this joke, so...)
(silly ending idea: playergopher eats so many pellets he finds himself unable to move of his own will, or stays as a gopher for so long his mind degrades to that of a regular gopher. then another gopher keeper comes by and pushes him (or, if the newly introduced mechanic stays relevant, one of him) into some food pellets, oblivious to their eventual fate...)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment