A sprite is a collection of images used in-game. Depending on how a sprite is used, the individual images may be frames of an object’s animation or angles in an object’s rotation. It is defined by three files:
Maybe.
If you’re adding new ships or other objects, you’ll probably need sprites for them. If you have no new objects, or are just modifying existing objects, then you don’t need to add any sprites.
A sprite has three associated files in the sprites directory. The sprite map has the .pn extension. The sprite image ends in /image.png. The overlay image ends in /overlay.png.
By convention, sprites have the same name as the object that uses them.
A sprite map is a procyon file with the following fields:
Field | Req? | Type |
---|---|---|
frames | yes | array of frames |
A sprite’s image and overlay are PNG images. They must have the same size. The frames in the sprite map reference parts of the image and overlay.
By default, only the sprite image is used, and the sprite overlay is ignored. The overlay is used to re-color sprites when a player has a hue.
An array of maps specifying the individual frames, each with the following fields:
Field | Req? | Type |
---|---|---|
left | yes | integer |
top | yes | integer |
right | yes | integer |
bottom | yes | integer |
cx | yes | integer |
cy | yes | integer |
The sprite image is bounded by the rect contained in {left, top, right, bottom}. The center of the sprite is the point at {cx, cy}. Both are offset from the upper-left-hand corner of the image and overlay.