home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
thx
/
include
/
player.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-08
|
2KB
|
65 lines
// -------- player.h
#ifndef PLAYER_H
#define PLAYER_H
#include "perform.h"
class SceneDirector;
class Player : public Performer {
char *gfxlib; // name of .gfx file with Player images
char *sfxlib; // name of .sfx file with Player sounds
short int x, y; // current screen location
short int px, py; // previous screen location
short int h, w; // current image size
short int ph, pw; // previous image size
short int imageno; // current image
short int is_visible; // true if Player is being displayed
short int ticker;
short int interval;
short int clipped; // true if image is to be clipped
short int cx1, cy1, cx2, cy2; // clip coordinates
short int in_update_position;
short int posted_x, posted_y; // posted screen location
short int posted_imageno; // posted image
void displayframe();
friend class SceneDirector;
protected:
SceneDirector *director;
virtual void initialize();
public:
Player(char *gl = 0, char *sl = 0, int intv = 1);
virtual ~Player() { }
void set_imageno(short int in);
short int get_imageno()
{ return imageno; }
short int getx() const
{ return x; }
short int gety() const
{ return y; }
void setx(short int nx);
void sety(short int ny);
void setxy(short int nx, short int ny);
short int getheight() const
{ return h; }
short int getwidth() const
{ return w; }
void stillframe(short int im, short int wait);
virtual void appear()
{ is_visible = 1; }
virtual void disappear();
int isvisible()
{ return is_visible; }
virtual void update_position() { }
void clip(int x1, int y1, int x2, int y2);
void unclip()
{ clipped = 0; }
int isclipped()
{ return clipped; }
void setinterval(short int inv)
{ interval = inv; ticker = 0; }
};
#endif