PutkaRTS icon indicating copy to clipboard operation
PutkaRTS copied to clipboard

Task: Object graphics

Open Metabolix opened this issue 14 years ago • 0 comments

We will need animations from multiple directions, and the object size may vary. Different actions (such as shooting) will also require animations. If needed, modify the World::ObjectType and World::ObjectAction classes to neatly support these.

Decide a format for the animation. Either create a separate index file or code it in a single image using some nice color such as 0xff00ff for separating the frames. Animations for different actions will be stored separately, "objects/<type>/<action>.png" or something.

Create a class that handles a single animation. Use something similar to GUI::ImageCache (but a lot simpler) for the animations to avoid duplicates and reloading. The cache should be organised by object type and action (strings). Use some special strings like "begin", "default", "move" and "end" for states that do not have a real action associated.

Update GUI::GameObject so that it uses the graphics.

Update GUI::GameHandler so that it keeps a GUI::GameObject for each visible object. Handle dead objects nicely: display death animation and then remove from the list. For optimization, drop GUI::GameObject instances after some time if the object isn't visible anymore.

Metabolix avatar Mar 19 '11 00:03 Metabolix