Skip to content

Instantly share code, notes, and snippets.

@increpare
Created May 7, 2025 17:01
Show Gist options
  • Save increpare/1805522c44e05c41fa83d38dd1c7f891 to your computer and use it in GitHub Desktop.
Save increpare/1805522c44e05c41fa83d38dd1c7f891 to your computer and use it in GitHub Desktop.
Talo Pipi 2 (PuzzleScript Script)
Play this game by pasting the script in http://www.puzzlescript.net/editor.html
title Talo Pipi 2
author increpare
homepage www.increpare.com
color_palette 2
run_rules_on_level_start
debug
verbose_logging
again_interval 0.0
========
OBJECTS
========
Background
lightgreen green
11111
01111
11101
11111
10111
seethrough
lightgreen green
11111
01111
11101
11111
10111
Target
darkblue
.....
.000.
.0.0.
.000.
.....
Wall
grey darkgrey
10000
11010
10000
11010
11111
Player
black orange white darkblue
.000.
.111.
22222
.333.
.3.3.
Crate
orange
00000
0...0
0...0
0...0
00000
Shootergun_u a
darkred red
.010.
00100
01110
01110
.000.
Shootergun_d
darkred red
.000.
01110
01110
00100
.010.
Shootergun_l
darkred red
.000.
00110
11110
00110
.000.
Shootergun_r
darkred red
.000.
01100
01111
01100
.000.
laser_u
red transparent
..1..
..0..
.....
..0..
.....
laser_d
red transparent
.....
..0..
.....
..0..
..1..
laser_l
red transparent
.....
.....
10.0.
.....
.....
laser_r
red transparent
.....
.....
.0.01
.....
.....
portal_centre_u
pink transparent yellow
11111
11111
11111
11111
00000
portal_centre_d
pink transparent yellow
00000
11111
11111
11111
11111
portal_centre_l
pink transparent yellow
11110
11110
11110
11110
11110
portal_centre_r
pink transparent yellow
01111
01111
01111
01111
01111
portal_left_u
pink transparent orange
00000
02111
01111
01111
00000
portal_left_d
pink transparent orange
00000
11110
11110
11120
00000
portal_left_l
pink transparent orange
01110
01110
01110
02110
00000
portal_left_r
pink transparent orange
00000
01120
01110
01110
01110
portal_right_u
pink transparent lightgray
00000
11120
11110
11110
00000
portal_right_d
pink transparent lightgray
00000
01111
01111
02111
00000
portal_right_l
pink transparent lightgray
00000
02110
01110
01110
01110
portal_right_r
pink transparent lightgray
01110
01110
01110
01120
00000
hole_boundary_u
yellow
00000
.....
.....
.....
.....
hole_boundary_d
yellow
.....
.....
.....
.....
00000
hole_boundary_l
yellow
0....
0....
0....
0....
0....
hole_boundary_r
yellow
....0
....0
....0
....0
....0
moving_portal
purple
.....
.....
..0..
.....
.....
new_portal_centre
lightblue
0....
.....
.....
.....
.....
=======
LEGEND
=======
. = Background
# = Wall
P = Player
* = Crate
@ = Crate and Target
O = Target
1 = Shootergun_u
2 = Shootergun_d
3 = Shootergun_l
4 = Shootergun_r
; = seethrough
shootergun = Shootergun_u or Shootergun_d or Shootergun_l or Shootergun_r
laser = laser_u or laser_d or laser_l or laser_r
portal_centre = portal_centre_u or portal_centre_d or portal_centre_l or portal_centre_r
portal_left = portal_left_u or portal_left_d or portal_left_l or portal_left_r
portal_right = portal_right_u or portal_right_d or portal_right_l or portal_right_r
portal = portal_centre or portal_left or portal_right
pushable = crate or Shootergun
obstacle = wall or Shootergun
hole_boundary = hole_boundary_u or hole_boundary_d or hole_boundary_l or hole_boundary_r
cant_overlap_with_wall = player or crate or shootergun
entity = shootergun or player
=======
SOUNDS
=======
Crate move 36772507
shootergun destroy 49307102
player destroy 65225502
shootergun move 22249707
cancel 18085304
================
COLLISIONLAYERS
================
portal_left_u
portal_left_d
portal_left_l
portal_left_r
portal_right_u
portal_right_d
portal_right_l
portal_right_r
Background
Target
Wall, seethrough
Player, Crate, shootergun
laser_u
laser_d
laser_l
laser_r
hole_boundary_u
hole_boundary_d
hole_boundary_l
hole_boundary_r
portal_centre_u
portal_centre_d
portal_centre_l
portal_centre_r
moving_portal
new_portal_centre
======
RULES
======
[ hole_boundary ] -> [ ]
[ laser ]->[]
[ > Player | pushable ] -> [ > Player | > pushable ]
[ > player | wall ] -> cancel
[ > pushable | wall ] -> cancel
(if moving a shooter parallel to its shooting direction, don't need to recalculate portals)
[ left Shootergun_u ] -> [ left Shootergun_u up moving_portal ]
[ right Shootergun_u ] -> [ right Shootergun_u up moving_portal ]
[ left Shootergun_d ] -> [ left Shootergun_d down moving_portal ]
[ right Shootergun_d ] -> [ right Shootergun_d down moving_portal ]
[ up Shootergun_l ] -> [ up Shootergun_l left moving_portal ]
[ down Shootergun_l ] -> [ down Shootergun_l left moving_portal ]
[ up Shootergun_r ] -> [ up Shootergun_r right moving_portal ]
[ down Shootergun_r ] -> [ down Shootergun_r right moving_portal ]
(extend from moving portal and delete the portal_center you find)
[ > moving_portal | no obstacle ] -> [ > moving_portal | > moving_portal ]
(remove portal center for actively moved shooter)
up [ up moving_portal | portal_centre_u ] -> [ up moving_portal | wall no portal_centre_u ]
down [ down moving_portal | portal_centre_d ] -> [ down moving_portal | wall no portal_centre_d ]
left [ left moving_portal | portal_centre_l ] -> [ left moving_portal | wall no portal_centre_l ]
right [ right moving_portal | portal_centre_r ] -> [ right moving_portal | wall no portal_centre_r ]
(remove unattached left/right portals - doing this the dumb way)
right [ portal_left_u | no portal_centre_u ] -> [ wall | ] again
down [ portal_left_r | no portal_centre_r ] -> [ wall | ] again
left [ portal_left_d | no portal_centre_d ] -> [ wall | ] again
up [ portal_left_l | no portal_centre_l ] -> [ wall | ] again
right [ no portal_centre_u | portal_right_u ] -> [ | wall ] again
down [ no portal_centre_r | portal_right_r ] -> [ | wall ] again
left [ no portal_centre_d | portal_right_d ] -> [ | wall ] again
up [ no portal_centre_l | portal_right_l ] -> [ | wall ] again
(create left bit of portal)
right [ wall | portal_centre_u ] -> [ seethrough portal_left_u | portal_centre_u ]
down [ wall | portal_centre_r ] -> [ seethrough portal_left_r | portal_centre_r ]
left [ wall | portal_centre_d ] -> [ seethrough portal_left_d | portal_centre_d ]
up [ wall | portal_centre_l ] -> [ seethrough portal_left_l | portal_centre_l ]
(create right bit of portal)
right [ portal_centre_u | wall ] -> [ portal_centre_u | seethrough portal_right_u ]
down [ portal_centre_r | wall ] -> [ portal_centre_r | seethrough portal_right_r ]
left [ portal_centre_d | wall ] -> [ portal_centre_d | seethrough portal_right_d ]
up [ portal_centre_l | wall ] -> [ portal_centre_l | seethrough portal_right_l ]
(TODO: can't move shooter through its own portal)
up [ > Shootergun_u | portal_centre_u ] -> cancel
down [ > Shootergun_d | portal_centre_d ] -> cancel
left [ > Shootergun_l | portal_centre_l ] -> cancel
right [ > Shootergun_r | portal_centre_r ] -> cancel
[moving_portal]->[]
[ moving shootergun] ->[ moving shootergun moving moving_portal ]
late up [ Shootergun_u ] -> [ Shootergun_u laser_u ]
late down [ Shootergun_d ] -> [ Shootergun_d laser_d ]
late left [ Shootergun_l ] -> [ Shootergun_l laser_l ]
late right [ Shootergun_r ] -> [ Shootergun_r laser_r ]
late up [ laser_u | no obstacle no portal_centre_u ] -> [ laser_u | laser_u ]
late down [ laser_d | no obstacle no portal_centre_d ] -> [ laser_d | laser_d ]
late left [ laser_l | no obstacle no portal_centre_l ] -> [ laser_l | laser_l ]
late right [ laser_r | no obstacle no portal_centre_r ] -> [ laser_r | laser_r ]
(when laser hits wall, create a portal centre)
(prioritize creation of portal of most recently moved shooter - bit grotesque...)
late up [ moving_portal laser_u | wall ] -> [ moving_portal laser_u | seethrough portal_centre_u new_portal_centre ]
late down [ moving_portal laser_d | wall ] -> [ moving_portal laser_d | seethrough portal_centre_d new_portal_centre ]
late left [ moving_portal laser_l | wall ] -> [ moving_portal laser_l | seethrough portal_centre_l new_portal_centre ]
late right [ moving_portal laser_r | wall ] -> [ moving_portal laser_r | seethrough portal_centre_r new_portal_centre ]
late up [ moving_portal | ... | laser_u | wall ] -> [ moving_portal | ... |laser_u | seethrough portal_centre_u new_portal_centre ]
late down [ moving_portal | ... |laser_d | wall ] -> [ moving_portal | ... |laser_d | seethrough portal_centre_d new_portal_centre ]
late left [ moving_portal | ... |laser_l | wall ] -> [ moving_portal | ... |laser_l | seethrough portal_centre_l new_portal_centre ]
late right [ moving_portal | ... |laser_r | wall ] -> [ moving_portal | ... |laser_r | seethrough portal_centre_r new_portal_centre ]
(create ears of player portal)
(create left bit of portal)
late right [ wall | portal_centre_u ] -> [ seethrough portal_left_u | portal_centre_u ]
late down [ wall | portal_centre_r ] -> [ seethrough portal_left_r | portal_centre_r ]
late left [ wall | portal_centre_d ] -> [ seethrough portal_left_d | portal_centre_d ]
late up [ wall | portal_centre_l ] -> [ seethrough portal_left_l | portal_centre_l ]
(create right bit of portal)
late right [ portal_centre_u | wall ] -> [ portal_centre_u | seethrough portal_right_u ]
late down [ portal_centre_r | wall ] -> [ portal_centre_r | seethrough portal_right_r ]
late left [ portal_centre_d | wall ] -> [ portal_centre_d | seethrough portal_right_d ]
late up [ portal_centre_l | wall ] -> [ portal_centre_l | seethrough portal_right_l ]
(potentially repropagate lasers)
late up [ laser_u | no obstacle no portal_centre_u ] -> [ laser_u | laser_u ]
late down [ laser_d | no obstacle no portal_centre_d ] -> [ laser_d | laser_d ]
late left [ laser_l | no obstacle no portal_centre_l ] -> [ laser_l | laser_l ]
late right [ laser_r | no obstacle no portal_centre_r ] -> [ laser_r | laser_r ]
(lower priority laser portal generation)
late up [ laser_u | wall ] -> [ laser_u | seethrough portal_centre_u new_portal_centre ]
late down [ laser_d | wall ] -> [ laser_d | seethrough portal_centre_d new_portal_centre ]
late left [ laser_l | wall ] -> [ laser_l | seethrough portal_centre_l new_portal_centre ]
late right [ laser_r | wall ] -> [ laser_r | seethrough portal_centre_r new_portal_centre ]
(if our new portal's ears impinge upon a different one, it deletes that other portal and causes it to be recalculated)
late right [ portal_centre | portal_centre_u new_portal_centre ] -> [ wall | portal_centre_u new_portal_centre ] again
late down [ portal_centre | portal_centre_r new_portal_centre ] -> [ wall | portal_centre_r new_portal_centre ] again
late left [ portal_centre | portal_centre_d new_portal_centre ] -> [ wall | portal_centre_d new_portal_centre ] again
late up [ portal_centre | portal_centre_l new_portal_centre ] -> [ wall | portal_centre_l new_portal_centre ] again
late right [ portal_centre_u new_portal_centre | portal_centre ] -> [ portal_centre_u new_portal_centre | wall ] again
late down [ portal_centre_r new_portal_centre | portal_centre ] -> [ portal_centre_r new_portal_centre | wall ] again
late left [ portal_centre_d new_portal_centre | portal_centre ] -> [ portal_centre_d new_portal_centre | wall ] again
late up [ portal_centre_l new_portal_centre | portal_centre ] -> [ portal_centre_l new_portal_centre | wall ] again
(if a center is unsupported by a laser, remove it)
late up [ no laser_u | portal_centre_u ] -> [ | wall ]
late down [ no laser_d | portal_centre_d ] -> [ | wall ]
late left [ no laser_l | portal_centre_l ] -> [ | wall ]
late right [ no laser_r | portal_centre_r ] -> [ | wall ]
(then tidy up unattached ears again)
late right [ portal_left_u | no portal_centre_u ] -> [ wall | ]
late down [ portal_left_r | no portal_centre_r ] -> [ wall | ]
late left [ portal_left_d | no portal_centre_d ] -> [ wall | ]
late up [ portal_left_l | no portal_centre_l ] -> [ wall | ]
late right [ no portal_centre_u | portal_right_u ] -> [ | wall ]
late down [ no portal_centre_r | portal_right_r ] -> [ | wall ]
late left [ no portal_centre_d | portal_right_d ] -> [ | wall ]
late up [ no portal_centre_l | portal_right_l ] -> [ | wall ]
late [ new_portal_centre ] -> [ ]
(create left bit of portal)
late right [ wall | portal_centre_u ] -> [ seethrough portal_left_u | portal_centre_u ]
late down [ wall | portal_centre_r ] -> [ seethrough portal_left_r | portal_centre_r ]
late left [ wall | portal_centre_d ] -> [ seethrough portal_left_d | portal_centre_d ]
late up [ wall | portal_centre_l ] -> [ seethrough portal_left_l | portal_centre_l ]
(create right bit of portal)
late right [ portal_centre_u | wall ] -> [ portal_centre_u | seethrough portal_right_u ]
late down [ portal_centre_r | wall ] -> [ portal_centre_r | seethrough portal_right_r ]
late left [ portal_centre_d | wall ] -> [ portal_centre_d | seethrough portal_right_d ]
late up [ portal_centre_l | wall ] -> [ portal_centre_l | seethrough portal_right_l ]
late [ player wall ] -> [ wall ]
late [ shootergun wall ] -> [ wall ] again
late up [ portal | no portal ] -> [ portal hole_boundary_u | ]
late down [ portal | no portal ] -> [ portal hole_boundary_d | ]
late left [ portal | no portal ] -> [ portal hole_boundary_l | ]
late right [ portal | no portal ] -> [ portal hole_boundary_r | ]
late [ moving_portal ] -> [ ]
late [laser wall] -> again
==============
WINCONDITIONS
==============
all Target on shootergun
=======
LEVELS
=======
################
#.........#....#
#...3.....##.4.#
#..............#
########.......#
#...........####
#........2..####
#..............#
##.....#########
##........#....#
#..1.p....#....#
#..............#
################
################
#.......p.#....#
#.......3.##.4.#
#..#...........#
########.......#
#...........####
#........2..####
#..............#
##.....#########
##........#....#
#..1......#....#
#..............#
################
(moving up here twice weird things happen)
################
#.........#....#
#.........##.4.#
#..#...........#
########.......#
#...3.......####
#...p....2..####
#..............#
##.....#########
##........#....#
#..1......#....#
#..............#
################
(if you move down here, it doesn't propritize the persisting of the moved things portal as it should)
################
#.........#....;
#.........##.4.;
#..#...........;
########.......#
#...........####
#........2..####
#.p............#
##3....#########
##........#....#
#1........#....#
#..............#
################
################
#...#......#...#
#.o.#......#.o.#
#...#......#...#
#####......#####
#.....4..3.....#
#..p...........#
################
###############
#...#.....#...#
#.o.#.....#.o.#
#...#.....#...#
####.......####
#.............#
#......2......#
#.....4.3.....#
#......1......#
#...p.........#
####.......####
#...#.....#...#
#.o.#.....#.o.#
#...#.....#...#
###############
(Teaches something about priorities, but not...very fun - needs some more elements maybe?)
################
#....#.........#
#....#.........#
#.oo.#...4..3..#
#....#....p....#
#....#.........#
################
###############
#.............#
#.............#
#.............#
#.............#
#.............#
#.............#
#.............#
#.............#
#...p.........#
#.............#
#.............#
#.............#
#.............#
###############
(simple but there is a level there)
###############
#.............#
#.............#
#......###....#
#.....#...#...#
#.....#.o.#...#
#.....#.o.#...#
#.....#...#...#
#......###....#
#...p.........#
#.............#
#..23.........#
#.............#
#.............#
###############
#############
#p..........#
#..2........#
#.4.........#
#....###....#
#...#...#...#
#...#.o.#...#
#...#.o.#...#
#...#...#...#
#....###....#
#...........#
#...........#
#...........#
#############
###############
#.............#
#.............#
#....#######..#
#....#######..#
#....##.o.##..#
#....##.o.##..#
#....##.o.##..#
#....#######..#
#....#######..#
#..4..........#
#.p3..........#
#..4..........#
#.............#
###############
###############
#.............#
#.............#
#.....#####...#
#....#######..#
#....##.o.##..#
#....##...##..#
#....##.o.##..#
#....##.o.##..#
#....#######..#
#.....#####...#
#..4..........#
#.p3..........#
#..4..........#
#.............#
###############
(ok level 1?)
#################
#...............#
#...............#
#...............#
#.....#####.....#
#.....#####.....#
#...##.....##...#
#...##...o.##...#
#...##..o..##...#
#...##.o...##...#
#...##.....##...#
#.....#####.....#
#.4...#####.....#
#..3............#
#.p.4...........#
#...............#
#################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment