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
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 cartridge | Super Mario Bros. | |
|---|---|---|
| frames sliding down the pole | 31 | 62 |
| frames walking by itself afterwards | 31 | 98 |
| Left held meanwhile, and ignored | yes | yes |
| frames the time is counted down over | 295 | 314 |
| units of time taken off on a frame | 1 | 1 |
| points for each unit | 50 | 50 |
| frames from the count's end to the picture being cleared | 0 | 143 |
| frames the card shows before the next level is played | 121 | 161 |
| the level's number, before and after | 1, 2 | 1, 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:
RTSBefore this one: Losing a life and starting again, the way Mario does