Skip to content

Page 5: Sprite design

A. M. Cajal edited this page Dec 9, 2018 · 2 revisions

SPRITES DESIGN

The starts, the main element in the images, are treated as sprites. Each sprite is a "sub-image": another X*Y vector, each component representing a pixel and its color. However, in this case, certain elements are "empty", reproducing transparent pixels. This allows to overlap them, keeping a cool look.

Each sprite is coded as a specific sequence of instructions. In C terminology, each sprite is a function, which access to the array that holds the image data, an iterates over it modifying specific pixels to draw the pixel on it.

8bh_sprite_drawing

However, as the sprites becomes more complex, generate the functions manually would become a daunting task. The functions or sequence of instructions are generated automatically through a python script, which input is a spreadsheet (yes, a spreadsheet). Such spreadsheet has a specific format that allows the user to literally draw the sprites on it, selecting the color of each pixel. This puts all the effort in the "artistic" side, and reliefs the user from the programming part.

Thus, the elements involved in this process are:

  • The Spreadsheet, called 8bH_all_sprites.xlsx, and located under <root_dir>\project\dev\design
  • The python script, called 8bh_csv_to_sprite.py, and located under <root_dir>\project\scripts

The spreadsheet contains detailed instructions on how to create new sprites, and it includes several working examples. It is very easy to add new sprites! Some of the current ones are shown below:

8bh_sprite_collage

As a final note: this method of sprite design is somewhat similar to the Digitizer System from Sega.

Clone this wiki locally