Source: src/include/cl_gameobj.h


Annotated List
Files
Globals
Hierarchy
Index
//Game Object (9.11.2002)
// Basic object structure - the parrent structure of object
// in game. All other game structures can be herited from
// this structure.

#ifndef SIRIEL_GAMEOBJ_CLASS
#define SIRIEL_GAMEOBJ_CLASS

#include 
using namespace std;

//Objects (look on SGI pages for more)
#include 
#include 
#include 
#include 
#include 

#include "ex_drs.h"

#include "define.h"
#include "si_system.h"
#include "cl_anim.h"
#include "cl_stage.h"
//#include "cl_level.h"

class GAMEOBJ
{
	public:
	int	x, y, z;	//coordinates in cartesian system
	int	xs, ys;		//size
	int	falling;	//bool of fall
	int	jump;
	int	fall_counter;
	
//	private:	- is it necessary?
	int	mc;		//moition counter
	ANIM	*anim;
	BITMAP	*bmp;
	string	animkey;	//which part of animation is used
	int	lastmove;
//	LEVEL	*lev;
	STAGE	*stage;
	int	animspeed, speedc;
	int	animated;

	//internal object structures for optimization
	int	obj_id;
	string	obj_name;
	string	obj_type;
	int	obj_para;
	int	obj_active;	//if object acts in game
	int	obj_weight;	//weight of object
	int	obj_control;	//object is controlled by keyborad

	//property hash
	map 	property_int;	//list of object's properties
	map 	property_str;	//list od object's properties

	string	para_key;

	int k_up, k_down, k_left, k_right;
	
	public:
	void init();
	void connect_stage(STAGE *s);	//replace of setlevel
//	GAMEOBJ(ANIM *anim_);
	void xy(int x_, int y_);
	int setxy(int x_, int y_);
	int move(int x_, int y_);
	int move(int m);		//motin of controlling objects
	void setanim(ANIM *anim_);
	void update_size();
	int  processable();	//test if object is available and we cen processit
	int  process();		//process object action - move animation
	void control_process(int type);		//keyboard control of object
	
	void setscreen(BITMAP *bmp_);
	void setanimkey(string s);
	void changedirection(int dir);	//change movement direction
	void aply_speed_x();		//try to change animation in x axis
	void aply_speed_y();		//try to change animation in y axis

	void set_animspeed(int i);
	void set_anim_property(int animat, int apos, int aspeed);
	
//	void set_level(LEVEL *l);
	void draw();
	int getx();
	int gety();

	int collision(GAMEOBJ &o); //detects colision
	int check_walk_points(int x, int y);

	void id(int i);
	int id();

	void name(string s);
	string name();

	void type(string s);
	string type();

// collisions
	int bb_collision(GAMEOBJ *p);	//bounding box
	void drs_rectangle();

	int start_jump();
	void stop_jump();

	void set_para_key(string s);

	void active(int i);
	int active();

	void control(int i);
	int control();

	void set_property(string name, int value);
	void set_property(string name, string value);
	string get_property_str(string name);
	int get_property_int(string name);
};

#endif


Generated by: georgik on armada on Sat Jul 24 07:07:15 2004, using kdoc 2.0a54.