Created
December 15, 2018 22:38
-
-
Save desplesda/59d5a93f71127ed9be29078804c83a4f to your computer and use it in GitHub Desktop.
Button Squid (PuzzleScript Script)
This file contains 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 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 Button Squid | |
author Jon Manning | |
homepage www.puzzlescript.net | |
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 | |
BombPendingDetonation | |
black pink | |
0.0.0 | |
.000. | |
00100 | |
.000. | |
0.0.0 | |
Absorber | |
green lightgreen | |
..... | |
..... | |
01110 | |
01110 | |
.000. | |
Explosion | |
yellow | |
000.0 | |
0.00. | |
00000 | |
.00.0 | |
00.00 | |
SecondaryExplosion | |
brown | |
0.0.0 | |
0..0. | |
.0000 | |
00.0. | |
.0..0 | |
======= | |
LEGEND | |
======= | |
( Placeable objects ) | |
. = Background | |
# = Wall | |
P = Player | |
* = Coin | |
B = PushBlock | |
U = MoveUp | |
D = MoveDown | |
L = MoveLeft | |
R = MoveRight | |
X = Bomb | |
E = Exit | |
A = Absorber | |
(Categories) | |
MoveBlock = MoveUp or MoveDown or MoveLeft or MoveRight | |
MovableBlock = PushBlock or MoveBlock | |
AnyBlock = MovableBlock or Bomb or Absorber or BombPendingDetonation | |
AnyMovable = MovableBlock or Player | |
Damage = Explosion or SecondaryExplosion | |
AnyDestroyable = Player or AnyMovable | |
======= | |
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 ) | |
[ MoveUp ] -> [UP MoveUp ] again | |
[ MoveDown ] -> [DOWN MoveDown ] again | |
[ MoveLeft ] -> [LEFT MoveLeft ] again | |
[ 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 ] | |
( Bombs explode when affected by an explosion ) | |
late [ Bomb Damage ] -> [ BombPendingDetonation ] again | |
[BombPendingDetonation] -> [Explosion] | |
( If, at the end of a turn, an explosion overlaps an object | |
that can be destroyed, that object is destroyed ) | |
late [ AnyDestroyable Damage ] -> [ Damage ] | |
( Explosions create secondary explosions next to them ) | |
[ | Explosion ] -> [ SecondaryExplosion | Explosion ] again | |
( At the end of a turn, 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 | |
( Anything entering an Absorber is destroyed ) | |
[ > AnyMovable | Absorber ] -> [ | Absorber ] | |
============== | |
WINCONDITIONS | |
============== | |
No Coin | |
Some Player On Exit | |
No DestroyedCoin | |
======= | |
LEVELS | |
======= | |
( Intro to moving ) | |
##### | |
#e#p# | |
#.#.# | |
#*.*# | |
##### | |
( Intro to pushables ) | |
###### | |
#..#.# | |
#.b*.# | |
#..#.# | |
#p.#e# | |
###### | |
( Intro to bombs ) | |
...### | |
...#*. | |
.b.x.* | |
...b*. | |
p..#.e | |
...### | |
( Intro to movables ) | |
#.*xb.. | |
....#.e | |
.p#.### | |
..u*### | |
#...### | |
( Chainable bombs ) | |
##.*.p.** | |
.......** | |
rb...x.## | |
.....xxx. | |
##.*...#e | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment