Skip to content

Instantly share code, notes, and snippets.

Created April 30, 2016 00:10
Show Gist options
  • Save anonymous/9b849fdaf60dfe6c9bf05a57ecf4a9b2 to your computer and use it in GitHub Desktop.
Save anonymous/9b849fdaf60dfe6c9bf05a57ecf4a9b2 to your computer and use it in GitHub Desktop.
title
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
(-
- PacPac
- Pacman clone in PuzzlEscript
-
- Code by 0x77
- version 0.8
-)
title V0.8 PacPac
homepage 0x77.bit
background_color #000
text_color #FFFF00
realtime_interval .13
( Disable while editing )
run_rules_on_level_start
( Enable (maybe?) while editing )
(verbose_logging)
(debug)
========
OBJECTS
========
( Background )
BACKGROUND
BLACK
( Player )
PLAYER
BLACK
CLONE
TRANSPARENT
FRAME
TRANSPARENT #FFFF00
01110
11111
11111
11111
01110
PAC_S
TRANSPARENT #FFFF00
01110
11111
11111
11111
01110
PAC_U
TRANSPARENT #FFFF00
00000
10001
11011
11111
01110
PAC_D
TRANSPARENT #FFFF00
01110
11111
11011
10001
00000
PAC_L
TRANSPARENT #FFFF00
01110
00111
00011
00111
01110
PAC_R
TRANSPARENT #FFFF00
01110
11100
11000
11100
01110
( Ghosts )
GHOST_A
BLACK #FF0000 WHITE
01110
12121
11111
11111
10101
GHOST_B
BLACK #33FFFF WHITE
01110
12121
11111
11111
10101
GHOST_C
BLACK #FF99CC WHITE
01110
12121
11111
11111
10101
GHOST_D
BLACK #FFCC33 WHITE
01110
12121
11111
11111
10101
( PillS )
PILL
BLACK #FFB897
00000
00000
00100
00000
00000
SPECIAL
BLACK #FFB897
00000
01110
01110
01110
00000
( Walls )
WALL_H
BLACK #1818FF
00000
11111
00000
11111
00000
WALL_V
BLACK #1818FF
01010
01010
01010
01010
01010
WALL_SH
BLACK #1818FF
00000
00000
11111
00000
00000
WALL_SV
BLACK #1818FF
00100
00100
00100
00100
00100
WALL_SDD
BLACK #1818FF
00000
00000
11011
00100
00100
WALL_SL
BLACK #1818FF
00000
00000
00011
00100
00100
WALL_SLD
BLACK #1818FF
00100
00100
00011
00000
00000
WALL_SR
BLACK #1818FF
00000
00000
11000
00100
00100
WALL_SRD
BLACK #1818FF
00100
00100
11000
00000
00000
TP_L
BLACK
TP_R
BLACK
( Tokens )
R_TICK '
TRANSPARENT
M_TICK "
TRANSPARENT
PATH
TRANSPARENT
WALK
TRANSPARENT
T_NORMAL
BLACK
T_ENERGY
BLACK
TEMP
BLACK
U
TRANSPARENT
D
TRANSPARENT
L
TRANSPARENT
R
TRANSPARENT
X
TRANSPARENT
Y
TRANSPARENT
Z
TRANSPARENT
( Numbers )
CNT
BLACK
N0
WHITE
.00..
0..0.
0..0.
0..0.
.00..
N1
WHITE
..0..
.00..
..0..
..0..
.000.
N2
WHITE
000..
...0.
.00..
0....
0000.
N3
WHITE
000..
...0.
.00..
...0.
000..
N4
WHITE
..0..
.00..
0.0..
0000.
..0..
N5
WHITE
0000.
0....
000..
...0.
000..
N6
WHITE
.00..
0....
000..
0..0.
.00..
N7
WHITE
0000.
...0.
..0..
.0...
0....
N8
WHITE
.00..
0..0.
.00..
0..0.
.00..
N9
WHITE
.00..
0..0.
.000.
...0.
000..
=======
LEGEND
=======
( Entities )
GHOST = GHOST_A or GHOST_B or GHOST_C or GHOST_D
DUMB = GHOST_B or GHOST_C or GHOST_D
( Walls )
WALL = WALL_H or WALL_V or WALL_SH or WALL_SV or WALL_SDD or WALL_SL or WALL_SLD or WALL_SR or WALL_SRD
( Sprites )
PAC_SPR = PAC_S or PAC_U or PAC_D or PAC_L or PAC_R
( Pathfinding )
THING = WALL or PATH or TP_L or TP_R
ENT = BACKGROUND or PILL or SPECIAL
( Token )
DIR = U or D or L or R
( Numbers )
DIGIT = N0 or N1 or N2 or N3 or N4 or N5 or N6 or N7 or N8 or N9
( Letters )
. = BACKGROUND
@ = PLAYER
$ = CLONE
! = PILL and CLONE
_ = CNT
* = N0
ü = GHOST_A
é = GHOST_B
â = GHOST_C
ä = GHOST_D
• = PILL
○ = SPECIAL
TIMER = T_NORMAL or T_ENERGY
═ = WALL_H
║ = WALL_V
─ = WALL_SH
│ = WALL_SV
┬ = WALL_SDD
┌ = WALL_SL
└ = WALL_SLD
┐ = WALL_SR
┘ = WALL_SRD
« = TP_L
» = TP_R
: = T_NORMAL
; = T_ENERGY
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
( BG )
BACKGROUND
( Map )
TP_L TP_R
( Entity )
PLAYER
PAC_SPR
PILL SPECIAL
FRAME
GHOST WALL
CLONE
( Token )
R_TICK M_TICK
PATH WALK
T_NORMAL T_ENERGY TEMP
DIR
X
Y
Z
( Numbers )
CNT
DIGIT
======
RULES
======
( Realtime fix )
[ STATIONARY @ ] ["] -> [ @ ] [']
[ MOVING @ ] ['] -> [ MOVING @ ] ["]
( Player movement )
[ @ NO PAC_SPR ] -> [ @ PAC_S ]
UP [ PAC_D U | NO WALL ] -> [ PAC_D | ]
DOWN [ PAC_U D | NO WALL ] -> [ PAC_U | ]
LEFT [ PAC_R L | NO WALL ] -> [ PAC_R | ]
RIGHT [ PAC_L R | NO WALL ] -> [ PAC_L | ]
UP [ PAC_SPR U | NO WALL ] -> [ PAC_U | ]
DOWN [ PAC_SPR D | NO WALL ] -> [ PAC_D | ]
LEFT [ PAC_SPR L | NO WALL ] -> [ PAC_L | ]
RIGHT [ PAC_SPR R | NO WALL ] -> [ PAC_R | ]
UP [ > @ PAC_SPR | WALL ] -> [ @ PAC_SPR X U | WALL ]
DOWN [ > @ PAC_SPR | WALL ] -> [ @ PAC_SPR X D | WALL ]
LEFT [ > @ PAC_SPR | WALL ] -> [ @ PAC_SPR X L | WALL ]
RIGHT [ > @ PAC_SPR | WALL ] -> [ @ PAC_SPR X R | WALL ]
UP [ > @ | NO WALL ] -> [ @ PAC_U X | ]
DOWN [ > @ | NO WALL ] -> [ @ PAC_D X | ]
LEFT [ > @ | NO WALL ] -> [ @ PAC_L X | ]
RIGHT [ > @ | NO WALL ] -> [ @ PAC_R X | ]
LATE [ @ PILL ] [ _ ] -> [ @ ] [ _ X ]
LATE [ @ SPECIAL ] [ TIMER ] [ _ ] -> [ @ ] [ ; ] [ _ ]
UP ['][ @ PAC_U X DIR FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_U Y DIR FRAME ]
DOWN ['][ @ PAC_D X DIR FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_D Y DIR FRAME ]
LEFT ['][ @ PAC_L X DIR FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_L Y DIR FRAME ]
RIGHT ['][ @ PAC_R X DIR FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_R Y DIR FRAME ]
UP ['][ @ PAC_U X DIR | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_U Y DIR ]
DOWN ['][ @ PAC_D X DIR | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_D Y DIR ]
LEFT ['][ @ PAC_L X DIR | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_L Y DIR ]
RIGHT ['][ @ PAC_R X DIR | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_R Y DIR ]
UP ['][ @ PAC_U X FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_U Y FRAME ]
DOWN ['][ @ PAC_D X FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_D Y FRAME ]
LEFT ['][ @ PAC_L X FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_L Y FRAME ]
RIGHT ['][ @ PAC_R X FRAME | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_R Y FRAME ]
UP ['][ @ PAC_U X | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_U Y ]
DOWN ['][ @ PAC_D X | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_D Y ]
LEFT ['][ @ PAC_L X | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_L Y ]
RIGHT ['][ @ PAC_R X | NO WALL ENT ] -> ['][ TEMP | ENT @ PAC_R Y ]
[ @ PAC_SPR Y ] -> [ @ PAC_SPR X ]
UP [ @ | TEMP ] [ CLONE ] -> [ @ | ] [ > CLONE ]
DOWN [ @ | TEMP ] [ CLONE ] -> [ @ | ] [ > CLONE ]
LEFT [ @ | TEMP ] [ CLONE ] -> [ @ | ] [ > CLONE ]
RIGHT [ @ | TEMP ] [ CLONE ] -> [ @ | ] [ > CLONE ]
[ TEMP NO @ ] -> []
LEFT [ @ | « ] [ » ] [ CLONE ] -> [ @ | « ] [ » CLONE ] []
RIGHT [ @ | » ] [ « ] [ CLONE ] -> [ @ | » ] [ « CLONE ] []
[ @ PAC_SPR DIR » NO Z ] [ « ] -> [ » ] [ @ PAC_SPR X DIR « Z ]
[ @ PAC_SPR DIR « NO Z ] [ » ] -> [ « ] [ @ PAC_SPR X DIR » Z ]
[ @ PAC_SPR » NO Z ] [ « ] -> [ » ] [ @ PAC_SPR X « Z ]
[ @ PAC_SPR « NO Z ] [ » ] -> [ « ] [ @ PAC_SPR X » Z ]
[ Z ] -> []
['][ PAC_SPR NO FRAME NO Z ] -> ['][ PAC_SPR FRAME Z ]
['][ PAC_SPR FRAME NO Z ] -> ['][ PAC_SPR Z ]
LATE [ FRAME NO PAC_SPR ] -> []
LATE [ @ GHOST ] -> RESTART
( Score )
RIGHT [ DIGIT | _ X ] -> [ DIGIT X | _ ]
STARTLOOP
LATE [ N0 X ] -> [ N1 ]
LATE [ N1 X ] -> [ N2 ]
LATE [ N2 X ] -> [ N3 ]
LATE [ N3 X ] -> [ N4 ]
LATE [ N4 X ] -> [ N5 ]
LATE [ N5 X ] -> [ N6 ]
LATE [ N6 X ] -> [ N7 ]
LATE [ N7 X ] -> [ N8 ]
LATE [ N8 X ] -> [ N9 ]
LATE LEFT [ N9 X | DIGIT ] -> [ N0 | DIGIT X ]
ENDLOOP
( Pathfinding )
[:][ @ ] -> [:][ @ UP PATH ]
[;][ $ ] -> [;][ $ UP PATH ]
RANDOM ['][ DUMB ] -> ['][ RANDOMDIR DUMB ]
[ UP PATH | NO THING ] -> [ UP PATH | RIGHT PATH ]
+ [ RIGHT PATH | NO THING ] -> [ RIGHT PATH | DOWN PATH ]
+ [ DOWN PATH | NO THING ] -> [ DOWN PATH | UP PATH ]
STARTLOOP
RANDOM ['][ STATIONARY GHOST DOWN PATH | RIGHT PATH ] -> ['][ > GHOST DOWN PATH | RIGHT PATH ]
RANDOM ['][ STATIONARY GHOST RIGHT PATH | UP PATH ] -> ['][ > GHOST RIGHT PATH | UP PATH ]
RANDOM ['][ STATIONARY GHOST UP PATH | DOWN PATH ] -> ['][ > GHOST UP PATH | DOWN PATH ]
ENDLOOP
[ PATH ] -> []
==============
WINCONDITIONS
==============
NO PILL
NO SPECIAL
=======
LEVELS
=======
..***_....................:'.
.............................
.┌════════════┬════════════┐.
.║••••••••••••│••••••••••••║.
.║•┌──┐•┌───┐•│•┌───┐•┌──┐•║.
.║○│..│•│...│•│•│...│•│..│○║.
.║•└──┘•└───┘•│•└───┘•└──┘•║.
.║••••••••••••!••••••••••••║.
.║•┌──┐•┌┐•┌─────┐•┌┐•┌──┐•║.
.║•└──┘•││•└──┬──┘•││•└──┘•║.
.║••••••││••••│••••││••••••║.
.└════┐•│└──┐.│.┌──┘│•┌════┘.
......║•│┌──┘.│.└──┐│•║......
......║•││....ü....││•║......
......║•││.┌═...═┐.││•║......
.═════┘•└┘.║é....║.└┘•└═════.
«......•...║.....║...•......»
.═════┐•┌┐.║.â..ä║.┌┐•┌═════.
......║•││.└═════┘.││•║......
......║•││.........││•║......
......║•││.┌─────┐.││•║......
.┌════┘•└┘.└──┬──┘.└┘•└════┐.
.║••••••••••••│••••••••••••║.
.║•┌──┐•┌───┐•│•┌───┐•┌──┐•║.
.║•└─┐│•└───┘•│•└───┘•│┌─┘•║.
.║○••││•••••••@•••••••││••○║.
.└─┐•││•┌┐•┌─────┐•┌┐•││•┌─┘.
.┌─┘•└┘•││•└──┬──┘•││•└┘•└─┐.
.║••••••││••••│••••││••••••║.
.║•┌────┘└──┐•│•┌──┘└────┐•║.
.║•└────────┘•│•└────────┘•║.
.║•••••••••••••••••••••••••║.
.└═════════════════════════┘.
.............................
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment