/* level.h --- level information
 *
 * This file is gift-ware.  This file is given to you freely
 * as a gift.  You may use, modify, redistribute, and generally hack
 * it about in any way you like, and you do not have to give anyone
 * anything in return.
 *
 * I do not accept any responsibility for any effects, adverse or
 * otherwise, that this code may have on just about anything that
 * you can think of.  Use it at your own risk.
 *
 * Copyright (C) 1999  Michael Bukin
 */

#ifndef __bma_level_h
#define __bma_level_h

/* Some defines (must be synced with everything).  */
#define MAP_WIDTH	29
#define MAP_HEIGHT	22
#define MAX_GHOST	5
#define MAX_BONUS	8

#define CELL_VOID	0
#define CELL_COIN	1
#define CELL_DOOR	2
#define CELL_WALL	3

#define DIR_NONE	0
#define DIR_LEFT	-1
#define DIR_RIGHT	1
#define DIR_UP		-1
#define DIR_DOWN	1

#define EATER_ENTER	0
#define EATER_DEATH	1

#define GHOST_ENTER	0
#define GHOST_WAIT	1
#define GHOST_SEARCH	2
#define GHOST_BONES	3
#define GHOST_ESCAPE	4

#define BONUS_VISIBLE	0
#define BONUS_HIDDEN	1
#define BONUS_ABSENT	2

#define PRIZE_VISIBLE	0
#define PRIZE_ABSENT	1

#define SPEED_SHIFT	3

/* Actor description.  */
struct actor_t
{
  int x, y, x0, y0;
  int cdx, cdy;
  int ndx, ndy;
  int state, state_count;
  int frame, frame_count;
};

/* Level info.  */
extern int eater_speed;
extern int ghost_speed;
extern int ghost_count;
extern int bonus_count;
extern int coin_count;
extern struct actor_t eater;
extern struct actor_t prize;
extern struct actor_t ghost[MAX_GHOST];
extern struct actor_t bonus[MAX_BONUS];
extern int map_info[MAP_HEIGHT][MAP_WIDTH];

#ifdef __cplusplus
extern "C" {
#endif

  /* Initialize map for new level.  */
  void game_map_init (int level);

  /* Restart level.  */
  void game_level_restart (int level);

  /* Draw current map.  */
  void game_draw_map (BITMAP *buffer);

#ifdef __cplusplus
}
#endif

#endif /* !__bma_level_h */

/*
 * level.h ends here
 */
