11/15/09: Horizontal scrolling sprite demo by remz, | Tags: , , , , | Category: General, Programming | 6 comments - (Comments are closed)

Horizontal scrolling sprite demo

Hello Cocoers,

I have just finished coding a sprite demo engine for the CoCo 3, it has been uploaded here:
http://www.coco3.com/community/wp-content/uploads/2009/11/REMDISK_Sprite_Demo.zip

The demo features:
- Fullscreen resolution of 256×192 in 16 colors
- Fast and smooth scrolling background
- Up to 8 sprites, 16×16 pixels, with transparency support
- Very large background: 5440 pixels wide by 192 pixels = 522240 bytes of graphic compressed using tile maps
- 60 frames per second at all time
- Multiple animated background tiles
- Runs on a stock CoCo 3 with 128KB
- Color palette designed for RGB monitor

To control the demo:
At startup, the demo displays 6 sprites. You can’t control them, they circle around the screen.
Move joystick to the right to scroll (scrolling only works in one direction)
Use joystick buttons to add or remove sprites: Button #0 add 1 sprite (up to 8 on the screen), Button #1 remove 1 sprite.

Known bugs or limitations:
- When removing a sprite, sometimes a little bit of ‘garbage’ may be left on the screen
- Some sprites may flicker slightly when reaching the top of screen while scrolling, with background animated tiles.

The source code is 37,779 bytes long and took me countless hours to optimize. I believe this demo can prove a CoCo 3 is so versatile it could outperform a Commodore 64 at graphics.

Comments and suggestions are welcome!
Thank you,
Rem

Rem sprite demo

This post was submitted by remz.

6 comments to Horizontal scrolling sprite demo

  • briza

    Hi Rem.

    Just loaded the demo up. It is wicked mate. The scrolling and sprite movements are way smooth. As for the flickering of some sprites easy fixed for someone like yourself to do. Overall the demo is awesome.
    The more you do these demo the more I see a fully fledged Mario type clone been done on the coco 3. you have the Sprite character already designed. now you have background maps done. All I see now is adding them together and a score bar being added.
    You make a game for the coco 3 I will buy a copy for sure.

    laters

    Briza

  • Jason

    Just amazing :) I sure hope this eventuates into a game someday. I know that’s far easier said than done, but looks like you have the nuts and bolts side of it worked out. Great reuse of colors too. Very impressive

  • Very nice Remí!

    The minimum horizontal scroll of several pixels via $FF9F does not seem to have caused you too much trouble. :)

    Is the background effect just $FF9F or are you also shifting the screen data?

  • remz

    It is just $FF9F scrolling, with virtual screen enabled, and drawing next portion of map just outside the screen in front of the scrolling.
    The “minimum horizontal scroll problem” would have allowed to scroll slower :)
    Shifting the screen data is not possible at 60 frames per second, unless you shift only some portion of the screen (like Sockmaster’s Moon Patrol demo seems to do)

  • Paul

    this is cool… how do you do sprite transparencies?

  • remz

    Hi Paul
    The sprite transparency is automatic and free. It could even draw a 16 colors sprite + transparency. The sprite are actually “Compiled sprite”: they are a chunk of STA and LEA,… of precalculated code, so there is no branching and no testing at all during rendering. The transparent pixels are simply non-existent in the code.
    The actual sprite processor is a small Perl script I wrote.