#ifndef XJUMP_H_
#define XJUMP_H_

typedef struct{
	int x;
	int y;
	int vx;
	int vy;
	int dir;
	int jump;

	int pic;
	int g_count;

	int erase_x;
	int erase_y;

	int key[3];
}hero_t;


typedef struct{
	int graphic;
	int graphic_base;

	int floor;

	int y;

	int left;
	int right;

	int left_prev;

	int erase_x;
	int erase_y;
	int erase_width;

	int left_src;
	int right_src;

	int mu;

	/* moving */

	int move_vector;

	/* blink */

	int blink_interval;
	int blink_count;

	/* force */

	int force_vector;

	/* graphic phase */

	int phase;
}floor_t;


#define FLOOR_CLEAR	0
#define FLOOR_NORMAL	1
#define FLOOR_ICE	2
#define FLOOR_FORCE	3

#define WIDTH		32
#define HEIGHT		24
#define FLOOR_HEIGHT	5

#define KEY_UP	  0
#define KEY_RIGHT 1
#define KEY_LEFT  2

extern Display *Disp;
extern Window  Scr_d;
extern Pixmap Char_p,Floor_p[];
extern GC Gc_nomask,Gc_mask;

extern char *Myname;


void FLOOR_draw( floor_t *fp );
void FLOOR_refresh( void );
void FLOOR_create( int y );
void FLOOR_move( floor_t *fp, int scroll );
void FLOOR_move_all( int scroll );
floor_t *FLOOR_check(int hx, int hy);
void FLOOR_init( int level );


void GAME_init( int level );
int GAME_main( void );
int GAME_key_press( int key );
int GAME_key_release( int key );
#endif
