Using Sprites

Existing resources that cover sprites include Smart Graphics – Part 5 and the ZenSky and Spartacus demos. Here we break much of Spartacus down into smaller focussed demos to make the code easier for you to understand and learn from. The original demo has a bouncing, rotating title, a moving wall in the foreground, another moving image in the middle, a scrolling message in a bitmapped font, a stationary credit ("BY CIPHER-DIAZ") at the bottom and music.

Our first demonstration shows the rotation and bouncing of the "Parallax" title. The second shows only the moving wall and the third shows the scrolling message and the credit. The third has some code that benefits from our added comments. Note that the display of the credit uses the bitmapped font already built into the W3BMPFont unit while the rendering of the scrolling message requires an image of all of the characters as a resource. The program code manipulates this background image without using W3BMPFont.

All of the above are form-based applications. The final demonstration shows you how to use a sprite in a canvas project.

Programming - a skill for life!

Useful for games, with drawing routines (including transforms and text fonts), images, sprites and WebGL 3D graphics. Now includes Box2D physics and rendering by Pixi.js.