Family 1 (Text) · rung 1.4 — move a message across the screen. More...
#include <snes.h>Functions | |
| int | main (void) |
| Entry point — print one line, then scroll BG1 forever. | |
Family 1 (Text) · rung 1.4 — move a message across the screen.
The Text ladder's "make it move" rung. It prints one line, then scrolls the whole text background horizontally every frame, so the message marches across the screen like a marquee and wraps around the 32x32 (256-pixel) tilemap seamlessly. The lesson: text lives on a BG layer, so you move it exactly like any other background — with bgSetScroll().
| int main | ( | void | ) |
Entry point — print one line, then scroll BG1 forever.
The message is written to the text tilemap once. From then on the frame loop only changes BG1's horizontal scroll offset; the PPU re-reads the same tilemap from a shifted origin, so the text appears to travel without a single extra VRAM write.