I’ve been having a bit of fun with sprites and SmartBASIC this weekend. First I loaded up SpritePOWER which is a very nice sprite editor for ADAM that was created by Digital Express Inc. Digital Express created a lot of great software for the ADAM. SpritePOWER is really nice because it gives you the option of exporting your sprites as binary (so you can BLOAD them in BASIC), Z80 code (for use in assembly), or as an ASCII file of SmartBASIC code consisting of many DATA statements. For the BASIC code option it even lets you specify the starting line number and line increment value. Pretty slick.
I wanted to create a spaceship that I would later be able to fly with the joystick, so I’d need to create it facing in at least 4 different directions (I didn’t do the diagonal variants). I first created it facing east. SpritePOWER has a handy “flip grid” feature which made it easy to create the west-facing version. Unfortunately it doesn’t have a “rotate grid” feature.
To create the north/south facing sprites what I did was take a picture of the TV screen with my iPhone and then rotate the photo. This made it much easier for me to put the pixels in the right locations. Before long I had all 4 variations of my spaceship ready to fly! I opted to save my sprites in a binary format.
Coleco SmartBASIC 1.0 doesn’t offer any syntax support for sprites so using them involves knowing what and where to POKE. Thankfully, the SpritePOWER disk included a SmartBASIC program called “SpriteDemo” which showed me how to load and use my sprites. Part of the code even demonstrates how you can move a sprite onscreen using the joystick! I pulled this section of the code into its own program and modified it so that it would use my sprites. The original code would move the same sprite in any of the 4 directions. However, I wanted my program to change the sprite depending on which direction the ship was flying so I made those modifications too. If you’d like to see the SmartBASIC code, you can download it here.
There is something pretty satisfying about flying your own custom 8-bit spacecraft around the screen. Obviously there is a lot more I could do to enhance this code and possibly even use it as the foundation for a game. I may eventually do just that!