Skip to content

Instantly share code, notes, and snippets.

@Stingby12
Created November 12, 2025 07:28
Show Gist options
  • Select an option

  • Save Stingby12/0e5c0ec82b9c0fded1ec4182214d4003 to your computer and use it in GitHub Desktop.

Select an option

Save Stingby12/0e5c0ec82b9c0fded1ec4182214d4003 to your computer and use it in GitHub Desktop.
Inventory Knight (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Inventory Knight
author Stingby12
homepage www.puzzlescript.net
background_color #2e222f
text_color #d6dad3
run_rules_on_level_start
(
verbose_logging
)
(
https://lospec.com/palette-list/dungeon-20
#2e222f
#45293f
#7a3045
#993d41
#cd683d
#fbb954
#28353e
#344a5a
#407080
#508da0
#5bbfc5
#f2ec8b
#b0a987
#997f73
#665964
#443846
#576069
#788a87
#d6dad3
#a9b2a2
)
========
OBJECTS
========
Background
#2e222f #45293f
00010
11111
01000
11111
00010
Void
#2e222f
Inv
transparent #665964
00000
00000
00100
00000
00000
InvFirst
transparent #665964
00000
00000
00100
00000
00000
CurSlot
transparent
Wall
#a9b2a2 #788a87 #d6dad3
01000
11111
00010
11111
01000
WallBU
#d6dad3
00000
.....
.....
.....
.....
WallBD
#d6dad3
.....
.....
.....
.....
00000
WallBL
#d6dad3
0....
0....
0....
0....
0....
WallBR
#d6dad3
....0
....0
....0
....0
....0
WallBUL
#d6dad3
0....
.....
.....
.....
.....
WallBDL
#d6dad3
.....
.....
.....
.....
0....
WallBUR
#d6dad3
....0
.....
.....
.....
.....
WallBDR
#d6dad3
.....
.....
.....
.....
....0
Wall2
#665964 #997f73 #b0a987
22221
21110
21110
21110
10000
PlayerD
#788a87 #443846 #576069 #993d41
.000.
.111.
.010.
32223
.2.2.
PlayerL
#788a87 #443846 #576069 #993d41
.0003
.1103
.100.
32223
.2.2.
PlayerU
#788a87 #443846 #576069 #993d41
.030.
.030.
.000.
32223
.2.2.
PlayerR
#788a87 #443846 #576069 #993d41
3000.
3011.
.001.
32223
.2.2.
Sword
#788a87 #a9b2a2 #d6dad3 #cd683d
.....
..21.
3210.
.30..
3.3..
Spear
#788a87 #a9b2a2 #d6dad3 #cd683d
...21
..210
..30.
.3...
3....
Axe
#788a87 #a9b2a2 #d6dad3 #cd683d
.22.3
.213.
..310
.3.00
3....
Bow
#788a87 #a9b2a2 #d6dad3 #cd683d #993d41
333.2
1..4.
.14.3
.41.3
4..13
Swap
#fbb954 #f2ec8b #b0a987
.222.
2...2
2..2.
.211.
..10.
SwordInv
#788a87 #a9b2a2 #d6dad3 #cd683d
.....
..21.
3210.
.30..
3.3..
SpearInv
#788a87 #a9b2a2 #d6dad3 #cd683d
...21
..210
..30.
.3...
3....
AxeInv
#788a87 #a9b2a2 #d6dad3 #cd683d
.22.3
.213.
..310
.3.00
3....
BowInv
#788a87 #a9b2a2 #d6dad3 #cd683d #993d41
333.2
1..4.
.14.3
.41.3
4..13
CollectTP
transparent
SwordTP
transparent
SpearTP
transparent
AxeTP
transparent
BowTP
transparent
AttU
#993d41
...00
..00.
..00.
.00..
00...
AttD
#993d41
...00
..00.
..00.
.00..
00...
AttL
#993d41
...00
..00.
..00.
.00..
00...
AttR
#993d41
...00
..00.
..00.
.00..
00...
AttTP
#993d41
...00
..00.
..00.
.00..
00...
AttExtU
transparent
AttExtD
transparent
AttExtL
transparent
AttExtR
transparent
SlimeB
#407080 #508da0 #5bbfc5 #d6dad3 #2e222f
.....
.222.
01312
03432
00302
SlimeR
#7a3045 #993d41 #cd683d #d6dad3 #2e222f
.....
.222.
01312
03432
00302
DodgeU
transparent
DodgeD
transparent
DodgeL
transparent
DodgeR
transparent
Skeleton
#d6dad3 #a9b2a2
.000.
.101.
.000.
0.0.0
.0.0.
SkeletonDm
#d6dad3 #a9b2a2 #788a87 #576069
.112.
.213.
.101.
1.1..
.0.1.
DamageTP
transparent
=======
LEGEND
=======
. = Background
▪ = Void
▫ = Void and Inv
¤ = Void and InvFirst and CurSlot
# = Wall
% = Wall2
P = PlayerD
^ = SlimeB
v = SlimeR
$ = Skeleton
! = Sword
| = Spear
- = Axe
] = Bow
~ = Swap
InvAll = Inv or InvFirst
Walls = Wall or Wall2
Player = PlayerD or PlayerL or PlayerU or PlayerR
SkeletonAll = Skeleton or SkeletonDm
Enemy = SlimeB or SlimeR or SkeletonAll
Weapon = Sword or Spear or Axe or Bow or Swap
WeaponInv = SwordInv or SpearInv or AxeInv or BowInv
WeaponTP = SwordTP or SpearTP or AxeTP or BowTP
AttX = AttU or AttD or AttL or AttR
AttExt = AttExtU or AttExtD or AttExtL or AttExtR
Dodge = DodgeU or DodgeD or DodgeL or DodgeR
Block = Walls or Enemy or Player or Weapon or AttX
=======
SOUNDS
=======
Player move 71751707
Sword destroy 81914703
Spear destroy 81914703
Axe destroy 81914703
Bow destroy 81914703
Swap destroy 95887503
AttX create 54509502
sfx0 52526904
sfx1 23676102
endlevel 24481902
================
COLLISIONLAYERS
================
Background
CollectTP
WeaponTP
Weapon
CurSlot
Player, Walls, Void, Enemy
AttX
AttExtU
AttExtD
AttExtL
AttExtR
DodgeU
DodgeD
DodgeL
DodgeR
AttTP
DamageTP
InvAll
WallBU
WallBD
WallBL
WallBR
WallBUL
WallBDL
WallBUR
WallBDR
WeaponInv
======
RULES
======
up [ Wall | no Wall no Void ] -> [ Wall WallBU |]
down [ Wall | no Wall no Void ] -> [ Wall WallBD |]
left [ Wall | no Wall no Void ] -> [ Wall WallBL |]
right [ Wall | no Wall no Void ] -> [ Wall WallBR |]
down [ WallBL | Wall no WallBL ] -> [ WallBL | Wall WallBUL ]
up [ WallBL | Wall no WallBL ] -> [ WallBL | Wall WallBDL ]
down [ WallBR | Wall no WallBR ] -> [ WallBR | Wall WallBUR ]
up [ WallBR | Wall no WallBR ] -> [ WallBR | Wall WallBDR ]
[ up Player ] -> [ up PlayerU ]
[ down Player ] -> [ down PlayerD ]
[ left Player ] -> [ left PlayerL ]
[ right Player ] -> [ right PlayerR ]
[ > Player | Weapon ] -> [ > Player | Weapon CollectTP ]
right [ Swap CollectTP ] [ InvFirst SwordInv | no CurSlot ] -> [ Swap CollectTP ] [ InvFirst SwordTP | ]
right [ Swap CollectTP ] [ InvFirst SpearInv | no CurSlot ] -> [ Swap CollectTP ] [ InvFirst SpearTP | ]
right [ Swap CollectTP ] [ InvFirst AxeInv | no CurSlot ] -> [ Swap CollectTP ] [ InvFirst AxeTP | ]
right [ Swap CollectTP ] [ InvFirst BowInv | no CurSlot ] -> [ Swap CollectTP ] [ InvFirst BowTP | ]
right [ Swap CollectTP ] [ no WeaponInv | WeaponInv ] -> [ Swap CollectTP ] [ WeaponInv | ]
right [ Swap CollectTP ] [ no WeaponInv | CurSlot ] -> [ Swap CollectTP ] [ | left CurSlot ]
late right [ Swap CollectTP ] [ SwordTP ] [ CurSlot | ] -> [ ] [ ] [ SwordInv | CurSlot ]
late right [ Swap CollectTP ] [ SpearTP ] [ CurSlot | ] -> [ ] [ ] [ SpearInv | CurSlot ]
late right [ Swap CollectTP ] [ AxeTP ] [ CurSlot | ] -> [ ] [ ] [ AxeInv | CurSlot ]
late right [ Swap CollectTP ] [ BowTP ] [ CurSlot | ] -> [ ] [ ] [ BowInv | CurSlot ]
[ CollectTP ] [ stationary CurSlot no InvAll ] -> cancel sfx1
[ Sword CollectTP ] [ CurSlot ] -> [ ] [ right CurSlot SwordInv ]
[ Spear CollectTP ] [ CurSlot ] -> [ ] [ right CurSlot SpearInv ]
[ Axe CollectTP ] [ CurSlot ] -> [ ] [ right CurSlot AxeInv ]
[ Bow CollectTP ] [ CurSlot ] -> [ ] [ right CurSlot BowInv ]
late [ CollectTP ] -> [ ]
right [ action Player ] [ SwordInv | CurSlot ] -> [ action Player SwordTP ] [ | left CurSlot ]
right [ action Player ] [ SpearInv | CurSlot ] -> [ action Player SpearTP ] [ | left CurSlot ]
right [ action Player ] [ AxeInv | CurSlot ] -> [ action Player AxeTP ] [ | left CurSlot ]
right [ action Player ] [ BowInv | CurSlot ] -> [ action Player BowTP ] [ | left CurSlot ]
[ AttTP ] -> [ ]
(sword)
up [ PlayerU SwordTP | ] -> [ PlayerU | AttU ] again
down [ PlayerD SwordTP | ] -> [ PlayerD | AttD ] again
left [ PlayerL SwordTP | ] -> [ PlayerL | AttL ] again
right [ PlayerR SwordTP | ] -> [ PlayerR | AttR ] again
(spear)
up [ PlayerU SpearTP | Walls ] -> [ PlayerU | AttU ] again
down [ PlayerD SpearTP | Walls ] -> [ PlayerD | AttD ] again
left [ PlayerL SpearTP | Walls ] -> [ PlayerL | AttL ] again
right [ PlayerR SpearTP | Walls ] -> [ PlayerR | AttR ] again
up [ PlayerU SpearTP | ] -> [ PlayerU SpearTP | AttU AttExtU ] again
down [ PlayerD SpearTP | ] -> [ PlayerD SpearTP | AttD AttExtD ] again
left [ PlayerL SpearTP | ] -> [ PlayerL SpearTP | AttL AttExtL ] again
right [ PlayerR SpearTP | ] -> [ PlayerR SpearTP | AttR AttExtR ] again
up [ SpearTP ] [ AttExtU | no Walls ] -> [ ] [ | AttU ]
down [ SpearTP ] [ AttExtD | no Walls ] -> [ ] [ | AttD ]
left [ SpearTP ] [ AttExtL | no Walls ] -> [ ] [ | AttL ]
right [ SpearTP ] [ AttExtR | no Walls ] -> [ ] [ | AttR ]
[ SpearTP no InvAll ] -> [ ]
(axe)
up [ PlayerU AxeTP | Walls ] -> [ PlayerU | AttU ] again
down [ PlayerD AxeTP | Walls ] -> [ PlayerD | AttD ] again
left [ PlayerL AxeTP | Walls ] -> [ PlayerL | AttL ] again
right [ PlayerR AxeTP | Walls ] -> [ PlayerR | AttR ] again
up [ PlayerU AxeTP | ] -> [ PlayerU AxeTP | AttU AttExtL AttExtR ] again
down [ PlayerD AxeTP | ] -> [ PlayerD AxeTP | AttD AttExtL AttExtR ] again
left [ PlayerL AxeTP | ] -> [ PlayerL AxeTP | AttL AttExtU AttExtD ] again
right [ PlayerR AxeTP | ] -> [ PlayerR AxeTP | AttR AttExtU AttExtD ] again
up [ AxeTP ] [ PlayerL ] [ AttExtU | no Walls ] -> [ AxeTP ] [ PlayerL ] [ | AttL ]
down [ AxeTP ] [ PlayerL ] [ AttExtD | no Walls ] -> [ AxeTP ] [ PlayerL ] [ | AttL ]
up [ AxeTP ] [ PlayerR ] [ AttExtU | no Walls ] -> [ AxeTP ] [ PlayerR ] [ | AttR ]
down [ AxeTP ] [ PlayerR ] [ AttExtD | no Walls ] -> [ AxeTP ] [ PlayerR ] [ | AttR ]
left [ AxeTP ] [ PlayerU ] [ AttExtL | no Walls ] -> [ AxeTP ] [ PlayerU ] [ | AttU ]
right [ AxeTP ] [ PlayerU ] [ AttExtR | no Walls ] -> [ AxeTP ] [ PlayerU ] [ | AttU ]
left [ AxeTP ] [ PlayerD ] [ AttExtL | no Walls ] -> [ AxeTP ] [ PlayerD ] [ | AttD ]
right [ AxeTP ] [ PlayerD ] [ AttExtR | no Walls ] -> [ AxeTP ] [ PlayerD ] [ | AttD ]
[ AxeTP no InvAll ] -> [ ]
(bow)
up [ PlayerU BowTP | Wall ] -> [ PlayerU | AttU ] again
down [ PlayerD BowTP | Wall ] -> [ PlayerD | AttD ] again
left [ PlayerL BowTP | Wall ] -> [ PlayerL | AttL ] again
right [ PlayerR BowTP | Wall ] -> [ PlayerR | AttR ] again
up [ PlayerU BowTP | ] -> [ PlayerU BowTP | AttExtU ] again
down [ PlayerD BowTP | ] -> [ PlayerD BowTP | AttExtD ] again
left [ PlayerL BowTP | ] -> [ PlayerL BowTP | AttExtL ] again
right [ PlayerR BowTP | ] -> [ PlayerR BowTP | AttExtR ] again
up [ BowTP ] [ AttExtU | ] -> [ ] [ | AttU ]
down [ BowTP ] [ AttExtD | ] -> [ ] [ | AttD ]
left [ BowTP ] [ AttExtL | ] -> [ ] [ | AttL ]
right [ BowTP ] [ AttExtR | ] -> [ ] [ | AttR ]
[ BowTP no InvAll ] -> [ ]
[ Dodge ] -> [ ]
up [ SlimeR | no Block ] -> [ SlimeR | DodgeU ]
down [ SlimeR | no Block ] -> [ SlimeR | DodgeD ]
left [ SlimeR | no Block ] -> [ SlimeR | DodgeL ]
right [ SlimeR | no Block ] -> [ SlimeR | DodgeR ]
up [ AttU stationary SlimeR | DodgeU ] -> [ AttU up SlimeR | DodgeU ]
right [ AttU stationary SlimeR | DodgeR ] -> [ AttU right SlimeR | DodgeR ]
left [ AttU stationary SlimeR | DodgeL ] -> [ AttU left SlimeR | DodgeL ]
down [ AttD stationary SlimeR | DodgeD ] -> [ AttD down SlimeR | DodgeD ]
left [ AttD stationary SlimeR | DodgeL ] -> [ AttD left SlimeR | DodgeL ]
right [ AttD stationary SlimeR | DodgeR ] -> [ AttD right SlimeR | DodgeR ]
left [ AttL stationary SlimeR | DodgeL ] -> [ AttL left SlimeR | DodgeL ]
up [ AttL stationary SlimeR | DodgeU ] -> [ AttL up SlimeR | DodgeU ]
down [ AttL stationary SlimeR | DodgeD ] -> [ AttL down SlimeR | DodgeD ]
right [ AttR stationary SlimeR | DodgeR ] -> [ AttR right SlimeR | DodgeR ]
down [ AttR stationary SlimeR | DodgeD ] -> [ AttR down SlimeR | DodgeD ]
up [ AttR stationary SlimeR | DodgeU ] -> [ AttR up SlimeR | DodgeU ]
[ SlimeB AttX ] -> [ DamageTP ]
[ moving SlimeR AttX ] -> [ moving SlimeR DamageTP ]
[ stationary SlimeR AttX ] -> [ DamageTP ]
[ SkeletonDm AttX ] -> [ DamageTP ]
[ Skeleton AttU ] -> [ up SkeletonDm DamageTP ]
[ Skeleton AttD ] -> [ down SkeletonDm DamageTP ]
[ Skeleton AttL ] -> [ left SkeletonDm DamageTP ]
[ Skeleton AttR ] -> [ right SkeletonDm DamageTP ]
[ AttX ] [ DamageTP ] -> [ AttTP ] [ DamageTP ]
[ DamageTP ] -> [ AttTP ]
[ AttX ] -> cancel sfx0
==============
WINCONDITIONS
==============
no Enemy
no AttTP
no WeaponInv
no Weapon
=======
LEVELS
=======
message Take the and add it to your inventory by walking over it.
message Press X to use the sword and slain enemies.
message Slain all enemies to beat the level.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%..^..%.#
#.........#
#.........#
#....p....#
#.........#
#.........#
#.%..!..%.#
#.........#
###########
message Each weapon has one specific attack pattern.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%..^..%.#
#....^....#
#.........#
#....p....#
#.........#
#.........#
#.%..|..%.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%.....%.#
#...^^^...#
#.........#
#....p....#
#.........#
#.........#
#.%..-..%.#
#.........#
###########
message You always use the latest weapon.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#..%%%%%..#
#..%^^^%..#
#..%^^^%..#
#.........#
#...!|-...#
#.........#
#.%%.p.%%.#
#.........#
###########
message You can only hold a maximum of three weapons.
¤▫▫▪▪▪▪▪▪▪▪
###########
#....#.^^^#
#.p..#....#
#....#....#
#..%%#%%..#
#..-!!!!!.#
#..%%#%%..#
#....#....#
#....#....#
#^^^.#....#
###########
message All weapons must be used, no wasted slots !
¤▫▫▪▪▪▪▪▪▪▪
###########
#..#####..#
#..#####..#
#..%^^^%..#
#..%...%..#
#.........#
#....p....#
#.........#
#.%.---.%.#
#.%.....%.#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.........#
#%%%%...||#
#^^^^.%.||#
#^^^^p%.||#
#^^^^.%.||#
#%%%%...||#
#.........#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#..!|!-!-^#
#...#######
#.........#
#...%%^%%.#
#.p.%^^^%.#
#...%^^^%.#
#...%^^^%.#
#...%%%%%.#
#.........#
###########
message Skeletons take two attacks to be slain.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%%%.%%%.#
#..%$.$%..#
#.........#
#..!.-.!..#
#.........#
#.%.....%.#
#.%%.p.%%.#
#.........#
###########
message Attacks knocks back.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%.-.!.%.#
#.%.....%.#
#....p....#
#.........#
#.........#
#.%..$..%.#
#.%.^.^.%.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#..%%%%%..#
#..%^^^%..#
#..%.^$%..#
#.........#
#...!|-...#
#.........#
#.%%.p.%%.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#..!|!-!-$#
#...#######
#.........#
#...%..%%.#
#.p.%^^^%.#
#...%^^^%.#
#...%^^^%.#
#...%%%%%.#
#.........#
###########
message The bow can fire over one obstacle.
¤▫▫▪▪▪▪▪▪▪▪
###########
#...%^%...#
#...%^%...#
#..%.^.%..#
#....%....#
#.........#
#..|...]..#
#....p....#
#.........#
#..%...%..#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#..]|]-]-^#
#...#######
#.........#
#...%%^%%.#
#.p.#^^^#.#
#...#^^^#.#
#...#^^^#.#
#...#####.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#..]|]-]-^#
#...#######
#.........#
#...##^##.#
#.p.#^^^#.#
#...%^^^%.#
#...%^^^%.#
#...%%%%%.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#####.....#
#%^^..%.]]#
#%.^^.%.]]#
#%.^^p%.]]#
#%.^^.%.]]#
#%^^..%.]]#
#####.....#
#.........#
###########
message Red slimes will always try to dodge attacks.
¤▫▫▪▪▪▪▪▪▪▪
###########
####%%%####
##!.%.%.!##
##.......##
#%%.....%%#
#%...v...%#
#%%.....%%#
##...p...##
##!.%.%.!##
####%%%####
###########
message Observe their movement pattern.
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#..!.|.-..#
#.........#
#.%%...%%.#
#....v....#
#.%%...%%.#
#.........#
#....p....#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%...%.%.#
#.%.%...%.#
#.........#
#..p.v....#
#.........#
#.........#
#..!.|.-..#
#%.......%#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#.%.....%.#
#.........#
#|..%.%..-#
#...v.v...#
#-..%.%..|#
#.........#
#.%..p..%.#
#.........#
###########
message There is a pendant...
¤▫▫▪▪▪▪▪▪▪▪
###########
#......%^^#
#.%%....^^#
#.%....%^^#
#......%%%#
#.........#
#%%!%.....#
#..-%..~..#
#p.|%.....#
#...%.....#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#..~!|-~-!#
#...#######
#.........#
#...%%^%%.#
#.p.%^^^%.#
#...%^^^%.#
#...%^^^%.#
#...%%%%%.#
#.........#
###########
¤▫▫▪▪▪▪▪▪▪▪
###########
#.........#
#...%.....#
#..%..^v..#
#.%...v^..#
#.........#
#.-.....%.#
#......%..#
#.p.-.%...#
#.........#
###########
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment