Skip to content

Instantly share code, notes, and snippets.

@thacuber2a03
Created September 7, 2020 00:32
Show Gist options
  • Save thacuber2a03/aec490ffc0db30de66e7abd2cf0d086f to your computer and use it in GitHub Desktop.
Save thacuber2a03/aec490ffc0db30de66e7abd2cf0d086f to your computer and use it in GitHub Desktop.
Random Dungeon (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Random Dungeon
author Tha Cuber
homepage thacuber.itch.io
run_rules_on_level_start
key_repeat_interval 0.5
flickscreen 7x7
========
OBJECTS
========
PlayerD
blue black lightbrown brown
.333.
.222.
00000
.000.
.1.1.
PlayerU
blue black brown
.222.
.222.
00000
.000.
.1.1.
PlayerR
blue black lightbrown brown
.333.
.322.
.000.
.000.
..1..
PlayerL
blue black lightbrown brown
.333.
.223.
.000.
.000.
..1..
PlayerDSword
blue black lightbrown brown lightgray
.333.
.2224
00003
.000.
.1.1.
PlayerUSword
blue black brown lightgray
.222.
.2223
00002
.000.
.1.1.
PlayerRSword
blue black lightbrown brown lightgray
.333.
.3224
.0003
.000.
..1..
PlayerLSword
blue black lightbrown brown lightgray
.333.
4223.
3000.
.000.
..1..
PlayerDKey
blue black lightbrown brown yellow
.333.
4222.
00000
.000.
.1.1.
PlayerUKey
blue black brown yellow
.222.
.2223
00000
.000.
.1.1.
PlayerRKey
blue black lightbrown brown yellow
.333.
.322.
.0004
.000.
..1..
PlayerLKey
blue black lightbrown brown yellow
.333.
.223.
4000.
.000.
..1..
Slime
lightgreen
.....
..0..
.000.
00000
.....
Walls
gray darkgray lightgray
11110
10002
10002
10002
02222
Floor
gray
Floor2
gray darkgray
00010
01000
00001
10000
00100
RandomEnviroment
red
RandomTreasure
yellow
Sword
lightgray brown
..0..
.000.
.000.
11111
..1..
Coin
yellow white
.001.
00001
00001
00001
.001.
Gem
green lightgreen white
.012.
00012
00012
00012
.012.
SlimeKilled
lightgreen green darkgreen
..0..
.010.
01210
.010.
..0..
Door
brown yellow
.000.
00000
00011
00000
00000
Door_anim1
brown yellow black blue lightbrown
.0000
00444
03333
00333
00202
Door_anim2
brown yellow black blue lightbrown
.0000
00444
00333
00333
00202
Door_anim3
brown yellow black blue lightbrown
02000
00444
03333
00333
00222
Door_anim4
brown yellow black blue lightbrown
.0000
00044
00133
00033
00022
Door_anim5
brown yellow black blue lightbrown
.0000
00004
00013
00003
00002
Door_anim6
brown yellow
.000.
00000
00011
00000
00000
Key
Yellow
.....
...00
00000
0..00
.....
KeySpace
grey
=======
LEGEND
=======
P = PlayerD
. = Floor
F = Floor2
W = Walls
R = RandomEnviroment
T = RandomTreasure
S = Sword
L = Slime
Y = Door
I = KeySpace
Player = PlayerD or PlayerR or PlayerU or PlayerL or PlayerDSword or PlayerUSword or PlayerRSword or PlayerLSword or PlayerDKey or PlayerUKey or PlayerRKey or PlayerLKey
Object = Floor or Floor2 or Walls
Object2 = Floor2 or Walls
Background = Floor
Treasure = Coin or Gem
=======
SOUNDS
=======
Player move 39105507
sfx0 18461908
sfx1 77607302
sfx2 49793708
================
COLLISIONLAYERS
================
Background
Floor2, RandomEnviroment, RandomTreasure
Door_anim1, Door_anim2, Door_anim3, Door_anim4, Door_anim5, Door_anim6
Sword, Coin, Gem, SlimeKilled, Door, KeySpace, Key
Walls, Player, Slime
======
RULES
======
(game needs key to win)
[ Object2 KeySpace ] -> restart
(randomness)
[ RandomEnviroment ] -> [ random Object ]
[ RandomTreasure ] -> [ random Treasure ]
( player movement )
right [ > PlayerD ] -> [ > PlayerR ]
left [ > PlayerD ] -> [ > PlayerL ]
up [ > PlayerD ] -> [ > PlayerU ]
down [ > PlayerD] -> [ > PlayerD ]
right [ > PlayerU ] -> [ > PlayerR ]
left [ > PlayerU ] -> [ > PlayerL ]
up [ > PlayerU ] -> [ > PlayerU ]
down [ > PlayerU] -> [ > PlayerD ]
right [ > PlayerL ] -> [ > PlayerR ]
left [ > PlayerL ] -> [ > PlayerL ]
up [ > PlayerL ] -> [ > PlayerU ]
down [ > PlayerL] -> [ > PlayerD ]
right [ > PlayerR ] -> [ > PlayerR ]
left [ > PlayerR ] -> [ > PlayerL ]
up [ > PlayerR ] -> [ > PlayerU ]
down [ > PlayerR] -> [ > PlayerD ]
( player and sword)
[ action Player Sword ] -> [ PlayerDSword Floor ] sfx0 message Got Sword!
right [ > PlayerDSword ] -> [ > PlayerRSword ]
left [ > PlayerDSword ] -> [ > PlayerLSword ]
up [ > PlayerDSword ] -> [ > PlayerUSword ]
down [ > PlayerDSword] -> [ > PlayerDSword ]
right [ > PlayerUSword ] -> [ > PlayerRSword]
left [ > PlayerUSword ] -> [ > PlayerLSword ]
up [ > PlayerUSword ] -> [ > PlayerUSword ]
down [ > PlayerUSword] -> [ > PlayerDSword ]
right [ > PlayerLSword ] -> [ > PlayerRSword]
left [ > PlayerLSword ] -> [ > PlayerLSword ]
up [ > PlayerLSword ] -> [ > PlayerUSword ]
down [ > PlayerLSword] -> [ > PlayerDSword]
right [ > PlayerRSword] -> [ > PlayerRSword ]
left [ > PlayerRSword ] -> [ > PlayerLSword ]
up [ > PlayerRSword ] -> [ > PlayerUSword ]
down [ > PlayerRSword] -> [ > PlayerDSword]
(coin)
late [ Player Coin ] -> [ Player Floor ]
late [ Player Gem ] -> [ Player Floor ]
(slime behavior)
[ stationary Slime ] -> [ randomDir Slime ]
(sword behavior)
late [ Sword | Walls ] -> restart
down [ Action PlayerDSword | Slime ] -> [ PlayerDSword | SlimeKilled ] sfx1
up [ Action PlayerUSword | Slime ] -> [ PlayerUSword | SlimeKilled ] sfx1
left [ Action PlayerLSword | Slime ] -> [ PlayerLSword | SlimeKilled ] sfx1
right [ Action PlayerRSword | Slime ] -> [ PlayerRSword | SlimeKilled ] sfx1
[ Action PlayerDKey Sword ] -> [ PlayerDSword Key ] message Got Sword! Dropped key.
[ Action PlayerUKey Sword ] -> [ PlayerDSword Key ] message Got Sword! Dropped key.
[ Action PlayerRKey Sword ] -> [ PlayerDSword Key ] message Got Sword! Dropped key.
[ Action PlayerLKey Sword ] -> [ PlayerDSword Key ] message Got Sword! Dropped key.
(keyspace behavior)
late [ KeySpace | ... | no Slime ] -> [ Key | ... | ]
late [ Key | ... | Slime ] -> [ KeySpace | ... | Slime ]
(key behavior)
[Action Player Key ] -> [ PlayerDKey Floor ] message Got Key!
[Action PlayerDSword Key ] -> [ PlayerDKey Sword ] message Got key! Dropped Sword.
[ Action PlayerRSword Key ] -> [ PlayerDKey Sword ] message Got key! Dropped Sword.
[ Action PlayerLSword Key ] -> [ PlayerDKey Sword ] message Got key! Dropped Sword.
[ Action PlayerUSword Key ] -> [ PlayerDKey Sword ] message Got key! Dropped Sword.
[ Action PlayerDKey Door ] -> [ Background Door_anim1 ]
[ Action PlayerUKey Door ] -> [ Background Door_anim1 ]
[ Action PlayerLKey Door ] -> [ Background Door_anim1 ]
[ Action PlayerRKey Door ] -> [ Background Door_anim1 ]
(door animation)
[ Door_anim6 ] -> [ Door ] again
[ Door_anim5 ] -> [ Door_anim6 ] again
[ Door_anim3 ] -> [ Door_anim4 ] again
[ Door_anim2 ] -> [ Door_anim3 ] again
[ Door_anim1 ] -> [ Door_anim2 ] again
(player and key)
right [ > PlayerDKey ] -> [ > PlayerRKey ]
left [ > PlayerDKey ] -> [ > PlayerLKey ]
up [ > PlayerDKey ] -> [ > PlayerUKey ]
down [ > PlayerDKey] -> [ > PlayerDKey ]
right [ > PlayerUKey ] -> [ > PlayerRKey ]
left [ > PlayerUKey ] -> [ > PlayerLKey ]
up [ > PlayerUKey ] -> [ > PlayerUKey ]
down [ > PlayerUKey] -> [ > PlayerDKey ]
right [ > PlayerLKey ] -> [ > PlayerRKey ]
left [ > PlayerLKey ] -> [ > PlayerLKey ]
up [ > PlayerLKey ] -> [ > PlayerUKey ]
down [ > PlayerLKey] -> [ > PlayerDKey ]
right [ > PlayerRKey ] -> [ > PlayerRKey ]
left [ > PlayerRKey ] -> [ > PlayerLKey ]
up [ > PlayerRKey ] -> [ > PlayerUKey ]
down [ > PlayerRKey] -> [ > PlayerDKey ]
==============
WINCONDITIONS
==============
no Gem
no Slime
no Coin
no Player
some Door
=======
LEVELS
=======
message Note: the terrain gen can be a little... faulty, at times.
message So, if you see that you can't collect everything and kill every enemy, restart the game.
message Press ACTION to interact with things.
message Try to get out of this dungeon.
yrrtrrtrtrrlrs
rlrrrlrtlrrtrr
rlrtrrlrtrtrrr
rrtrlrtirlrrrr
rlrrrrtrrrrrlr
..rrltrrrlrrrr
P.rrrrtrrtrrrr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment