bat.h

来自「乒乓球游戏程序」· C头文件 代码 · 共 35 行

H
35
字号
/*----------------------------------------------------------------
 * bat.h -- interface to bat module
 *----------------------------------------------------------------
 *  I've modularised the game objects.  The bat module does
 *  everything to do with the bat.
 */

#ifndef gf_included_bat_h
#define gf_included_bat_h


struct bat_t {
	int x,y;        /* Coordinates (of top left point) on the screen */
	int l;          /* length */
	int colour;
	
	/* drawn_*:
	 *  These next variables describe a rectangle in the arena 
	 *  that covers the bat's image; they're updated when the 
	 *  bat is drawn so that the erasing code knows which area 
	 *  of the display to restore.
	 */ 
	int drawn_x,drawn_y,drawn_l,drawn_h;
};


void bat_setup (struct bat_t *ptr, int x, int y, int l, int c);
void bat_unsetup (struct bat_t *ptr);
void bat_update (struct bat_t *ptr);
void bat_draw (BITMAP *bmp, struct bat_t *ptr);
void bat_erase (BITMAP *bmp, BITMAP *bkgnd, struct bat_t *ptr);


#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?