Skip to content

Instantly share code, notes, and snippets.

@thelast19digitsofpi
Created March 24, 2022 02:32
Show Gist options
  • Save thelast19digitsofpi/74800e822b2ab824004a6bf9c9618ff3 to your computer and use it in GitHub Desktop.
Save thelast19digitsofpi/74800e822b2ab824004a6bf9c9618ff3 to your computer and use it in GitHub Desktop.
Spaceship Collapse (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Spaceship Collapse
author thelast19digitsofpi
key_repeat_interval 0.13
norepeat_action
throttle_movement
realtime_interval 1.0
noundo
========
OBJECTS
========
Background
#333 #2c2c2c
00100
00100
11011
00100
00100
Ground
#333 #2c2c2c
00100
00100
11011
00100
00100
CursorStart
black
NoDebris
brown
Debris
#846 #775 #576 #678 #757 #777
.042.
3.11.
54430
5.24.
.30..
Wall
brown darkbrown
00010
11111
01000
11111
00010
EngineerNormal
#6c6 #00f
..0..
.000.
00100
.000.
..0..
EngineerInjured
#c76 #000 #6c6
..2..
.000.
20102
.000.
..2..
EngineerPassive
#686
..0..
.000.
00000
.000.
..0..
Cursor
white
00.00
0...0
.....
0...0
00.00
Hand
#444
NewDraw
black
ReceivingCard
black
CardGoesHere
black
CardHealth
#933
.....
00.00
.000.
0.0.0
.....
CardDraw
#3c3
.....
0.0.0
.000.
0.0.0
.....
CardClock
#33c
.....
00000
.0.0.
00000
.....
CardShield
#aa3
.....
00.00
..0..
00.00
.....
(Storage)
Storage
#656 #222
10101
00000
10001
00000
10101
StorageActive
#ccc #444
10101
00000
10001
00000
10101
(Main Systems)
HealthStation
#933 #eee
01110
10101
10001
11011
01110
HealthBroken
#600 black
.111.
10101
10001
11011
.111.
DrawStation
#3c3 #eee
01110
11011
10001
11011
01110
DrawBroken
#080 black
.111.
11011
10001
11011
.111.
ClockStation
#33c #eee
01110
10001
10101
10001
01110
ClockBroken
#009 black
.111.
10001
10101
10001
.111.
ShieldStation
#aa3 #eee
01110
10101
11011
10101
01110
ShieldBroken
#880 black
.111.
10101
11011
10101
.111.
ClockBarrierOpen
#33c
.....
.....
..0..
.....
.....
ClockBarrierClosed
#33c
.0.0.
0.0.0
.0.0.
0.0.0
.0.0.
ShieldBarrierOpen
#aa3
.....
.....
..0..
.....
.....
ShieldBarrierClosed
#aa3
.0.0.
0.0.0
.0.0.
0.0.0
.0.0.
HealthBarrierOpen
#933
.....
.....
..0..
.....
.....
HealthBarrierClosed
#933
.0.0.
0.0.0
.0.0.
0.0.0
.0.0.
(Clock Digits)
TensPlace
black
OnesPlace
black
Tick
black
Zero
black blue
00100
01010
01010
01010
00100
One
black blue
00100
01100
00100
00100
01110
Two
black blue
01100
00010
00100
01000
01110
Three
black blue
01100
00010
00100
00010
01100
Four
black blue
01010
01010
01110
00010
00010
Five
black blue
01110
01000
01100
00010
01100
Six
black blue
00110
01000
01100
01010
00100
Seven
black blue
01110
00010
00100
00100
00100
Eight
black blue
00100
01010
00100
01010
00100
Nine
black blue
00100
01010
00110
00010
01100
(Malfunctions!)
Malfunction
black
StationBreaker
black
(Fixing them!)
HealthScanner0
red
HealthScanner1
red
ClockScanner0
blue
ClockScanner1
blue
ClockScanner2
blue
ShieldScanner0
yellow
ShieldScanner1
yellow
ShieldScanner2
yellow
DrawScanner0
green
DrawScanner1
green
Discard
white
(Winning the game by surviving the onslaught!)
Progress
#3cc
ProgressBar
black
JumpDriveReady
#0ff
LaunchButtonBroken
#333 #666 #066 #266
01110
12121
12111
12331
01110
LaunchButton
#333 white #0ff #5ff
01110
12221
12231
12331
01110
(Visual shields!)
ShieldVisualH
#aa3 black
11111
00000
11111
00000
11111
ShieldVisualNE
#aa3 black
11111
00001
11101
00101
10101
ShieldVisualV
#aa3 black
10101
10101
10101
10101
10101
ShieldVisualSE
#aa3 black
10101
00101
11101
00001
11111
ShieldVisualSW
#aa3 black
10101
10100
10111
10000
11111
ShieldVisualNW
#aa3 black
11111
10000
10111
10100
10101
ShieldsAreDown
black
=======
LEGEND
=======
Engineer = EngineerNormal or EngineerInjured
Player = Cursor or Engineer
Card = CardHealth or CardShield or CardDraw or CardClock
CardPuttingIntoStorage = Card
BrokenStation = HealthBroken or DrawBroken or ClockBroken or ShieldBroken
Station = HealthStation or DrawStation or ClockStation or ShieldStation or BrokenStation
Digit = Zero or One or Two or Three or Four or Five or Six or Seven or Eight or Nine
(debris has a 1/10 chance of spawning right now)
MaybeDebris = One or Two or Three or Four or Five or Six or Seven or Eight or Nine or Debris
Scanner = HealthScanner0 or HealthScanner1 or ClockScanner0 or ClockScanner1 or ClockScanner2 or DrawScanner0 or DrawScanner1 or ShieldScanner0 or ShieldScanner1 or ShieldScanner2
ShieldVisual = ShieldVisualH or ShieldVisualNE or ShieldVisualV or ShieldVisualSE or ShieldVisualSW or ShieldVisualNW
. = Ground
# = Wall
P = EngineerNormal and Ground
$ = Storage
H = HealthStation
D = DrawStation
S = ShieldStation
C = ClockStation
z = LaunchButtonBroken
_ = Hand
- = Hand and CursorStart
+ = NewDraw
: = Two and TensPlace
; = Zero and OnesPlace
/ = ClockBarrierOpen
\ = ShieldBarrierOpen
' = HealthBarrierOpen
! = ProgressBar
n = ShieldVisualH
e = ShieldVisualV
` = ShieldVisualNW
* = ShieldVisualNE
, = ShieldVisualSW
" = ShieldVisualSE
=======
SOUNDS
=======
(Drawing a Card)
sfx0 93123703
(Next Malfunction)
sfx1 93933102
(Fixing a Malfunction)
sfx2 3706503
(Ticking when it's almost time to be done)
sfx3 27891508
(When you're ready to win)
sfx9 99775105
================
COLLISIONLAYERS
================
Background
Ground, Progress, ProgressBar, shieldvisual
ShieldsAreDown
JumpDriveReady
Malfunction
Tick
TensPlace, OnesPlace
CursorStart
Hand, NewDraw
ReceivingCard, CardGoesHere
NoDebris, StationBreaker
Engineer, Wall, Debris, EngineerPassive, Station, Storage, StorageActive, LaunchButtonBroken, LaunchButton
ShieldBarrierOpen, ShieldBarrierClosed, ClockBarrierOpen, ClockBarrierClosed, HealthBarrierOpen, HealthBarrierClosed
Scanner
Discard
Card
Cursor
Digit
======
RULES
======
(This has to be first, or else the player's movement may interfere)
[stationary Player] [OnesPlace] -> [stationary Player] [OnesPlace Tick]
(Cursor can't move into a wall)
[> Cursor | Wall] -> CANCEL
(Although bumping into debris ticks the timer)
[> Player | Debris] [OnesPlace] -> [Player | ] [OnesPlace Tick]
(by the way, you can clear debris with x)
[action Engineer | Debris] -> [action Engineer | ]
(and bumping into barriers does nothing)
[> Player | ShieldBarrierClosed] -> CANCEL
[> Player | ClockBarrierClosed] -> CANCEL
(Activating the draw pile)
[> Engineer | DrawStation] [NewDraw] [CursorStart] -> [EngineerPassive | DrawStation] [NewDraw ReceivingCard] [CursorStart Cursor]
[ReceivingCard] -> [random Card]
(Activating a storage deposit)
[> Engineer | Storage Card] [NewDraw] [CursorStart] -> [EngineerPassive | StorageActive] [NewDraw Card] [CursorStart Cursor]
(it might be empty)
[> Engineer | Storage] [CursorStart] -> [EngineerPassive | StorageActive] [CursorStart Cursor]
(Selecting your draw)
[action Cursor] -> [CardGoesHere]
(there may or may not be a card entering; there may or may not be a card leaving)
[CardGoesHere cardputtingintostorage] [NewDraw Card] [EngineerPassive] [StorageActive] -> [Card] [NewDraw] [EngineerNormal] [Storage cardputtingintostorage] sfx0
[CardGoesHere cardputtingintostorage] [NewDraw] [EngineerPassive] [StorageActive] -> [] [NewDraw] [EngineerNormal] [Storage cardputtingintostorage] sfx0
[CardGoesHere] [NewDraw Card] [EngineerPassive] [StorageActive] -> [Card] [NewDraw] [EngineerNormal] [Storage] sfx0
[CardGoesHere] [NewDraw] [EngineerPassive] [StorageActive] -> [] [NewDraw] [EngineerNormal] [Storage] sfx0
(if no storage is involved...)
[CardGoesHere] [NewDraw Card] [EngineerPassive] -> [Card] [NewDraw] [EngineerNormal] sfx0
(You can always fix the health system)
[> Engineer | HealthBroken] [CursorStart] -> [Engineer | HealthBroken] [CursorStart HealthScanner1]
(Others require you to be healthy)
[> EngineerNormal | ClockBroken] [CursorStart] -> [EngineerNormal | ClockBroken] [CursorStart ClockScanner2]
[> EngineerNormal | ShieldBroken] [CursorStart] -> [EngineerNormal | ShieldBroken] [CursorStart ShieldScanner2]
[> EngineerNormal | DrawBroken] [CursorStart] -> [EngineerNormal | DrawBroken] [CursorStart DrawScanner1]
(Checking if you actually fixed it)
[HealthScanner1 CardHealth no Discard] -> [HealthScanner0 CardHealth Discard]
+ [HealthScanner0 CardHealth no Discard] [HealthBroken] -> [CardHealth Discard] [HealthStation] sfx2
+ [DrawScanner1 CardDraw no Discard] -> [DrawScanner0 CardDraw Discard]
+ [DrawScanner0 CardDraw no Discard] [DrawBroken] -> [CardDraw Discard] [DrawStation] sfx2
+ [ShieldScanner2 CardShield no Discard] -> [ShieldScanner1 CardShield Discard]
+ [ShieldScanner1 CardShield no Discard] -> [ShieldScanner0 CardShield Discard]
+ [ShieldScanner0 CardShield no Discard] [ShieldBroken] -> [CardShield Discard] [ShieldStation] sfx2
+ [ClockScanner2 CardClock no Discard] -> [ClockScanner1 CardClock Discard]
+ [ClockScanner1 CardClock no Discard] -> [ClockScanner0 CardClock Discard]
+ [ClockScanner0 CardClock no Discard] [ClockBroken] -> [CardClock Discard] [ClockStation] sfx2
+ RIGHT [Scanner | ] -> [| Scanner]
+ [Scanner Wall] -> CANCEL
late [Card Discard] -> []
(Timer)
[Tick Nine] -> [Eight]
[Tick Eight] -> [Seven]
[Tick Seven] -> [Six]
[Tick Six] -> [Five]
[Tick Five] -> [Four]
[Zero | Tick Four] -> [Zero | Three] sfx3
[Tick Four] -> [Three]
[Zero | Tick Three] -> [Zero | Two] sfx3
[Tick Three] -> [Two]
[Zero | Tick Two] -> [Zero | One] sfx3
[Tick Two] -> [One]
[Zero | Tick One] -> [Zero | Zero] sfx3
[Tick One] -> [Zero]
(running out of time?)
[Three | Tick Zero] -> [Two | Nine]
[Two | Tick Zero] -> [One | Nine]
[One | Tick Zero] -> [Zero | Nine]
[Zero | Tick Zero] [ClockStation] -> [Three | Zero Malfunction] [ClockStation] sfx1
(if the clock station is broken you lose 10 seconds!)
[Zero | Tick Zero] [ClockBroken] -> [Two | Zero Malfunction] [ClockBroken] sfx1
(lost?)
[Malfunction] [ShieldBroken] [Player] -> [] [] [] message Your shields failed. You have been destroyed! Game over! (press R to restart)
(Malfunctions cause some problems)
[Malfunction] [Ground no Engineer no EngineerPassive no maybedebris] -> [Malfunction] [Ground random MaybeDebris]
(Malfunctions stop you from winning)
[Malfunction] [LaunchButton] -> [Malfunction] [LaunchButtonBroken]
(and also, more importantly, break the systems)
random [Malfunction] [Station] -> [Malfunction] [Station StationBreaker]
random [Malfunction] [Station] -> [Malfunction] [Station StationBreaker]
(Malfunctions move the game forward)
UP [Malfunction] [ProgressBar | no ProgressBar] -> [] [Progress | ]
[Malfunction] -> [] sfx9
[ShieldStation StationBreaker] -> [ShieldBroken]
(Clock malfunctions also steal 10 seconds)
[ClockStation StationBreaker] [TensPlace no Zero no One] -> [ClockBroken] [TensPlace Two]
[HealthStation StationBreaker] -> [HealthBroken]
[DrawStation StationBreaker] -> [DrawBroken]
[ClockStation] [ClockBarrierClosed] -> [ClockStation] [ClockBarrierOpen]
[ShieldStation] [ShieldBarrierClosed] -> [ShieldStation] [ShieldBarrierOpen]
[HealthStation] [HealthBarrierClosed] -> [HealthStation] [HealthBarrierOpen]
[ClockBroken] [ClockBarrierOpen] -> [ClockBroken] [ClockBarrierClosed]
[ShieldBroken] [ShieldBarrierOpen] -> [ShieldBroken] [ShieldBarrierClosed]
[HealthBroken] [HealthBarrierOpen] -> [HealthBroken] [HealthBarrierClosed]
(they just repel the player)
late UP [ | Player ClockBarrierClosed] -> [Player no Debris | ClockBarrierClosed]
late UP [ | Player ShieldBarrierClosed] -> [Player no Debris | ShieldBarrierClosed]
late LEFT [ | Player HealthBarrierClosed] -> [Player no Debris | HealthBarrierClosed]
(Cleanup)
late [Ground Digit] -> [Ground]
late [Malfunction] -> []
(Aesthetics)
late [EngineerNormal] [HealthBroken] -> [EngineerInjured] [HealthBroken]
late [EngineerInjured] [HealthStation] -> [EngineerNormal] [HealthStation]
late [Progress] -> [JumpDriveReady]
late [JumpDriveReady] [ProgressBar] -> [Progress] [ProgressBar]
late [ShieldVisual] [ShieldBroken] -> [ShieldVisual ShieldsAreDown] [ShieldBroken]
late [ShieldsAreDown] [ShieldStation] -> [] [ShieldStation]
(Win Condition)
late [LaunchButtonBroken] -> [LaunchButton]
late [LaunchButton] [ProgressBar] -> [LaunchButtonBroken] [ProgressBar]
late [LaunchButton] [brokenstation] -> [LaunchButtonBroken] [brokenstation]
[> Player | LaunchButton] -> [> Player | LaunchButton] win
==============
WINCONDITIONS
==============
(you win by moving into a working launch button)
=======
LEVELS
=======
message Your ship is being attacked. You are in the engineering room. Can you survive the malfunctions long enough for your jump drive to recharge?
message Use arrow keys to move. Press X to clear debris around you; if you bump into debris it costs you 1 second.
message Pick up tools at the green + station. You can hold five. Press X to select the slot (it overwrites a tool in the same slot). You can also exchange tools in your hand with the storage systems by moving into the latter.
message Malfunctions will come. The clock (blue) and shield (yellow) take 3 tools of their color to fix; the life support (red) and toolshed (green) take 2. Collect the tools and move to a black (broken) system to fix it.
message If clock (blue) is broken, you'll lose 10 seconds after each malfunction.
message If shield (yellow) is broken, you need to fix it before the timer expires or else you lose!! You'll notice the yellow border will disappear.
message If life support (red) is broken, you cannot fix any other systems! You have to fix life support first! Your character will change color.
message If the toolshed (green) is broken, you cannot gain more tools!
message Oh, and one last thing: storage spaces are locked when their nearby system breaks!
message Once the jump drive (on the right) is fixed, you'll be able to launch. Just get to the launch button (north of the green station) AFTER you've fixed all malfunctions!
`nnnnnnnnnnnnnnnnnn*
e##################e
e##$$$$$##$$$$$##!#e
e##/////..\\\\\##!#e
e#..............#!#e
e#c............s#!#e
e#######...######!#e
e#$$$$$#.....z###!#e
e#'''''.......###!#e
e#............###!#e
e#p...........###!#e
e###h........d###!#e
e################!#e
e###+#-____##:;##!#e
e##################e
,nnnnnnnnnnnnnnnnnn"
message Jump Drive activated! You win!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment