Skip to content

Instantly share code, notes, and snippets.

@thelast19digitsofpi
Created August 17, 2022 14:26
Show Gist options
  • Save thelast19digitsofpi/9c47b664d44c0b6b8fbfa3b63fb13c83 to your computer and use it in GitHub Desktop.
Save thelast19digitsofpi/9c47b664d44c0b6b8fbfa3b63fb13c83 to your computer and use it in GitHub Desktop.
Spaceship Collapse Hard Version (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Spaceship Collapse Hard Version
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
.....
CardMovement
#939
.....
00000
.000.
00000
.....
(Storage)
Storage
#656 #222 #aaa
10101
20002
10201
20002
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.
MovementStation
#939 #eee
01110
10001
10001
10001
01110
MovementBroken
#727 black
.111.
10001
10001
10001
.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.
MovementBarrierOpen
#939
.....
.....
..0..
.....
.....
MovementBarrierClosed
#939
.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
MovementScanner0
#ff00ff
MovementScanner1
#ff00ff
MovementScanner2
#ff00ff
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
LaunchButton1
#333 white #0ff #5ff
01110
12221
12231
12331
01110
LaunchButton2
#333 #aaa #0cc #5cc
01110
12231
12331
13331
01110
LaunchButtonTemp
transparent
(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 or CardMovement
CardPuttingIntoStorage = Card
BrokenStation = HealthBroken or DrawBroken or ClockBroken or ShieldBroken or MovementBroken
Station = HealthStation or DrawStation or ClockStation or ShieldStation or MovementStation 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/8 chance of spawning right now)
MaybeDebris = One or Two or Three or Four or Five or Six or Seven or Debris
Scanner = HealthScanner0 or HealthScanner1 or ClockScanner0 or ClockScanner1 or ClockScanner2 or DrawScanner0 or DrawScanner1 or ShieldScanner0 or ShieldScanner1 or ShieldScanner2 or MovementScanner0 or MovementScanner1 or MovementScanner2
ShieldVisual = ShieldVisualH or ShieldVisualNE or ShieldVisualV or ShieldVisualSE or ShieldVisualSW or ShieldVisualNW
LaunchButton = LaunchButton1 or LaunchButton2
. = Ground
# = Wall
P = EngineerNormal and Ground
$ = Storage
H = HealthStation
D = DrawStation
S = ShieldStation
C = ClockStation
M = MovementStation
z = LaunchButtonBroken
_ = Hand
- = Hand and CursorStart
+ = NewDraw
: = Three and TensPlace
; = Zero and OnesPlace
/ = ClockBarrierOpen
\ = ShieldBarrierOpen
' = HealthBarrierOpen
? = MovementBarrierOpen
! = 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
LaunchButtonTemp
ShieldBarrierOpen, ShieldBarrierClosed, ClockBarrierOpen, ClockBarrierClosed, HealthBarrierOpen, HealthBarrierClosed, MovementBarrierOpen, MovementBarrierClosed
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]
[stationary Player] [LaunchButton] -> [stationary Player] [launchbutton LaunchButtonTemp]
[LaunchButton1 LaunchButtonTemp] -> [LaunchButton2]
[LaunchButton2 LaunchButtonTemp] -> [LaunchButton1]
(Cursor can't move into a wall)
[> Cursor | Wall] -> CANCEL
[> Cursor | ShieldVisual] -> CANCEL
(Although bumping into debris ticks the timer)
[> Player | Debris] [OnesPlace] -> [Player | ] [OnesPlace Tick]
(and bumping into barriers does nothing)
[> Player | ShieldBarrierClosed] -> CANCEL
[> Player | ClockBarrierClosed] -> CANCEL
[> Player | HealthBarrierClosed] -> CANCEL
[> Player | MovementBarrierClosed] -> 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]
[> EngineerNormal | MovementBroken] [CursorStart] -> [EngineerNormal | MovementBroken] [CursorStart MovementScanner2]
(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
+ [DrawStation] [DrawBroken] -> [DrawStation] [DrawStation] (fixing one draw station fixes both)
+ [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
+ [MovementScanner2 CardMovement no Discard] -> [MovementScanner1 CardMovement Discard]
+ [MovementScanner1 CardMovement no Discard] -> [MovementScanner0 CardMovement Discard]
+ [MovementScanner0 CardMovement no Discard] [MovementBroken] -> [CardMovement Discard] [MovementStation] 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 no StationBreaker] -> [Malfunction] [Station StationBreaker]
[DrawStation StationBreaker] [DrawStation no StationBreaker] -> [DrawStation StationBreaker] [DrawStation StationBreaker]
random [Malfunction] [Station no StationBreaker] -> [Malfunction] [Station StationBreaker]
[DrawStation StationBreaker] [DrawStation no StationBreaker] -> [DrawStation StationBreaker] [DrawStation 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]
[MovementStation StationBreaker] -> [MovementBroken]
(we need this)
[DrawBroken StationBreaker] -> [DrawBroken]
(Broken stations seal their barriers)
[ClockStation] [ClockBarrierClosed] -> [ClockStation] [ClockBarrierOpen]
[ShieldStation] [ShieldBarrierClosed] -> [ShieldStation] [ShieldBarrierOpen]
[HealthStation] [HealthBarrierClosed] -> [HealthStation] [HealthBarrierOpen]
[MovementStation] [MovementBarrierClosed] -> [MovementStation] [MovementBarrierOpen]
[ClockBroken] [ClockBarrierOpen] -> [ClockBroken] [ClockBarrierClosed]
[ShieldBroken] [ShieldBarrierOpen] -> [ShieldBroken] [ShieldBarrierClosed]
[HealthBroken] [HealthBarrierOpen] -> [HealthBroken] [HealthBarrierClosed]
[MovementBroken] [MovementBarrierOpen] -> [MovementBroken] [MovementBarrierClosed]
(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] -> [LaunchButton1]
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 Pick up tools at the green + station. You can hold four. 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), shield (yellow), and movement (magenta) 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 If movement (magenta) is broken, spaces with magenta dots become walls. This will block many storage spaces!
message Once the jump drive (on the right) is fixed, you'll be able to launch. Just get to the launch button (southwest corner) AFTER you've fixed all malfunctions!
`nnnnnnnnnnnnnnnnnnnnnnnnn*
e######$$$######$$$#######e
e#c......?.?$?..?.....s#!#e
e####......?$?......####!#e
e##$?????#.???.#.?.??$##!#e
e###.....?.......?...###!#e
e###.???.?.?.?.?.???.###!#e
e#$?...?...?.?...?...?$#!#e
e#$#.?.???##m##???.??###!#e
e#........$###$......$##!#e
e#.#??.???##h##???.??#$#!#e
e#.#$?...?...?...?.....#!#e
e#.#$..?.?.?.?.?.?.?.#$#!#e
e#.##......?p..?...?.###!#e
e#.$#d..?#########.?.###!#e
e#.$###$$#-___#:;#.?d###!#e
e#z#######+#######$#######e
,nnnnnnnnnnnnnnnnnnnnnnnnn"
message Jump Drive activated! You win!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment