54 lines
961 B
C++
54 lines
961 B
C++
#ifndef BACKGROUND_H
|
|
#define BACKGROUND_H
|
|
|
|
|
|
#include <cstdint>
|
|
#include <stdlib.h>
|
|
|
|
#include <azur/gint/render.h>
|
|
|
|
#include <vector>
|
|
#include "num/num.h"
|
|
|
|
#include "player.h"
|
|
|
|
struct Map {
|
|
/*width, height and the number of layer of the map*/
|
|
int w, h, nblayers;
|
|
|
|
/*the tileset to use*/
|
|
bopti_image_t *tileset;
|
|
int tileset_size;
|
|
|
|
/*list of all the tiles*/
|
|
short *layers[];
|
|
};
|
|
|
|
|
|
class Level
|
|
{
|
|
public:
|
|
Level( );
|
|
~Level( );
|
|
|
|
void Update( float dt );
|
|
void Render( void );
|
|
void RenderSelected( uint8_t i, uint8_t j );
|
|
|
|
void ChangeMap( int level, Player *MyPlayer );
|
|
void UpdateDataMap( Player *MyPlayer );
|
|
|
|
bool CanGo( Player *MyPlayer );
|
|
bool IsOnGround( Player *MyPlayer );
|
|
|
|
private:
|
|
int GetTileBackground( uint16_t x, uint16_t y );
|
|
int GetTileForeground( uint16_t x, uint16_t y );
|
|
int GetTileBackgroundINT( uint8_t x, uint8_t y );
|
|
int GetTileForegroundINT( uint8_t x, uint8_t y );
|
|
};
|
|
|
|
|
|
|
|
#endif
|