Falling into a hole, the way Mario does

The lives lesson’s level with a hole in its ground. Play it and walk off the edge: the square drops through the bottom of the screen, you can still steer it on the way down, the walkers keep walking, and only after a wait is the life taken and the level begun again. The program is 597 instructions in 1,527 bytes, built and checked the same way.

Play it here Change it on the desk The cartridge, to play anywhere that plays NES cartridges: pit.nes

On the screen

frame 44
frame 44
frame 56
frame 56
frame 180
frame 180
frame 300
frame 300

A hole is the other death, and it is a different scene

When Mario walks into a hole in Super Mario Bros., nothing freezes and there is no hop. He falls, still answering the pad, through the bottom of the screen, and the world goes on without him: the Goombas keep walking, and the camera settles only a few frames later. The life is taken a long while after he is out of sight, when the fall’s music has played out, and then the same screen as any lost life shows the lives left before the level starts again from its beginning. This cartridge plays that scene with its own wait and its own words. Walking into a walker is still the other death, as in the lives lesson.

this cartridgeSuper Mario Bros.
frames from the edge to the bottom of the screen1519
pixels moved across on the way down, with Right held1116
pixels of hop on the way00
frames out of sight before the life is taken90249
a walker kept walking meanwhileyesyes
frames from the life to the picture being cleared02
frames until play starts again121155
the level begins again from its startyesyes

As written

The part of the program this lesson is about. The whole program is a plain text file: pit.s

falling:
    LDA $15
    CMP #$F0
    BCC onscreen
    LDA #$05
    STA $50
    LDA #$5A
    STA $51
    RTS
onscreen:
    JSR feet
    BEQ flying
    LDA $21
    AND #$F0
    SEC
    SBC #$10
    STA $15
    LDA #$00
    STA $14
    STA $16
    STA $17
    STA $03
flying:
    RTS
rising:
    LDA $15
    STA $21
    LDA $11
    STA $20
    JSR solid
    BNE head
    LDA $11
    CLC
    ADC #$0F
    STA $20
    JSR solid
    BEQ flying
head:
    LDA $21
    AND #$F0
    CLC
    ADC #$10
    STA $15
    LDA #$00
    STA $14
    STA $16
    STA $17
    RTS

Before this one: The level's end, the way Mario's is

Next: The last life, and what comes after it, the way Mario does

All the lessons