Skip to content

Instantly share code, notes, and snippets.

@patrickgh3
Created July 5, 2024 01:20
Show Gist options
  • Select an option

  • Save patrickgh3/cb4fd6ffd8fc87d096096e45c1765896 to your computer and use it in GitHub Desktop.

Select an option

Save patrickgh3/cb4fd6ffd8fc87d096096e45c1765896 to your computer and use it in GitHub Desktop.
Ultimate Javelin Golf (Pattern:Script Script)
Play this game by pasting the script in https://clementsparrow.github.io/Pattern-Script/src/editor.html
title Ultimate Javelin Golf
author Toombler and Patrick Traynor
homepage www.puzzlescript.net
background_color #2D5418
run_rules_on_level_start
====
TAGS
====
ActiveStatus = Active Inactive
FacingDir = Left Right
========
OBJECTS
========
Background
#2D5418 #34591B #3E6020
20010
01021
20200
10010
02100
Landing
LIGHTRED
00000
00000
00000
00000
00000
Seat1
#8F1A19 #481012 #D2A56C #E5D62B #2F3738
01014
01024
01034
02014
03014
( Want to flip this horizontally )
Seat2
#8F1A19 #481012 #D2A56C #E5D62B #2F3738
01014
01014
01014
01014
01014
( Want to flip this horizontally )
Seat3
#8F1A19 #481012 #D2A56C #E5D62B #2F3738
02000
13111
00020
11131
44444
Seat4
#8F1A19 #481012 #D2A56C #E5D62B #2F3738
00000
11111
00000
11111
44444
SeatWall
#8F1A19 #481012 #D2A56C #E5D62B #2F3738 #244711
44444
54455
54455
54455
54455
Wall
Grey darkgray #63686B #402324
00010
11111
01000
11111
00010
22222
WallShadow
#244711
00000
.....
.....
.....
.....
Player:Right
#D2A56C #E5D62B #63686B #3D342B
.30..
03110
..1..
.2.2.
0..0.
Player:Left
#D2A56C #E5D62B #63686B #3D342B
copy: Player:Right |
PlayerShadow:Right
#244711
.0000
.....
.....
.....
.....
PlayerShadow:Left
#244711
.0000
.....
.....
.....
.....
Pole
#CE7B1D #878581 #9D3720 #244711
.....
..0..
..2..
..2..
.....
PoleShadow
#CE7B1D #878581 #9D3720 #244711
.....
.....
.....
.3.3.
.333.
Javelin
#CE7B1D #878581 #9D3720 #244711
.....
....1
...0.
..2..
.0...
HeldJavelin:directions
#CE7B1D #878581 #9D3720 #244711
....1
....0
....2
....0
.....
rot:up:>
FlyingJavelin:directions
#CE7B1D #878581 #9D3720 #244711
..1..
..0..
..2..
..0..
.....
rot:up:>
JavelinBrokenAnim:directions
#CE7B1D #878581 #9D3720 #244711
..1..
....0
.2...
.....
...0.
rot:up:>
FlyingJavelinShadow:directions
#244711 #244711 #244711 #244711
copy: FlyingJavelin:directions translate:down:1 translate:right:1
PersonHeldJavelin
#CE7B1D #878581 #9D3720 #244711
....1
....0
....2
....0
.....
FlyingDisk:Inactive:directions
blue orange #244711
.000.
.0202
.0002
..222
.....
FlyingDisk:Active:directions
white blue
.000.
.0.0.
.000.
.....
.....
LandedDisk:Inactive
purple yellow
.....
.....
.000.
.0.0.
.000.
LandedDisk:Active
yellow purple
.....
.....
.000.
.0.0.
.000.
HeldDisk:Inactive
purple yellow
.....
..000
..0.0
..000
.....
HeldDisk:Active
yellow purple
.....
..000
..0.0
..000
.....
Hoop:Inactive:directions
purple #9C95E2 #244711
.....
..0..
..0..
..0..
.....
rot:up:>
Hoop:Active:directions
yellow purple #244711
.....
..0..
..0..
..0..
.....
rot:up:>
HoopShadow:directions
#244711
.....
.....
..000
..0.0
..000
NoPlayerZone
darkred
0.0.0
.0.0.
0.0.0
.0.0.
0.0.0
TempPlayerWas
transparent
TempJavelinCollidingWithHoop
pink
Dust
blue
0.0..
..0..
0...0
..0..
.0..0
Blood
red
.0...
...0.
00...
...0.
0.0..
Person
#D2A56C #3ED0E0 #63686B #3D342B
..0..
.111.
0.1.0
.2.2.
.0.0.
PersonShadow
#244711
.0000
.....
.....
.....
.....
TempInPlayerLOS
pink
TempDiskJustThrown
transparent
TempDiskJustCaughtByPerson
transparent
=======
LEGEND
=======
. = Background
# = Wall
L = Landing
P = Player:Right
* = LandedDisk:Inactive
O = Pole
/ = javelin
| = hoop:Inactive:up
- = hoop:Inactive:right
% = NoPlayerZone
~ = NoPlayerZone and Pole
+ = NoPlayerZone and javelin
q = person
x = person and PersonHeldJavelin
y = person and HeldDisk:Inactive
0 = SeatWall
1 = Seat1
2 = Seat2
3 = Seat3
4 = Seat4
LandedDisk = LandedDisk:ActiveStatus
HeldDisk = HeldDisk:ActiveStatus
FlyingJavelin = FlyingJavelin:directions
HeldJavelin = HeldJavelin:directions
Hoop = Hoop:ActiveStatus:directions
Player = Player:FacingDir
=======
SOUNDS
=======
Player move 3516307
LandedDisk:ActiveStatus create 48751807
FlyingDisk:ActiveStatus:directions create 84631607
sfx0 78870600 (23416607) () (disk activated)
sfx1 27703107 (can't move)
(
sfx4 14946607
sfx7 24903104
)
sfx6 24903104 (break something by landing disk on it)
sfx4 7594407 (pick up javelin)
sfx5 8394004 (javelin moves)
Javelin create 26868804
Hoop:ActiveStatus:directions move 53291307
Blood create 69833704 (8837309)
Person destroy 19265307
sfx8 53938108 (player killed)
sfx7 74365707 (person catches disc)
================
COLLISIONLAYERS
================
Background
WallShadow
PoleShadow
FlyingJavelinShadow:directions
HoopShadow:directions
PlayerShadow:FacingDir
PersonShadow
SeatWall, Seat1, Seat2, Seat3, Seat4
Landing
NoPlayerZone
Blood
Dust
JavelinBrokenAnim:directions
Javelin
LandedDisk
FlyingJavelin:directions
Player, Wall, Pole, Hoop:ActiveStatus:directions, Person
FlyingDisk:ActiveStatus:directions
HeldJavelin:directions, PersonHeldJavelin, HeldDisk
TempPlayerWas
TempJavelinCollidingWithHoop
TempInPlayerLOS
TempDiskJustThrown
TempDiskJustCaughtByPerson
======
RULES
======
(----graphics----)
late down [ Wall | ] -> [ Wall | WallShadow ]
late [ PoleShadow no Pole ] -> []
late [ Pole no PoleShadow ] -> [ Pole PoleShadow ]
late [ FlyingJavelinShadow:directions ] -> []
late directions [ FlyingJavelin:directions ] -> [ FlyingJavelin:directions FlyingJavelinShadow:directions ]
late [ HoopShadow:directions ] -> []
late directions [ Hoop:ActiveStatus:directions ] -> [ Hoop:ActiveStatus:directions HoopShadow:directions ]
late [ playershadow:FacingDir ] -> []
late down FacingDir [ Player:FacingDir | ] -> [ Player:FacingDir | playershadow:FacingDir ]
late [ PersonShadow ] -> []
late down [ Person | ] -> [ Person | PersonShadow ]
[JavelinBrokenAnim:directions] -> []
(----------------)
(disk thrown)
ActiveStatus right [ > Player HeldDisk:ActiveStatus | no Wall ] -> [ Player:right > FlyingDisk:ActiveStatus:> TempDiskJustThrown | ] again
ActiveStatus left [ > Player HeldDisk:ActiveStatus | no Wall ] -> [ Player:left > FlyingDisk:ActiveStatus:> TempDiskJustThrown | ] again
ActiveStatus [ > Player HeldDisk:ActiveStatus | no Wall ] -> [ Player > FlyingDisk:ActiveStatus:> TempDiskJustThrown | ] again
(javelin thrown)
directions [ action Player HeldJavelin:directions | ] -> [ action Player > FlyingJavelin:directions | ]
(stop player movement)
[ > Player HeldJavelin:directions | Javelin ] -> [ stationary Player HeldJavelin:directions | Javelin ] sfx1 (can't pick up multiple javelins)
[ > Player HeldJavelin:directions | LandedDisk ] -> [ stationary Player HeldJavelin:directions | LandedDisk ] sfx1 (can't pick up stick and disk)
[ > Player | Pole ] -> [ stationary Player | Pole ] sfx1 (can't move into pole)
[ > Player | NoPlayerZone ] -> [ stationary Player | NoPlayerZone ] sfx1 (can't move into no player zone)
(disk moves)
ActiveStatus [ FlyingDisk:ActiveStatus:> | ] -> [ > FlyingDisk:ActiveStatus:> | ] again
ActiveStatus [ > FlyingDisk:ActiveStatus:> Person HeldDisk | wall ] -> [ LandedDisk:ActiveStatus Blood | wall ] sfx6 (break person holding disk)
ActiveStatus [ > FlyingDisk:ActiveStatus:> Player HeldDisk | wall ] -> [ LandedDisk:ActiveStatus Blood | wall ] sfx6 sfx8 (break player holding disk)
ActiveStatus [ FlyingDisk:ActiveStatus:> Person no HeldDisk no TempDiskJustThrown][Player] -> [ stationary HeldDisk:ActiveStatus Person ][Player TempDiskJustCaughtByPerson] sfx7 (person catches disk)
ActiveStatus [ > FlyingDisk:ActiveStatus:> Pole LandedDisk | wall ] -> [ stationary LandedDisk:Active Pole Dust | wall ] sfx0 sfx6 (break existing disk)
ActiveStatus [ > FlyingDisk:ActiveStatus:> Pole | wall ] -> [ stationary LandedDisk:Active Pole | wall ] sfx0
ActiveStatus [ > FlyingDisk:ActiveStatus:> LandedDisk | wall ] -> [ stationary LandedDisk:ActiveStatus Dust | wall ] sfx6 (break existing disk)
ActiveStatus [ > FlyingDisk:ActiveStatus:> Hoop | wall ] -> [ stationary LandedDisk:ActiveStatus Dust | wall ] sfx6 (break hoop)
ActiveStatus [ > FlyingDisk:ActiveStatus:> | wall ] -> [ stationary LandedDisk:ActiveStatus | wall ]
(javelin moves)
[ FlyingJavelin:> | ] -> [ > FlyingJavelin:> | ] again sfx5
(javelin activates hoop)
[ FlyingJavelin:> Hoop:ActiveStatus:parallel | ] -> [ FlyingJavelin:> TempJavelinCollidingWithHoop Hoop:ActiveStatus:parallel | ]
directions [ FlyingJavelin Hoop:Inactive:directions no TempJavelinCollidingWithHoop ] -> [ FlyingJavelin Hoop:Active:directions ] sfx0
(javelin landing)
[ > FlyingJavelin:> | Landing ] -> [ | Pole Landing ] sfx6
(javelin destroyed)
[ > FlyingJavelin:> | wall ] -> [ JavelinBrokenAnim:> | wall ] sfx6
[ > FlyingJavelin:> | Pole ] -> [ > FlyingJavelin:> | Javelin ] sfx6
(kill people and player)
ActiveStatus [ > FlyingJavelin:> | Person HeldDisk:ActiveStatus ] -> [ | Blood landeddisk:ActiveStatus JavelinBrokenAnim:> ]
[ > FlyingJavelin:> | Person PersonHeldJavelin ] -> [ | Blood Javelin JavelinBrokenAnim:> ]
[ > FlyingJavelin:> | Person ] -> [ | Blood JavelinBrokenAnim:> ]
ActiveStatus [ > FlyingJavelin:> | Player HeldDisk:ActiveStatus ] -> [ | Blood landeddisk:ActiveStatus JavelinBrokenAnim:> ] sfx8
[ > FlyingJavelin:> | Player HeldJavelin:directions ] -> [ | Blood Javelin JavelinBrokenAnim:> ] sfx8
[ > FlyingJavelin:> | Player ] -> [ | Blood JavelinBrokenAnim:> ] sfx8
[ FlyingJavelin:directions TempJavelinCollidingWithHoop ] -> [ JavelinBrokenAnim:> TempJavelinCollidingWithHoop ] sfx6
[TempJavelinCollidingWithHoop] -> []
(hoop moves)
([ > Player | Hoop:ActiveStatus:parallel | pole no wall no LandedDisk no Javelin ] -> [ > Player | Hoop:ActiveStatus:parallel | Javelin ] (push hoop into pole to break it))
[ > Player | Hoop:ActiveStatus:parallel | no wall no pole no LandedDisk no Javelin no Hoop no person ] -> [ > Player | > Hoop:ActiveStatus:parallel | ] (player pushes hoop)
[ > Player | stationary Hoop:ActiveStatus:parallel | ] -> [ > Player | stationary Hoop:ActiveStatus:parallel | ] sfx1 (can't move sfx)
([ > Player | Hoop:ActiveStatus:perpendicular | pole no wall no LandedDisk no Javelin ] -> [ > Player | Hoop:ActiveStatus:perpendicular | Javelin ] (push hoop over onto pole to break it))
ActiveStatus [ > Player | Hoop:ActiveStatus:perpendicular | no wall no pole no LandedDisk no Javelin no Hoop no person ] -> [ > Player | | LandedDisk:ActiveStatus ] (player pushes hoop over)
ActiveStatus [ > Player | stationary Hoop:ActiveStatus:perpendicular | ] -> [ > Player | stationary Hoop:ActiveStatus:perpendicular | ] sfx1 (can't move sfx)
(person pushed)
[ > Player | Person HeldDisk | no Javelin no LandedDisk no hoop no pole no wall] -> [ > Player | > Person > HeldDisk| ]
[ > Player | Person | no Javelin no LandedDisk no hoop no pole no wall] -> [ > Player | > Person | ]
(player catches disk)
ActiveStatus [ Player FlyingDisk:ActiveStatus:directions no TempDiskJustThrown no HeldDisk no HeldJavelin ] -> [ Player helddisk:ActiveStatus ]
late [ TempDiskJustThrown ] -> []
(person throws disk or javelin)
late [ Player | no wall ] -> [ Player TempInPlayerLOS | TempInPlayerLOS]
late [ TempInPlayerLOS | TempInPlayerLOS | no wall ] -> [ TempInPlayerLOS | TempInPlayerLOS | TempInPlayerLOS ]
late ActiveStatus [ Person HeldDisk:ActiveStatus TempInPlayerLOS | ... | Player no TempDiskJustCaughtByPerson ] -> [ Person FlyingDisk:ActiveStatus:> TempInPlayerLOS TempDiskJustThrown | ... | Player ] again (throws disk)
late [ Person PersonHeldJavelin TempInPlayerLOS | ... | Player ] -> [ Person FlyingJavelin:> TempInPlayerLOS | ... | Player ] again (throws javelin)
late [ TempInPlayerLOS ] -> []
late [ TempDiskJustCaughtByPerson no Player ] -> []
late [ LandedDisk Javelin ] -> [ LandedDisk javelinbrokenanim:right] sfx6
late [ LandedDisk Hoop:ActiveStatus:directions ] -> [ LandedDisk Dust ] sfx6
late ActiveStatus [ Player LandedDisk:ActiveStatus ] -> [ Player HeldDisk:ActiveStatus ]
late [ TempPlayerWas | Player Javelin ] -> [ TempPlayerWas | Player HeldJavelin:> ] sfx4
late random [ HeldJavelin:directions | Player ] -> [ | Player HeldJavelin:> ] (put javelin back on player)
late right [ TempPlayerWas | Player ] -> [ TempPlayerWas | Player:right ] (player faces direction)
late left [ TempPlayerWas | Player ] -> [ TempPlayerWas | Player:left ]
late [TempPlayerWas] -> []
late [ Player ] -> [ Player TempPlayerWas]
==============
WINCONDITIONS
==============
no LandedDisk:Inactive
no Hoop:Inactive:directions
(no Javelin
no FlyingJavelin:directions
no HeldJavelin:directions)
no HeldDisk
no FlyingDisk:ActiveStatus:directions
(no ClearedVisuals)
no Dust
=======
LEVELS
=======
message Let the games... BEGIN!
(---- Disks ----)
2..........2
22########22
22##..####22
22##o....#22
22#p..*.o#22
22#.....##22
22#.*...##22
02########20
(
#######
##o...#
#.....#
#op..*#
#..*..#
#.....#
#######)
2.........2
22#######22
22#.o..##22
22#....##22
22#.p.o##22
22##....#22
22#*.*..#22
02#######20
2........2
22######22
22#**o.#22
22#o..*#22
22#..p.#22
22#o.*o#22
02######20
(2..........2
22########22
22#****o##22
22#....o##22
22##.p...#22
22###..o##22
22####.o##22
02########20) ( Maybe teaching accidental disc destruction )
2............2
22##########22
22##....o..#22
22#..**...o#22
22#p...*...#22
22##.....#.#22
22##..o..#.#22
22##.##....#22
22##.......#22
02##########20
message What's that? "This doesn't seem like an extreme sport?"
2...............2
22#############22
22#.........###22
22#.#.......###22
22#.x..#......#22
22#......#...x#22
22#...........#22
22#......*..###22
22#...#.....x##22
22#.......p..##22
22#o.........x#22
02#############20 ( Javelin gauntlet )
(---- Javelins ----)
(
message Press X to toss javelins.
4444444
4444444
4444444
#######
#x....#
#.p./.#
#.....#
#..//.#
#....x#
#######
)
(---- Hoops ----)
message Press X to toss javelins. Thread the needle!
444444444
444444444
444444444
#########
#./.....#
#....|..#
#p/.....#
#......|#
#./...|.#
#...x...#
#########
4444444
4444444
4444444
#######
#p....#
#../..#
#/....#
#..#.|#
#..-..#
#######
44444444
44444444
44444444
########
#p.....#
#...|..#
#..|...#
#....|.#
#/.....#
########
(---- Hoops to disks ----)
2...........2
22.........22
222#######222
222#.#...#222
222#....o#222
222#p....#222
222#...-.#222
022#.....#220
002#######200
2...........2
22.........22
222#######222
222#.....#222
222#.-..o#222
222#..-..#222
222#p..#.#222
022#..o..#220
002#######200
(---- Avoiding or causing destruction ----)
2.............2
22...........22
222#########222
222#...#...#222
222#|..*../#222
222#...#...#222
022#p..#..o#220
002#########200 (don't want to break javelin with disk)
2...........2
22.........22
222#######222
222#p*####222
222##...o#222
222##../.#222
222##-./.#222
222#.....#222
022#.-..|#220
002#######200 (don't want to break hoop with disk)
2..............2
22............22
222##########222
222#-..#./..#222
222#.|.#....#222
222#...#...x#222
222#.././..##222
022##..p..###220
002##########200 (DO want to break javelin with disk)
2.............2
22...........22
222#########222
222#####o.o#222
222######.##222
222##p.##-##222
222#..*.#.##222
022#/.#..*##220
002#########200 (disks block when holding javelin)
(---- Poles to javelins ----)
..........2
.........22
........222
#######2222
#..#o*#2222
#...oo#2222
#..p.##2222
#.....#2220
#/....#2200
#######2000
............2
###########22
######.-###22
#.......-##22
#..o.o...-#22
#...o.....#22
#.o./oo.p.#22
#..o..o...#22
#...o....-#22
#.......-##22
######.-###22
###########20 (ok, maybe a bit big?)
............2
...........22
##########222
#...o.#..#222
#./.#.#..#222
#...#o...#222
#p..##...#222
#..o..#..#222
###..o...#222
#####...*#220
##########200 (good!)
............2
...........22
..........222
#########2222
###...###2222
#...o...#2222
#.o....-#2222
#...p...#2222
##....-.#2222
##..|...#2220
##/....##2200
#########2000
.........2
........22
#######222
#####o#222
####.*#222
##.#.##222
#.p.o##222
#....##222
#.*/.##222
#....##220
#######200
(---- Discs and people ----)
2.........2
22#######22
22#*.o..#22
22#.....#22
22#.....#22
22#.....#22
22#p...q#22
02#######20 ( Passing intro )
2............2
22##########22
22####.oo.##22
22####....##22
22###*....y#22
22#p./....##22
02##########20 ( Don't pass please )
2.........2
22#######22
22#..p.*#22
22#...#.#22
22#.###.#22
22#....y#22
22#..oo##22
02#######20 (funny interaction )
2..........2
22########22
22#...qp.#22
22#......#22
22#......#22
22#...#.o#22
22#......#22
22#*.o..*#22
02########20 ( Passing practice )
(--- Javelins and people ---)
2...........
22..........
222#########
222#.....###
222#....p.##
222#..#..x##
222#....#.##
222#....#.*#
222#..q.#.o#
022#......##
002######### ( Death trick teammate )
2..........
22.........
222########
222#.p..###
222#*.*.qo#
222#.....##
222#o....##
022#../..##
002######## ( Intro to violence )
(2............
22...........
222##########
222#####....#
222#.o##../.#
222#.qqqq..p#
222#.*##../.#
022#####....#
002##########/) ( Violence )
2...........
22..........
222#########
222#.......#
222#...#...#
222#..-....#
222#.-...-.#
222#.......#
222#.p.../.#
022####x####
002######### ( Death trick self )
4444444444444444444444444444444444444
4444444444444444444444444444444444444
4444444444444444444444444444444444444
4444444444444444444444444444444444444
4444444444444444444444444444444444444
#####################################
#.....###...#########..../#.........#
#..#..###....##...###.##.##..|..|...#
#..#..#.......#.#.##..o#o...........#
#..#..#.........#.#...##.....|....|.#
#..#..#..#....###.#....#o...|...|...#
#p.#..-.......###......#.##...|.....#
#..#..........###q.....##########x..#
##################################### ( Marathon - finale level idea )
message Thank you for playing!
message Optional levels:
2................2
22##############22
22#...o.....y###22
22#..........###22
22#o..y.y..#####22
22#........#####22
22#........#.###22
22#/..o....#...#22
22#p######.-...#22
02##############20 (coordinator)
#########
#*.....*#
#.......#
#.q.....#
#...o#o.#
#.p..o..#
#.......#
#*......#
######### ( Four poles ) (hard?)
message You are the Ultimate Javeiln Golf champion!
(
message Javelins to Poles
##########
#....%...#
#.p..%..l#
#....%..l#
#..*.%...#
#./..%..l#
#....%..l#
##########
##########
#...%l####
#*..%.l###
#...%..l##
#...%...l#
##.##%%%%#
##.##....#
##/..p...#
####...*.#
##########
#########
#....lll#
#..-.lll#
#.p..lll#
#.......#
#..-....#
#....../#
#########
##########
#ll....ll#
#ll....ll#
#...|....#
#.p..-...#
#........#
#ll./..ll#
#ll....ll#
##########
############
#.....y...##
#.........##
#...#.....##
#..#x.....##
#...#.p...##
#.........##
#.........##
######.#####
######o#####
############ ( Trying to force teammate to score a goal, but can't. )
(todo: can do this if player is holding something?)
)
(
#######
#.....#
#.-.-.#
#.p...#
#/..|.#
#//...#
#######
)
(sandbox levels)
(
#########
#.o..o*.#
#*......#
#...|-./#
#/......#
#.p..|..#
#/.*...*#
#//....o#
#########
##########
#.*......#
#.....q..#
#..q.....#
#p...*.q.#
#........#
#.*.q..*.#
#........#
########## (sandbox)
##########
#........#
#.....x..#
#..q.....#
#p.....x.#
#./......#
#...q....#
#/.../...#
########## (sandbox)
)
( Cut levels: )
(###########
##./.%.|..#
##./.%....#
##./.%....#
##...%...|#
#p.%.%..|.#
###########) (replace the no-player squares with a person throwing a javelin at you?)
(#########
##qqqqq##
#q.....q#
#q.../.q#
#q./...q#
#p.....q#
#q../..q#
##qqqqq##
#########) ( No injuries allowed? Hm, we probably want to allow violence, actually. )
(##########
#.#/.###*#
#...o#..q#
#.#.##p#o#
#.#.##.###
#q....*###
##########) ( Annoying passer. Probably too weird to want to use? )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment