Skip to content

Instantly share code, notes, and snippets.

@hcs64
Last active April 25, 2016 12:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hcs64/0c783ee716f91d6d0dd769c6234c9750 to your computer and use it in GitHub Desktop.
Save hcs64/0c783ee716f91d6d0dd769c6234c9750 to your computer and use it in GitHub Desktop.
Add Man 3
title Add Man 3: Heavy Math (wip)
author Adam Gashlin
homepage gashlin.net
key_repeat_interval 0.25
noaction
run_rules_on_level_start
========
OBJECTS
========
Background
Green
Zero
White LightGrey
11111
.000.
.0.0.
.0.0.
.000.
ZeroGoal
Blue DarkBlue
00000
01110
01010
01010
01110
One
White LightGrey
11111
..0..
..0..
..0..
..0..
OneGoal
Blue DarkBlue
00000
00100
00100
00100
00100
PlayerR
LightBlue LightBrown Purple Brown
.333.
.311.
.000.
.010.
.2.2.
PlayerL
LightBlue LightBrown Purple Brown
.333.
.113.
.000.
.010.
.2.2.
PlayerPR
LightBlue LightBrown Purple Brown
.333.
.311.
.0001
.000.
.2.2.
PlayerPL
LightBlue LightBrown Purple Brown
.333.
.113.
1000.
.000.
.2.2.
PlayerC1
Transparent
PlayerC2
Transparent
Wall
Grey
Two
Red
.....
0.000
0.0.0
0.000
.....
Three
Red
.....
.0.0.
.0.0.
.0.0.
.....
Bottom
Transparent
=======
LEGEND
=======
Player = PlayerL or PlayerR or PlayerPL or PlayerPR
PlayerLR = PlayerL or PlayerR
Obj = Zero or One
Num = Zero or One or Two or Three
Solid = Zero or One or Wall
. = Background
L = PlayerL
R = PlayerR
0 = Zero
O = ZeroGoal
1 = One
! = OneGoal
# = Wall
=======
SOUNDS
=======
================
COLLISIONLAYERS
================
Background
ZeroGoal, OneGoal, Wall
Player, PlayerPL, PlayerPR, Zero, One, Two, Three
PlayerC1, PlayerC2, Bottom
======
RULES
======
( clear "pushing" so we only have to deal with the player direction )
[ PlayerPL ] -> [ PlayerL ]
[ PlayerPR ] -> [ PlayerR ]
( turn around, takes the whole movement )
[ left PlayerR ] -> [ PlayerL ]
[ right PlayerL ] -> [ PlayerR ]
( can't move through walls )
[ > Player | Wall ] -> [ Player | Wall ]
( climb )
( check if we could jump up )
up [ up PlayerL | no Solid ] -> [ left PlayerC1 | ]
up [ up PlayerR | no Solid ] -> [ right PlayerC1 | ]
[ up Player ] -> cancel
( check that there is something to climb on )
horizontal [ > PlayerC1 | Solid ] -> [ | > PlayerC2 Solid ]
[ PlayerC1 ] -> cancel
( check that there is somewhere to climb to )
up [ left PlayerC2 | no Solid ] -> [ | PlayerL ]
up [ right PlayerC2 | no Solid ] -> [ | PlayerR ]
[ PlayerC2 ] -> cancel
( push object )
left right down [ > Player | Obj ] -> [ > Player | > Obj ]
( transmit horizontal movement upwards (friction) )
( note: this will "capture" things hanging above (on walls) )
up [ horizontal Obj | Obj ] -> [ horizontal Obj | horizontal Obj ]
( 0 + 1 = 1 )
down left right [ > Zero | One ] -> [ | One ]
( 0 + 0 = 0, 0 + _ = 0 )
down left right [ > Zero | ] -> [ | Zero ]
( 1 + 1 = 2 )
down left right [ > One | One ] -> [ | Two ]
( 1 + 0 = 1, 1 + _ = 1 )
down left right [ > One | ] -> [ | One ]
startloop
( identify bottom, carry starts there )
[ Two ] -> [ Bottom Two ]
+ down [ Bottom | ... | Bottom ] -> [ | ... | Bottom ]
( 2 -> 0, carry out to next (2) for 3 )
up [ Bottom Two | Two ] -> [ Zero | Bottom Three ]
( carry in and 2 -> 1, carry out to next (2) for 3 )
+ up [ Bottom Three | Two ] -> [ One | Bottom Three ]
( 2 -> 0, carry out to next (1) for 2 )
+ up [ Bottom Two | One ] -> [ Zero | Bottom Two ]
( carry in and 2 -> 1, carry out to next (1) for 2 )
+ up [ Bottom Three | One ] -> [ One | Bottom Two ]
( carry, we had 1+1, carry out to next (0) for 1 )
up [ Bottom Two | ] -> [ Zero | One ]
( carry, we had carry in and 1+1, carry out to next (0) for 1 )
up [ Bottom Three | ] -> [ One | One ]
endloop
( can't move if carry fails )
[ Two ] -> cancel
[ Three ] -> cancel
( falling )
late down [ PlayerLR | no Solid ] -> [ | PlayerLR ]
late down [ Obj | no Solid ] -> [ | Obj ]
( set "pushing" avatar state )
late left [ PlayerL | Obj ] -> [ PlayerPL | Obj ]
late right [ PlayerR | Obj ] -> [ PlayerPR | Obj ]
==============
WINCONDITIONS
==============
All ZeroGoal on Zero
All OneGoal on One
=======
LEVELS
=======
(
fuller adder tests
...!
.01O
.11!
.11O
R01!
....
...!
..1O
.01O
R11O
...!
..1O
.01O
.11!
R11O
...!
.11!
.01O
R11O
...!
.11!
.11!
R11O
.00!
.11O
.00!
R11O
....
.00!
.01O
R11O
....
.00!
.11!
R11O
.00!
.11O
.00!
R11O
)
message Push the white numbers onto the blue targets
........
#######.
!.1R0...
#######.
........
!..1....
O..0...O
message Climb with Up
........
.1......
.##.....
.###..0.
.....###
....####
!.L#####
message 0 + 0 = 0
R....
#.0.
###.
O.0..
message Stomp numbers with Down
.......
..0.L..
.######
...#...
...#.O.
#0#####
#0#####
.0.....
.00.0OO
(
........
........
........
...0.0.O
..#####O
R0.....O
)
message 0 + 1 = 1
(
####O##..
R..#.##..
##.#..#..
##.######
##.01..O#
#########
)
(
..0.1.L
.######
....1..
!...0..
######.
.......
..1...!
..#####
.......
.0....O
)
..0.1.L
.######
.....1.
!.01.0.
######.
####...
.......
O.....!
(
.......
...1.L!
..#####
.......
.1111.!
)
.......
.0..1.L
.######
....0..
######.
......!
......O
(
.........
.........
.........
....00...
...###...
..#...O..
R1....O..
#########
)
(
.....
.1...
R0...
##.##
.....
..!..
)
message 1 + 1 = 10 (vertical!)
..0.1.L
.######
!......
O.1.0..
######.
......O
......
.....!
..1...
..11.L
.......0..
......##..
......#...
R1.1.1#..O
.....
.....
..1..
!.11L
.....
..R..
..1.O
.111.
......
....1.
....1L
!.#111
.....L
.....1
....11
...111
!O1111
.......
...R..!
1111111
1111111
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment