1
0
Fork 0
mirror of https://github.com/imjasonh/nescript synced 2026-07-09 01:16:12 +00:00
nescript/examples/hello_sprite.ne
Claude a20ddcbbab
Add example games and quick-start guide
Two example .ne programs with compiled .nes ROMs:
- hello_sprite: d-pad controlled sprite movement
- bouncing_ball: auto-bouncing sprite with edge detection

Includes README with build instructions and emulator setup.

https://claude.ai/code/session_01W6eQFStA66EuMKHUFo2rx3
2026-04-11 22:17:18 +00:00

23 lines
506 B
Text

// Hello Sprite — the simplest NEScript program.
//
// Displays a smiley-face sprite on screen and moves it with the d-pad.
// Build: cargo run -- build examples/hello_sprite.ne
// Output: examples/hello_sprite.nes (open in any NES emulator)
game "Hello Sprite" {
mapper: NROM
}
var px: u8 = 128
var py: u8 = 120
on frame {
if button.right { px += 2 }
if button.left { px -= 2 }
if button.down { py += 2 }
if button.up { py -= 2 }
draw Smiley at: (px, py)
}
start Main