Bouncing ball within a bouncing frame

Post Reply
MarkTheStrange
Posts: 22
Joined: Sat Nov 26, 2022 6:24 pm

Bouncing ball within a bouncing frame

Post by MarkTheStrange »

This was a challenge on the Facebook C64/C128 programmers group:

Create a sprite with a frame. Bounce a pixel within the sprite's frame. Bounce the sprite on the screen.

I thought an X16 version would be a fun task. The challenge was specifically to do it entirely in BASIC on the C64 using an expanded sprite (double-width, double-height) in a program with the smallest memory footprint (my X16 version takes up 244 bytes, but you get to stare at a screen doing nothing for many seconds while it initializes the sprite bitmap dynamically).

Since a square sprite makes for a boring bounce along a line between opposite corners, I made the ball bounce within a 48x42 rectangle inside the 64x64 sprite (to match an expanded sprite on the C64).
Screenshot 2025-02-19 at 17.14.51.png
Screenshot 2025-02-19 at 17.14.51.png (69.17 KiB) Viewed 413 times
Try It Now!
Attachments
METABOUNCE.PRG
(254 Bytes) Downloaded 27 times
Post Reply