Skip to content

Instantly share code, notes, and snippets.

@m-ender
Created June 3, 2025 09:53
Show Gist options
  • Save m-ender/0870fb0a73d164fc5e6c1d8cc95629cc to your computer and use it in GitHub Desktop.
Save m-ender/0870fb0a73d164fc5e6c1d8cc95629cc to your computer and use it in GitHub Desktop.
Sokoyote (Puzzlescript Next Script)
Play this game by pasting the script into https://david-pfx.github.io/PuzzleScriptNext/src/editor.html
title Sokoyote
author Menderbug
homepage https://brokensign.com/
run_rules_on_level_start
realtime_interval 0.1
again_interval 0.1
// enable comments
=====
TAGS
=====
Tick = 0 1 2 3 4 5 6 7 8 9 10
=========
MAPPINGS
=========
Tick => TickDown
0 1 2 3 4 5 6 7 8 9 10 -> 0 0 1 2 3 4 5 6 7 8 9
========
OBJECTS
========
Background
lightgrey grey
00010
11111
01000
11111
00010
Target
darkblue
.000.
0...0
0.0.0
0...0
.000.
Wall
brown darkbrown
00010
11111
01000
11111
00010
PlayerStanding
black orange white blue
.000.
.111.
22222
.333.
.3.3.
PlayerJumping
black orange white blue
.000.
21112
.222.
.333.
3...3
Snail
pink orange brown
.111.
12211
21121
21110
.2000
CornerBG:directions
brown
....0
.....
.....
.....
.....
rot:right:>
CornerWall:directions
lightgrey
....0
.....
.....
.....
.....
rot:right:>
Temp:directions; pink
Temp; pink
Timer:Tick; transparent
Falling; transparent
Jumping; transparent
Flailing; transparent
PlayerTurn; pink
RealTimeTurn; pink
=======
LEGEND
=======
. = Background
# = Wall
P = PlayerStanding
* = Snail
@ = Snail and Target
O = Target
CornerBG = CornerBG:directions
CornerWall = CornerWall:directions
AirState = Jumping or Falling or Flailing
SupportPlayer = Snail or Wall
Player = PlayerStanding or PlayerJumping
TurnMarker = RealTimeTurn or PlayerTurn
=======
SOUNDS
=======
Snail move 36772507
================
COLLISIONLAYERS
================
Background
directions -> CornerBG:directions
Target
Player
Wall
Snail
directions -> CornerWall:directions
Timer:Tick
AirState
directions -> Temp:directions
Temp
TurnMarker
======
RULES
======
[ no Wall | Wall ] -> [ CornerBG:> Temp:> | Wall ]
[ CornerBG:v Temp:v | Wall ] -> [ CornerBG:v | Wall ]
[ CornerBG:> Temp:> ] -> [ ]
[ Temp ] -> [ ]
[ CornerBG:> | no Wall ] -> [ | ]
[ CornerBG:v | no Wall ] -> [ | ]
[ Wall ] -> [ Wall CornerWall:< CornerWall:v CornerWall:> CornerWall:^ ]
[ CornerWall:> | Wall ] -> [ | Wall ]
[ CornerWall:v | Wall ] -> [ | Wall ]
random [ ] -> [ Temp ]
[ ] [ Temp ] [ moving Player ] -> [ PlayerTurn ] [ ] [ moving Player ]
[ ] [ Temp ] -> [ RealTimeTurn ] [ ]
[ RealTimeTurn ] -> gosub Real-time turn
[ PlayerTurn ] -> gosub Player turn
late [ RealTimeTurn ] -> gosub Late real-time turn
late [ PlayerTurn ] -> gosub Late player turn
late [ TurnMarker ] -> [ ]
subroutine Real-time turn
down [ Player Falling | SupportPlayer ] -> [ PlayerStanding | SupportPlayer ]
[ Player Falling ] -> [ down PlayerStanding down Falling ]
subroutine Player turn
[ moving Player Falling ] -> [ Player Falling ]
[ up Player Jumping ] -> [ Player Jumping ]
[ horizontal Player Flailing ] -> [ Player Flailing ]
[ > Player | Wall ] -> [ Player | Wall ]
[ > Player | Snail ] -> [ > Player | > Snail ]
up [ > Player | no Wall ] -> [ > PlayerJumping > Jumping | ]
horizontal [ > Player Jumping | no Wall ] -> [ > PlayerStanding > Falling | ]
down [ > Player Flailing ] -> [ PlayerStanding Falling ]
subroutine Late real-time turn
late [ PlayerStanding Flailing ] -> [ PlayerJumping Flailing Temp ]
late [ PlayerJumping Flailing no Temp ] -> [ PlayerStanding Flailing ]
late [ Temp ] -> [ ]
late [ Player Flailing Timer:0 ] -> [ PlayerStanding Falling ]
late down [ Player no AirState | no SupportPlayer ] -> [ Player Flailing Timer:6 | ]
late [ AirState no Player ] -> [ ]
late Tick once [ Timer:Tick ] -> [ Timer:TickDown ]
subroutine Late player turn
late down [ Player no AirState | no SupportPlayer ] -> [ Player Flailing Timer:6 | ]
late [ AirState no Player ] -> [ ]
==============
WINCONDITIONS
==============
all Target on Snail
=======
LEVELS
=======
####..
#.O#..
#..###
#@P..#
#..*.#
#..###
####..
######
#....#
#.#P.#
#.*@.#
#.O@.#
#....#
######
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment