#ifndef OBJ_GD_DYN_H_
#define OBJ_GD_DYN_H_

#include "main.h"

#define SOBJ_GD_DYN_RANGE 4
#define SOBJ_GD_DYN_DESTROY_PERCENT 10

/* private structure for object OBJID_GD_DYN */
struct sobj_gd_dyn {
  struct VG_Rect rect;       /* rectangle-position */
  struct VG_Rect rect_expl;  /* rectangle-position of exploding */
  VG_BOOL playerhit;         /* when exploding, whether OBJID_PLAYER was already hit */
  int to_north, to_east, to_south, to_west;  /* explosion-range: 0 to SOBJ_GD_DYN_RANGE */

  /* status */
  enum { SOBJ_GD_DYN_INACTIVE = 0,
         SOBJ_GD_DYN_ACTIVE,
         SOBJ_GD_DYN_EXPLODING
       } status;

  /* images and sprites */
  struct {
    struct VG_Image *dyn0;     /* image when inactive */
    struct VG_Sprite *dyn1;    /* sprite when active */
    struct VG_Sprite *expl;    /* exploding sprite */
  } images;
};

#endif /* OBJ_GD_DYN_H_ */
