Skip to content

Instantly share code, notes, and snippets.

@chz16
Created June 5, 2023 06:23
Show Gist options
  • Save chz16/28708f730de1b46159ad0b3541357dd4 to your computer and use it in GitHub Desktop.
Save chz16/28708f730de1b46159ad0b3541357dd4 to your computer and use it in GitHub Desktop.
Chiaroscuro code
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
(version 1.0.0
1.0.0 [2023-06-04]: original jam release
)
title Chiarascuro
author CHz
homepage quiteajolt.com
noundo
background_color #505050
run_rules_on_level_start
again_interval 0.02
realtime_interval 0.1 (used only for an animation)
========
OBJECTS
========
Background
#505050
RandomObjectPlacement
transparent
RandomBackgroundOrContainer1
transparent
RandomBackgroundOrContainer2
transparent
RandomBackgroundOrContainer3
transparent
RandomBackground2
transparent
RandomBackground3
transparent
RandomBackground4
transparent
RandomLightContainer2
transparent
RandomCrateOrPit1
transparent
RandomCrateOrPit2
transparent
RandomCrate2
transparent
RandomCrate3
transparent
DownBorder
#303030
.....
.....
.....
.....
00000
DRBorder
#303030
.....
.....
.....
.....
....0
RightBorder
#303030
....0
....0
....0
....0
....0
URBorder
#303030
....0
.....
.....
.....
.....
UpBorder
#303030
00000
.....
.....
.....
.....
ULBorder
#303030
0....
.....
.....
.....
.....
LeftBorder
#303030
0....
0....
0....
0....
0....
DLBorder
#303030
.....
.....
.....
.....
0....
LightLevel1
#707070
LightLevel2
#909090
LightLevel3
#B0B0B0
LightLevel4
#D0D0D0
LightLevel5
#FFFFFF
NormalPlayer
#505050
..0..
.000.
0.0.0
..0..
.0.0.
NormalLeftBonkedPlayer
#505050
.0...
000..
00.0.
.0...
0.0..
NormalRightBonkedPlayer
#505050
...0.
..000
.0.00
...0.
..0.0
NormalUpBonkedPlayer
#505050
.000.
0.0.0
..0..
.0.0.
.....
NormalDownBonkedPlayer
#505050
.....
..0..
.000.
0.0.0
.000.
LightPlayer
#FFFFFF
..0..
.000.
0.0.0
..0..
.0.0.
LightLeftBonkedPlayer
#FFFFFF
.0...
000..
00.0.
.0...
0.0..
LightRightBonkedPlayer
#FFFFFF
...0.
..000
.0.00
...0.
..0.0
LightUpBonkedPlayer
#FFFFFF
.000.
0.0.0
..0..
.0.0.
.....
LightDownBonkedPlayer
#FFFFFF
.....
..0..
.000.
0.0.0
.000.
DarkPlayer
#000000
..0..
.000.
0.0.0
..0..
.0.0.
DarkLeftBonkedPlayer
#000000
.0...
000..
00.0.
.0...
0.0..
DarkRightBonkedPlayer
#000000
...0.
..000
.0.00
...0.
..0.0
DarkUpBonkedPlayer
#000000
.000.
0.0.0
..0..
.0.0.
.....
DarkDownBonkedPlayer
#000000
.....
..0..
.000.
0.0.0
.000.
Spawn
#000000
.....
..0..
..0..
..0..
.....
LightContainer
#FFFFFF
.....
.000.
.0.0.
.000.
.....
DarkContainer
#000000
.....
.000.
.0.0.
.000.
.....
Crate
#505050
.0.0.
00000
.0.0.
00000
.0.0.
InvisiblePit
transparent
VisiblePit
#000000
InvisibleFallenPlayer
transparent
VisibleFallenPlayer
#FFFFFF
.....
.....
..0..
.....
.....
PotentialGoal
transparent
Goal
#505050
..0..
.0.0.
0...0
.0.0.
..0..
Outside
transparent
Meter1
transparent
Meter2
transparent
Meter3
transparent
Meter4
transparent
EmptyMeter
#303030
00000
0...0
0...0
0...0
00000
LightMeter
#303030 #FFFFFF
00000
01110
01110
01110
00000
DarkMeter
#303030 #000000
00000
01110
01110
01110
00000
GlitchedPlayer
#000000
..0..
.000.
0.0.0
..0..
.0.0.
GlitchOverlay1
#505050
...00
0..00
00.00
.000.
000..
GlitchOverlay2
#505050
.000.
..000
..0.0
0.000
00.0.
GlitchOverlay3
#505050
00.0.
0.00.
00.00
0...0
.00.0
GlitchOverlay4
#505050
00000
00..0
...0.
00...
.0000
GlitchOverlay5
#505050
00.0.
0...0
0.000
.0000
0...0
GlitchOverlay6
#505050
0.0..
..000
0.0.0
.0.00
000.0
GlitchOverlay7
#505050
...00
0000.
..0..
0000.
0000.
GlitchOverlay8
#505050
0.00.
.0.00
000..
.000.
0..00
GlitchOverlay9
#505050
0.000
00.00
..00.
.000.
.00..
GlitchOverlay10
#505050
0..00
0..00
.0000
0..0.
.00.0
NewGlitchSpread
transparent
OldGlitchSpread
transparent
GlitchDelete
transparent
GlitchBump
transparent
GlitchDeleted
transparent
LevelGen
transparent
PlayerStart
transparent
LightSpread
transparent
DarkSpread
transparent
DoSpread
transparent
NewSpread
transparent
OldSpread
transparent
IncreaseLight
transparent
DecreaseLight
transparent
LeftToken
transparent
RightToken
transparent
UpToken
transparent
DownToken
transparent
OldVictorySpread
transparent
NewVictorySpread
transparent
VictoryPlayer
transparent
=======
LEGEND
=======
# = Outside
1 = Meter1 and EmptyMeter and Outside
2 = Meter2 and EmptyMeter and Outside
3 = Meter3 and EmptyMeter and Outside
4 = Meter4 and Outside
Meter = EmptyMeter or LightMeter or DarkMeter
. = RandomObjectPlacement
RandomBackgroundOrContainer = Background or RandomBackground2 or RandomBackground3 or LightContainer
RandomCrateOrPit = Crate or RandomCrate2 or RandomCrate3 or InvisiblePit
RandomObject = RandomBackgroundOrContainer1 or RandomBackgroundOrContainer2 or RandomBackgroundOrContainer3 or RandomCrateOrPit1 or RandomCrateOrPit2
- = Background
LightLevel = LightLevel1 or LightLevel2 or LightLevel3 or LightLevel4 or LightLevel5
@ = NormalPlayer and Spawn and LightLevel5 and LevelGen
L = LightContainer
D = DarkContainer
Container = LightContainer or DarkContainer
Pit = InvisiblePit or VisiblePit
Spread = NewSpread or OldSpread
SpreadMarker = LightSpread or DarkSpread
MovementToken = LeftToken or RightToken or UpToken or DownToken
NormalBonkedPlayer = NormalLeftBonkedPlayer or NormalRightBonkedPlayer or NormalUpBonkedPlayer or NormalDownBonkedPlayer
LightBonkedPlayer = LightLeftBonkedPlayer or LightRightBonkedPlayer or LightUpBonkedPlayer or LightDownBonkedPlayer
DarkBonkedPlayer = DarkLeftBonkedPlayer or DarkRightBonkedPlayer or DarkUpBonkedPlayer or DarkDownBonkedPlayer
FallenPlayer = VisibleFallenPlayer or InvisibleFallenPlayer
Player = NormalPlayer or NormalBonkedPlayer or LightPlayer or LightBonkedPlayer or DarkPlayer or DarkBonkedPlayer or GlitchedPlayer or FallenPlayer or VictoryPlayer
Border = DownBorder or DRBorder or RightBorder or URBorder or UpBorder or ULBorder or LeftBorder or DLBorder
GlitchOverlay = GlitchOverlay1 or GlitchOverlay2 or GlitchOverlay3 or GlitchOverlay4 or GlitchOverlay5 or GlitchOverlay6 or GlitchOverlay7 or GlitchOverlay8 or GlitchOverlay9 or GlitchOverlay10
=======
SOUNDS
=======
Player Move 54781307
Player CantMove 64135304
Crate Move 68805907
FallenPlayer Destroy 34854308 (respawn)
LightSpread Create 26920903 (spread light)
DarkSpread Create 34980508 (spread dark)
GlitchedPlayer Destroy 96620508 (goodbye)
VictoryPlayer Create 67029708 (clear canvas of actors)
VictoryPlayer Destroy 46773900 (input to end game)
sfx0 11364700 (pick up light container)
sfx1 60576708 (pick up dark container)
sfx2 14245508 (cancel out container with opposite)
sfx3 35118302 (walk into something while glitched)
sfx4 2472302 (something falls in a pit)
sfx5 14003102 (zap crate when respawning)
sfx6 58829501 (don't walk into a visible pit)
================
COLLISIONLAYERS
================
Background
RandomObjectPlacement, RandomBackgroundOrContainer1, RandomBackgroundOrContainer2, RandomBackgroundOrContainer3, RandomBackground2, RandomBackground3, RandomBackground4, RandomLightContainer2, RandomCrateOrPit1, RandomCrateOrPit2, RandomCrate2, RandomCrate3
Meter1, Meter2, Meter3, Meter4
Meter
Border
LightLevel
Spawn
Pit
PotentialGoal, Goal
Player, Crate, Container, Outside
IncreaseLight, DecreaseLight
OldSpread, NewSpread
LightSpread, DarkSpread
DoSpread
LevelGen
PlayerStart
MovementToken
NewGlitchSpread, OldGlitchSpread
GlitchOverlay
GlitchDelete
GlitchBump
GlitchDeleted
NewVictorySpread, OldVictorySpread
======
RULES
======
(================
LEVEL GENERATION
================)
(Draw playing field border on level start)
DOWN [ LevelGen ] [ Outside | no Outside ] -> [ LevelGen ] [ Outside DownBorder | ]
RIGHT [ LevelGen ] [ Outside | no Outside ] -> [ LevelGen ] [ Outside RightBorder | ]
UP [ LevelGen ] [ Outside | no Outside ] -> [ LevelGen ] [ Outside UpBorder | ]
LEFT [ LevelGen ] [ Outside | no Outside ] -> [ LevelGen ] [ Outside LeftBorder | ]
random LEFT [ LevelGen ] [ DownBorder | no DownBorder ] -> [ LevelGen ] [ DownBorder | DRBorder ]
random RIGHT [ LevelGen ] [ DownBorder | no DownBorder ] -> [ LevelGen ] [ DownBorder | DLBorder ]
random LEFT [ LevelGen ] [ UpBorder | no UpBorder ] -> [ LevelGen ] [ UpBorder | URBorder ]
random RIGHT [ LevelGen ] [ UpBorder | no UpBorder ] -> [ LevelGen ] [ UpBorder | ULBorder ]
(Place eight potential goals, each with at least one guaranteed adjacent free space)
random LEFT [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random LEFT [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random RIGHT [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random RIGHT [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random UP [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random UP [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random DOWN [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
random DOWN [ RandomObjectPlacement | RandomObjectPlacement ] -> [ PotentialGoal | ]
(Spawn random things)
(Drop rates: 45% empty, 15% container, 30% crate, 10% pit)
(Some other drop rates I tried:
* 44% empty, 22% container, 22% crate, 11% pit
* 44% empty, 11% container, 33% crate, 11% pit
* 33% empty, 22% container, 33% crate, 11% pit
)
[ RandomObjectPlacement ] -> [ random RandomObject ]
[ RandomBackgroundOrContainer1 ] -> [ random RandomBackgroundOrContainer ]
[ RandomBackgroundOrContainer2 ] -> [ random RandomBackgroundOrContainer ]
[ RandomBackgroundOrContainer3 ] -> [ random RandomBackgroundOrContainer ]
[ RandomBackground2 ] -> [ ]
[ RandomBackground3 ] -> [ ]
[ RandomBackground4 ] -> [ ]
[ RandomLightContainer2 ] -> [ LightContainer ]
[ RandomCrateOrPit1 ] -> [ random RandomCrateOrPit ]
[ RandomCrateOrPit2 ] -> [ random RandomCrateOrPit ]
[ RandomCrate2 ] -> [ Crate ]
[ RandomCrate3 ] -> [ Crate ]
(Clear the marker)
[ LevelGen ] -> [ ]
(=======
GOODBYE
=======)
(Press X to goodbye)
[ OldGlitchSpread | no OldGlitchSpread ] -> [ OldGlitchSpread | NewGlitchSpread GlitchDelete ] again checkpoint
[ ACTION GlitchedPlayer ] -> [ NewGlitchSpread GlitchDelete ] again checkpoint
late [ NewGlitchSpread ] -> [ OldGlitchSpread ]
(Put a scrambled overlay animation over the fourth meter slot and player once they're glitching too)
(This is the only reason this game has realtime)
late [ GlitchOverlay ] -> [ ]
late [ Meter4 Meter ] -> [ Meter4 Meter random GlitchOverlay ]
late [ GlitchedPlayer ] -> [ GlitchedPlayer random GlitchOverlay ]
(Delete anything the player tries to walk into)
[ > GlitchedPlayer | ] -> [ > GlitchedPlayer | GlitchDelete GlitchBump ]
(Delete stuff with the power of glitch)
(Light tiles, outside tiles, and potential goals intentionally don't play a noise on their own)
[ GlitchDelete Crate ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete Pit ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete Border ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete LightContainer ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete DarkContainer ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete LightLevel ] -> [ GlitchDelete ]
[ GlitchDelete PotentialGoal ] -> [ GlitchDelete ]
[ GlitchDelete Goal ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete Spawn ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete Meter ] -> [ GlitchDelete GlitchDeleted ]
[ GlitchDelete Outside ] -> [ GlitchDelete ]
[ GlitchDelete ] -> [ ]
(Play a sound if something was deleted by the player walking into it)
[ GlitchDeleted GlitchBump ] -> [ ] sfx3
[ GlitchDeleted ] -> []
[ GlitchBump ] -> [ ]
(=============
FALLEN PLAYER
=============)
(These rules would make more logical sense in other sections, but for ordering purposes they should be before other stuff)
(Destroy crate if there's one on spawn and we respawn)
(Player and Crate are on the same layer, so this is logically unnecessary, but if we do it like this we can play a sound effect)
[ Spawn Crate ] [ ACTION FallenPlayer ] -> [ Spawn ] [ ACTION FallenPlayer ] sfx5
(Press X to respawn)
[ Spawn ] [ ACTION FallenPlayer ] -> [ Spawn NormalPlayer ] [ ]
(Cancel fallen player movement before interacting with anything)
[ MOVING FallenPlayer ] -> [ FallenPlayer ]
(==================
OBJECT INTERACTION
==================)
(Single push crates)
[ > Player | Crate ] -> [ > Player | > Crate ]
(Crates can't move onto the goal)
[ > Crate | Goal ] -> [ Crate | Goal ]
(Things fall into pits)
late [ Crate Pit ] -> [ Pit ] sfx4
late [ NormalPlayer InvisiblePit ] -> [ InvisibleFallenPlayer InvisiblePit ] sfx4
late [ LightPlayer InvisiblePit ] -> [ VisibleFallenPlayer VisiblePit ] sfx4
late [ DarkPlayer InvisiblePit ] -> [ InvisibleFallenPlayer no LightLevel ] sfx4 sfx5
(Clear meters if the player fell into a pit)
late [ FallenPlayer ] [ Meter1 LightMeter ] -> [ FallenPlayer ] [ Meter1 EmptyMeter ]
late [ FallenPlayer ] [ Meter1 DarkMeter ] -> [ FallenPlayer ] [ Meter1 EmptyMeter ]
late [ FallenPlayer ] [ Meter2 LightMeter ] -> [ FallenPlayer ] [ Meter2 EmptyMeter ]
late [ FallenPlayer ] [ Meter2 DarkMeter ] -> [ FallenPlayer ] [ Meter2 EmptyMeter ]
late [ FallenPlayer ] [ Meter3 LightMeter ] -> [ FallenPlayer ] [ Meter3 EmptyMeter ]
late [ FallenPlayer ] [ Meter3 DarkMeter ] -> [ FallenPlayer ] [ Meter3 EmptyMeter ]
(Pick up container opposite of what's currently in the meter - reduce meter)
[ > DarkPlayer | LightContainer ] [ Meter3 DarkMeter ] -> [ > DarkPlayer | ] [ Meter3 EmptyMeter ] sfx2
[ > DarkPlayer | LightContainer ] [ Meter2 DarkMeter ] -> [ > DarkPlayer | ] [ Meter2 EmptyMeter ] sfx2
[ > DarkPlayer | LightContainer ] [ Meter1 DarkMeter ] -> [ > NormalPlayer | ] [ Meter1 EmptyMeter ] sfx2
[ > LightPlayer | DarkContainer ] [ Meter3 LightMeter ] -> [ > LightPlayer | ] [ Meter3 EmptyMeter ] sfx2
[ > LightPlayer | DarkContainer ] [ Meter2 LightMeter ] -> [ > LightPlayer | ] [ Meter2 EmptyMeter ] sfx2
[ > LightPlayer | DarkContainer ] [ Meter1 LightMeter ] -> [ > NormalPlayer | ] [ Meter1 EmptyMeter ] sfx2
(Pick up container - fill meter)
[ > NormalPlayer | LightContainer ] [ Meter1 EmptyMeter ] -> [ > LightPlayer | ] [ Meter1 LightMeter ] sfx0
[ > LightPlayer | LightContainer ] [ Meter2 EmptyMeter ] -> [ > LightPlayer | ] [ Meter2 LightMeter ] sfx0
[ > LightPlayer | LightContainer ] [ Meter3 EmptyMeter ] -> [ > LightPlayer | ] [ Meter3 LightMeter ] sfx0
[ > NormalPlayer | DarkContainer ] [ Meter1 EmptyMeter ] -> [ > DarkPlayer | ] [ Meter1 DarkMeter ] sfx1
[ > DarkPlayer | DarkContainer ] [ Meter2 EmptyMeter ] -> [ > DarkPlayer | ] [ Meter2 DarkMeter ] sfx1
[ > DarkPlayer | DarkContainer ] [ Meter3 EmptyMeter ] [ Meter4 ] -> [ > DarkPlayer | ] [ Meter3 DarkMeter ] [ Meter4 EmptyMeter ] sfx1
[ > DarkPlayer | DarkContainer ] [ Meter3 DarkMeter ] [ Meter4 ] -> [ > GlitchedPlayer | ] [ Meter3 DarkMeter ] [ Meter4 DarkMeter ] sfx1
(Clear the fourth meter slot if the player spreads dark or cancels out a dark with a light pickup)
late [ Meter3 no DarkMeter ] [ Meter4 EmptyMeter ] -> [ Meter3 ] [ ]
(========
MOVEMENT
========)
(Track the direction the player moved)
LEFT [ > Player ] -> [ > Player LeftToken ]
RIGHT [ > Player ] -> [ > Player RightToken ]
UP [ > Player ] -> [ > Player UpToken ]
DOWN [ > Player ] -> [ > Player DownToken ]
(The player can't walk into visible pits)
[ > Player | VisiblePit ] -> [ Player | VisiblePit ] sfx6
(And if they couldn't move, play a little bonk animation)
late [ NormalBonkedPlayer ] -> [ NormalPlayer ]
late [ NormalPlayer LeftToken ] -> [ NormalLeftBonkedPlayer ] again
late [ NormalPlayer RightToken ] -> [ NormalRightBonkedPlayer ] again
late [ NormalPlayer UpToken ] -> [ NormalUpBonkedPlayer ] again
late [ NormalPlayer DownToken ] -> [ NormalDownBonkedPlayer ] again
late [ LightBonkedPlayer ] -> [ LightPlayer ]
late [ LightPlayer LeftToken ] -> [ LightLeftBonkedPlayer ] again
late [ LightPlayer RightToken ] -> [ LightRightBonkedPlayer ] again
late [ LightPlayer UpToken ] -> [ LightUpBonkedPlayer ] again
late [ LightPlayer DownToken ] -> [ LightDownBonkedPlayer ] again
late [ DarkBonkedPlayer ] -> [ DarkPlayer ]
late [ DarkPlayer LeftToken ] -> [ DarkLeftBonkedPlayer ] again
late [ DarkPlayer RightToken ] -> [ DarkRightBonkedPlayer ] again
late [ DarkPlayer UpToken ] -> [ DarkUpBonkedPlayer ] again
late [ DarkPlayer DownToken ] -> [ DarkDownBonkedPlayer ] again
late [ MovementToken ] -> [ ]
(====================
LIGHTENING/DARKENING
====================)
(Drop a token to check if the player moved this turn)
[ Player ] -> [ Player PlayerStart ]
(If the player moved and they're light, paint their feet)
late [ LightPlayer no PlayerStart ] -> [ LightPlayer IncreaseLight ]
(Clear movement token)
late [ PlayerStart ] -> [ ]
(Start a spread on action)
[ ACTION Player ] [ Meter1 LightMeter ] -> [ NormalPlayer OldSpread DoSpread ] [ Meter1 LightMeter LightSpread ]
[ ACTION Player ] [ Meter1 DarkMeter ] -> [ NormalPlayer OldSpread DoSpread ] [ Meter1 DarkMeter DarkSpread ]
(Do one spread stage per turn)
[ DoSpread ] [ OldSpread | no Spread no Outside ] -> [ DoSpread ] [ OldSpread | NewSpread ]
late [ LightSpread ] [ NewSpread ] -> [ LightSpread ] [ OldSpread IncreaseLight ]
late [ DarkSpread ] [ NewSpread ] -> [ DarkSpread ] [ OldSpread DecreaseLight ]
late [ DoSpread ] [ Meter1 no EmptyMeter ] [ Meter2 EmptyMeter ] -> [ ] [ Meter1 EmptyMeter ] [ Meter2 EmptyMeter ]
late [ DoSpread ] [ Meter2 no EmptyMeter ] [ Meter3 EmptyMeter ] -> [ DoSpread ] [ Meter2 EmptyMeter ] [ Meter3 ] again
late [ DoSpread ] [ Meter3 no EmptyMeter ] -> [ DoSpread ] [ Meter3 EmptyMeter ] again
late [ Player no DoSpread ] [ Spread ] -> [ Player ] []
late [ Player no DoSpread ] [ SpreadMarker ] -> [ Player ] []
(Lighten)
late [ IncreaseLight no LightLevel ] -> [ LightLevel1 ]
late [ IncreaseLight LightLevel1 ] -> [ LightLevel2 ]
late [ IncreaseLight LightLevel2 ] -> [ LightLevel3 ]
late [ IncreaseLight LightLevel3 ] -> [ LightLevel4 ]
late [ IncreaseLight LightLevel4 ] -> [ LightLevel5 ]
late [ IncreaseLight ] -> []
(Darken)
late [ DarkPlayer ] -> [ DarkPlayer DecreaseLight ]
late [ DecreaseLight ] -> [ DecreaseLight no LightLevel ]
late [ DecreaseLight Crate ] -> [ DecreaseLight ]
late [ DecreaseLight Pit ] -> [ DecreaseLight ]
late [ DecreaseLight Container ] -> [ DecreaseLight ]
late [ DecreaseLight ] -> [ ]
(Reveal pits)
late [ LightLevel InvisiblePit ] -> [ LightLevel VisiblePit ]
(================
GOAL REIFICATION
================)
(The level generator creates 8 potential goals, but we'll only let the player exit from the LAST one they reveal)
(Darkening intentionally doesn't affect goals or potential goals in any way)
(If the player lightens a potential goal but there's an unrevealed one remaining, clear that potential goal)
late [ PotentialGoal no LightLevel ] [ PotentialGoal LightLevel ] -> [ PotentialGoal ] [ no PotentialGoal LightLevel ]
(If the player walks over a potential goal while not lightening, then clear that goal. If this rule activates, then exactly one goal was removed this turn, so there will always be at least one remaining)
late [ Player no LightPlayer PotentialGoal ] -> [ Player ]
(If the player pushes a crate over a potential goal, then clear that goal. If this rule activates, then exactly one goal was removed this turn, so there will always be at least one remaining)
late [ Crate PotentialGoal ] -> [ Crate ]
(Check if there's only one potential goal remaining, and if there is, make it the real goal)
late random [ PotentialGoal ] -> [ Goal ]
late [ PotentialGoal ] [ Goal ] -> [ PotentialGoal ] [ PotentialGoal ]
(If a lit potential goal exists at this point, then the player must have lightened all of them at once. In that case, randomly choose one to be the real goal and clear the rest)
late random [ PotentialGoal LightLevel ] -> [ Goal LightLevel ]
late [ Goal ] [ PotentialGoal ] -> [ Goal ] [ ]
(=======
WINNING
=======)
(When the player steps on the goal, switch to a null player object and start clearing actors)
late [ Player Goal ] -> [ VictoryPlayer Goal NewVictorySpread ] again
(If the player does an input after we've cleared the screen of everything but the canvas, end the game)
[ MOVING VictoryPlayer ] -> [ ] win
[ ACTION VictoryPlayer ] -> [ ] win
(Clear the actors, so the player can view the canvas)
[ NewVictorySpread Crate ] -> [ NewVictorySpread ]
[ NewVictorySpread Goal ] -> [ NewVictorySpread ]
[ NewVictorySpread Container ] -> [ NewVictorySpread ]
[ NewVictorySpread Meter ] -> [ NewVictorySpread ]
[ NewVictorySpread Spawn ] -> [ NewVictorySpread ]
[ NewVictorySpread ] -> [ OldVictorySpread ]
[ OldVictorySpread | no OldVictorySpread ] -> [ OldVictorySpread | NewVictorySpread ] again
==============
WINCONDITIONS
==============
=======
LEVELS
=======
###################################
#1#D--.........................--D#
###--...........................--#
#2#-.............................-#
###...............................#
#3#...............................#
###...............................#
#4#...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###..............L-L..............#
###..............-@-..............#
###..............L-L..............#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###...............................#
###-.............................-#
###--...........................--#
###D--.........................--D#
###################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment