Skip to content

Instantly share code, notes, and snippets.

@hcs64
Last active June 22, 2017 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcs64/0ca57f77b17b9365d533420d96921482 to your computer and use it in GitHub Desktop.
Save hcs64/0ca57f77b17b9365d533420d96921482 to your computer and use it in GitHub Desktop.
Untitled dwim successor
title Untitled dwim successor
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.5
run_rules_on_level_start
========
OBJECTS
========
Background
Black
Wall
Grey
Player
Red
Shadow
Transparent
Goal
Yellow
CmdU
Green White
00000
00100
01010
00000
00000
CmdD
Green White
00000
00000
01010
00100
00000
CmdL
Green White
00000
00100
01000
00100
00000
CmdR
Green White
00000
00100
00010
00100
00000
XVar
Green White
00000
01010
00100
01010
00000
YVar
Green White
00000
01010
01010
00100
00100
IVar
Green White
00000
00100
00100
00100
00000
JVar
Green White
00000
00010
00010
01110
00000
Tombstone
DarkGrey Black
.000.
00100
01110
00100
00000
InactiveCursor
Transparent
CursorStart
Green White
00000
00000
00100
00000
00000
ActiveCursor
Orange
00...
0....
.....
....0
...00
Counter
Transparent
=======
LEGEND
=======
UDLR = CmdU or CmdD or CmdL or CmdR
DLR = CmdD or CmdL or CmdR
ULR = CmdU or CmdL or CmdR
UDR = CmdU or CmdD or CmdR
UDL = CmdU or CmdD or CmdL
UniqueVar = IVar or JVar
Var = XVar or YVar or IVar or JVar
. = Background
# = Wall
G = Goal
@ = Player
U = CmdU
D = CmdD
L = CmdL
R = CmdR
X = XVar
Y = YVar
I = IVar
J = JVar
C = InactiveCursor and Wall
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
Goal
Shadow, Counter
Wall, Player, Tombstone, CmdL, CmdR, CmdU, CmdD, XVar, YVar, UniqueVar
ActiveCursor, InactiveCursor, CursorStart
======
RULES
======
( set the cursors on the start of each command )
[ ActiveCursor Wall | UDLR ] -> [ CursorStart Wall | ActiveCursor UDLR ]
( if the player makes an allowed move, execute )
[ Up Player ] [ ActiveCursor CmdU ] -> [ Up Player ] [ Right ActiveCursor CmdU ]
[ Down Player ] [ ActiveCursor CmdD ] -> [ Down Player ] [ Right ActiveCursor CmdD ]
[ Left Player ] [ ActiveCursor CmdL ] -> [ Left Player ] [ Right ActiveCursor CmdL ]
[ Right Player ] [ ActiveCursor CmdR ] -> [ Right Player ] [ Right ActiveCursor CmdR ]
( kill any active cursors disagreeing with the player's move )
[ Up Player ] [ ActiveCursor DLR ] -> [ Up Player ] [ DLR ]
[ Down Player ] [ ActiveCursor ULR ] -> [ Down Player ] [ ULR ]
[ Left Player ] [ ActiveCursor UDR ] -> [ Left Player ] [ UDR ]
[ Right Player ] [ ActiveCursor UDL ] -> [ Right Player ] [ UDL ]
( tag all cursors+move with counters )
[ ActiveCursor UDLR ] -> [ ActiveCursor UDLR Counter ]
( remove counter if there is an ambiguity )
[ ActiveCursor CmdU ] [ Counter ActiveCursor DLR ] -> [ ActiveCursor CmdU ] [ ActiveCursor DLR ]
[ ActiveCursor CmdD ] [ Counter ActiveCursor ULR ] -> [ ActiveCursor CmdD ] [ ActiveCursor ULR ]
[ ActiveCursor CmdL ] [ Counter ActiveCursor UDR ] -> [ ActiveCursor CmdL ] [ ActiveCursor UDR ]
[ ActiveCursor CmdR ] [ Counter ActiveCursor UDL ] -> [ ActiveCursor CmdR ] [ ActiveCursor UDL ]
[ ActiveCursor Var ] [ Counter ActiveCursor UDLR ] -> [ ActiveCursor Var ] [ ActiveCursor UDLR ]
( execute this move if there is a unique one, removing counter )
[ ActiveCursor UDLR Counter ] -> [ Right ActiveCursor UDLR ]
( if the player makes a move, activate that cursor )
[ Up Player ] [ InactiveCursor CmdU ] -> [ Up Player ] [ ActiveCursor CmdU ] again
[ Down Player ] [ InactiveCursor CmdD ] -> [ Down Player ] [ ActiveCursor CmdD ] again
[ Left Player ] [ InactiveCursor CmdL ] -> [ Left Player ] [ ActiveCursor CmdL ] again
[ Right Player ] [ InactiveCursor CmdR ] -> [ Right Player ] [ ActiveCursor CmdR ] again
( any InactiveCursors disappear when ActiveCursor is in town )
[ InactiveCursor ] [ ActiveCursor ] -> [ ] [ ActiveCursor ]
( remove cursor on variables if a move is already being made )
[ Right ActiveCursor ] [ ActiveCursor Var ] -> [ Right ActiveCursor ] [ Var ]
( NOTE: this will break e.g. UDL, UXR; you can't put D in X )
( replace all instances of the X var besides the active one )
[ No ActiveCursor XVar ] [ ActiveCursor XVar ] [ Up Player ] -> [ CmdU ] [ ActiveCursor XVar ] [ Up Player ]
[ No ActiveCursor XVar ] [ ActiveCursor XVar ] [ Down Player ] -> [ CmdD ] [ ActiveCursor XVar ] [ Down Player ]
[ No ActiveCursor XVar ] [ ActiveCursor XVar ] [ Left Player ] -> [ CmdL ] [ ActiveCursor XVar ] [ Left Player ]
[ No ActiveCursor XVar ] [ ActiveCursor XVar ] [ Right Player ] -> [ CmdR ] [ ActiveCursor XVar ] [ Right Player ]
( replace all instances of the Y var besides the active one )
[ No ActiveCursor YVar ] [ ActiveCursor YVar ] [ Up Player ] -> [ CmdU ] [ ActiveCursor YVar ] [ Up Player ]
[ No ActiveCursor YVar ] [ ActiveCursor YVar ] [ Down Player ] -> [ CmdD ] [ ActiveCursor YVar ] [ Down Player ]
[ No ActiveCursor YVar ] [ ActiveCursor YVar ] [ Left Player ] -> [ CmdL ] [ ActiveCursor YVar ] [ Left Player ]
[ No ActiveCursor YVar ] [ ActiveCursor YVar ] [ Right Player ] -> [ CmdR ] [ ActiveCursor YVar ] [ Right Player ]
( replace active unique vars, each appears at most once )
[ Up Player ] [ ActiveCursor UniqueVar ] -> [ Player ] [ Right ActiveCursor CmdU ]
[ Down Player ] [ ActiveCursor UniqueVar ] -> [ Player ] [ Right ActiveCursor CmdD ]
[ Left Player ] [ ActiveCursor UniqueVar ] -> [ Player ] [ Right ActiveCursor CmdL ]
[ Right Player ] [ ActiveCursor UniqueVar ] -> [ Player ] [ Right ActiveCursor CmdR ]
( replace the active var )
( NOTE: This has a problem where multiple variables will all be filled in
at once, needed to make e.g. DX and LX work simply together. To avoid,
use the Unique Vars )
[ Up Player ] [ ActiveCursor Var ] -> [ Up Player ] [ Right ActiveCursor CmdU ]
[ Down Player ] [ ActiveCursor Var ] -> [ Down Player ] [ Right ActiveCursor CmdD ]
[ Left Player ] [ ActiveCursor Var ] -> [ Left Player ] [ Right ActiveCursor CmdL ]
[ Right Player ] [ ActiveCursor Var ] -> [ Right Player ] [ Right ActiveCursor CmdR ]
( kill any remaining unused active variables )
[ Right ActiveCursor ] [ ActiveCursor Var ] -> [ Right ActiveCursor ] [ Var ]
( strip any movement from the player )
[ Moving Player ] -> [ Player ]
( execute command )
[ Right ActiveCursor CmdU ] [ Player ] -> [ Right ActiveCursor CmdU ] [ Up Player ] again
[ Right ActiveCursor CmdD ] [ Player ] -> [ Right ActiveCursor CmdD ] [ Down Player ] again
[ Right ActiveCursor CmdL ] [ Player ] -> [ Right ActiveCursor CmdL ] [ Left Player ] again
[ Right ActiveCursor CmdR ] [ Player ] -> [ Right ActiveCursor CmdR ] [ Right Player ] again
[ No ActiveCursor ] [ Player Goal ] -> win
( if we're executing, player must move )
[ Right ActiveCursor ] [ Player ] -> [ Right ActiveCursor ] [ Player Shadow ]
late [ Player Shadow ] -> [ Tombstone ]
late [ Shadow ] -> []
( remove cursor on death )
late [ ActiveCursor ] [ Tombstone ] -> [] [ Tombstone]
late [ ActiveCursor Wall ] [ CursorStart ] -> [ ActiveCursor Wall ] [ InactiveCursor ]
late [ InactiveCursor Wall | UDLR ] -> [ CursorStart Wall | InactiveCursor UDLR ]
late [ ActiveCursor Wall ] -> [ Wall ]
==============
WINCONDITIONS
==============
=======
LEVELS
=======
#########
#.@#....#
#..#....#
#..#....#
#.......#
#......G#
#########
#CU######
#CD######
#CL######
#CR######
#########
message you can only follow the listed groups of commands
#########
#..@....#
#.......#
#.......#
#.......#
#....G..#
#########
#CLD#####
#CRD#####
#########
#########
#..#.#..#
#..#....#
#@.#.#..#
#..#.#..#
#....#.G#
#########
#CUU#####
#CDDD####
#CL######
#CR######
#########
#########
#.......#
#.#.#.#G#
#.......#
#@#.#.#.#
#.......#
#########
#CUR#####
#CRD#####
#CDL#####
#CLU#####
#########
message variables X, Y, I and J can be filled with a command when first used
#########
#.......#
#...###.#
#...#@#.#
#...#.#.#
#G..#...#
#########
#CUX#####
#CDY#####
#CLI#####
#CRJ#####
#########
#########
#.......#
#...#.G.#
#.......#
#.....#.#
#.@.....#
#.......#
#########
#CLXY####
#CRXY####
#########
#########
#......G#
#.......#
#..######
#.......#
#......@#
#########
#CUXXXXX#
#CDUYYYY#
#CLI#####
#CRJ#####
#########
#########
#......G#
#.......#
#.......#
#.......#
#.......#
#@......#
#########
#CRIJ####
#CDXX####
#########
#########
#.......#
#.......#
#.G.#..@#
#.......#
#.......#
#########
#CLXL####
#CRXR####
#CUXU####
#CDXD####
#########
message That's all for now, thanks for playing!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment