Skip to content

Instantly share code, notes, and snippets.

@desplesda
Created December 15, 2018 06:07
Show Gist options
  • Save desplesda/83e774982f5248429c7d710c5c70eb59 to your computer and use it in GitHub Desktop.
Save desplesda/83e774982f5248429c7d710c5c70eb59 to your computer and use it in GitHub Desktop.
Button Squid (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Button Squid
author Jon Manning
homepage www.puzzlescript.net
debug
again_interval 0.1
run_rules_on_level_start
========
OBJECTS
========
Background
blue
(Background
LIGHTGREEN GREEN
11111
01111
11101
11111
10111)
Wall
darkgreen darkblue
01001
00100
00000
10101
01000
(Wall
BROWN DARKBROWN
00010
11111
01000
11111
00010)
Player
green lightblue
.000.
.101.
.000.
00000
0.0.0
(Player
Black Orange White Blue
.000.
.111.
22222
.333.
.3.3.)
Coin
pink
.000.
000.0
00.00
0.000
.000.
DestroyedCoin
brown
.0.0.
0...0
.....
....0
..00.
PushBlock
darkblue lightblue
.000.
01110
01110
01110
.000.
MoveUp
purple pink
..0..
.010.
00000
..0..
.....
MoveDown
purple pink
.....
..0..
00000
.010.
..0..
MoveLeft
purple pink
..0..
.00..
0100.
.00..
..0..
MoveRight
purple pink
..0..
..00.
.0010
..00.
..0..
Exit
darkgreen lightgreen
.000.
00000
00100
00000
.000.
Bomb
black red
0.0.0
.000.
00100
.000.
0.0.0
Explosion
yellow
000.0
0.00.
00000
.00.0
00.00
SecondaryExplosion
brown
0.0.0
0..0.
.0000
00.0.
.0..0
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Coin
MoveBlock = MoveUp or MoveDown or MoveLeft or MoveRight
MovableBlock = PushBlock or MoveBlock
AnyBlock = MovableBlock or Bomb
AnyMovable = MovableBlock or Player
Damage = Explosion or SecondaryExplosion
B = PushBlock
U = MoveUp
D = MoveDown
L = MoveLeft
R = MoveRight
X = Bomb
E = Exit
=======
SOUNDS
=======
Player Move 38565907
sfx0 4917100 (Collect coin - we do it manually because we only want to play it when the player collects them)
Explosion create 18649102
DestroyedCoin create 54605908
sfx1 11158101 (Player pushed object)
EndLevel 123413
================
COLLISIONLAYERS
================
Background
DestroyedCoin
Exit, Explosion, SecondaryExplosion
Player, Wall, AnyBlock, Coin
======
RULES
======
( Players can collect coins )
[> Player | Coin ] -> [ | Player] sfx0 (play collect sound)
( Moving blocks continuously move until they hit something )
UP [ MoveUp | ] -> [UP MoveUp | ] again
DOWN [ MoveDown | ] -> [DOWN MoveDown | ] again
left [ MoveLeft | ] -> [left MoveLeft | ] again
right [ MoveRight | ] -> [right MoveRight | ] again
( Players can't push against a moving block in that block's travel direction)
DOWN [Down player | MoveUp] -> cancel
up [up player | MoveDown] -> cancel
left [left player | MoveRight] -> cancel
right [right player | MoveLeft] -> cancel
( Players can push blocks )
[> Player | MovableBlock ] -> [ Player | > MovableBlock ] sfx1
( Secondary explosions dissipate )
[ SecondaryExplosion ] -> []
( If an explosion overlaps a coin, that coin is destroyed.
We special case coin destruction to produce DestroyedCoins,
so that we can prevent a win condition if any coins are destroyed. )
late [ Coin Damage ] -> [ DestroyedCoin Damage ]
( If an explosion overlaps an object, that object is destroyed )
late [ AnyBlock Damage ] -> [ Damage ]
( Explosions create secondary explosions next to them )
[ | Explosion ] -> [ SecondaryExplosion | Explosion ] again
( Explosions turn into secondary explosions if there's a secondary explosion next to them )
late [ SecondaryExplosion | Explosion ] -> [SecondaryExplosion | SecondaryExplosion ] again
( Anything that enters a bomb causes it to detonate )
[ > AnyMovable | Bomb ] -> [ | Explosion ] again
==============
WINCONDITIONS
==============
No Coin
Some Player On Exit
No DestroyedCoin
=======
LEVELS
=======
#####
#e#p#
#.#.#
#*.*#
#####
######
#..#.#
#.b*.#
#..#.#
#p.#e#
######
...#..
...#..
.b.x..
...b*.
p..#.e
...#..
#.*xb..
....#.e
.p#.###
..u*###
#...###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment