The level's end, the way Mario's is

A level with a pole at its right end and a door past it. Play it, jump onto the pole, and let go of the pad: the square slides down, walks to the door by itself, the time left is counted into the score, a card names the next level, and it begins. The program is 566 instructions in 1,458 bytes, built and checked the same way.

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

On the screen

frame 120
frame 120
frame 150
frame 150
frame 250
frame 250
frame 520
frame 520

For a while the game plays itself

When Mario reaches the flagpole in Super Mario Bros., the pad stops mattering. He slides down the pole, walks into the castle by himself, and stands there while the time left is counted down and turned into points. Then the picture is cleared for the card that names the next world, and that level begins. Nothing in it is decided by the player, and nothing can go wrong in it; it is a scene the game plays between two levels. This cartridge plays the same scene with its own speeds, its own rate of counting, its own card and its own words. The script that measures it holds Left all the way through, to show that the pad is ignored.

this cartridgeSuper Mario Bros.
frames sliding down the pole3162
frames walking by itself afterwards3198
Left held meanwhile, and ignoredyesyes
frames the time is counted down over295314
units of time taken off on a frame11
points for each unit5050
frames from the count's end to the picture being cleared0143
frames the card shows before the next level is played121161
the level's number, before and after1, 21, 2

As written

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

;; The pole: the square's right edge reaching the pole's column, at any
;; height, is the level's end. From here the pad is not read again until
;; the next level: the slide begins.
pole:
    LDA $11
    CLC
    ADC #$0F
    STA $20
    LDA $15
    CLC
    ADC #$08
    STA $21
    JSR solid
    CMP #$05
    BNE notyet
    LDA #$07
    STA $50
    LDA #$00
    STA $12
    STA $13
    STA $16
    STA $17
    STA $03
notyet:
    RTS

Before this one: Losing a life and starting again, the way Mario does

Next: Falling into a hole, the way Mario does

All the lessons