00001 #ifndef __LEVEL_H
00002 #define __LEVEL_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 class Level
00016 {
00017 private:
00018 int mission;
00019 Object *obj_player;
00020 int width;
00021 int height;
00022 int nobjects;
00023 int maxnobjects;
00024 Tile ***tiles;
00025 Object **objects;
00026 ObjectCell **objcells_by_tilex;
00027 GameTimer *game_timer;
00028 Input *input;
00029
00030 public:
00031 Level( string fname, TileInfo **_tilesinfo, ObjectInfo **_objectsinfo,
00032 GameTimer *_game_timer, ScoreManager *_score_manager, Input *_input );
00033 ~Level();
00034 void LoadMap( string fname );
00035 void AddObjectPos( Object*, int pos );
00036 void DeleteObjectPos( Object*, int pos );
00037 bool AddObject( Object* );
00038 void DeleteObject( Object* );
00039 bool CheckTileCollisions( Object*, Tile** );
00040
00041
00042
00043 Object *CheckObjectCollisions( Object * );
00044 ObjectCell *RemoveObjectCell( ObjectCell *objcell );
00045 void TilesAction( int xl, int xr, int interval);
00046 void ObjectsAction( int xl, int xr );
00047 void PlayerAction();
00048 void DrawTiles( int xposition, Display *display );
00049 void DrawObjects( int xposition, Display *display );
00050 int GameStatus();
00051 void EndLevel() { mission = 1; }
00052 Object *GetPlayer();
00053 int GetWidth();
00054 int GetHeight();
00055 };
00056
00057 #endif