2023-01-26 22:35:33 +01:00
|
|
|
#ifndef BACKGROUND_H
|
|
|
|
#define BACKGROUND_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include <azur/gint/render.h>
|
|
|
|
|
|
|
|
#include <vector>
|
2023-01-27 22:52:13 +01:00
|
|
|
#include "num/num.h"
|
2023-01-26 22:35:33 +01:00
|
|
|
|
|
|
|
struct Map {
|
|
|
|
/*width, height and the number of layer of the map*/
|
2023-01-29 19:55:11 +01:00
|
|
|
int w, h, nblayers;
|
2023-01-26 22:35:33 +01:00
|
|
|
|
|
|
|
/*the tileset to use*/
|
|
|
|
bopti_image_t *tileset;
|
|
|
|
int tileset_size;
|
|
|
|
|
|
|
|
/*list of all the tiles*/
|
2023-01-29 19:55:11 +01:00
|
|
|
short *layers[];
|
2023-01-26 22:35:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class Background
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Background( );
|
|
|
|
~Background( );
|
|
|
|
|
|
|
|
void Update( float dt );
|
|
|
|
void Render( );
|
2023-01-27 22:52:13 +01:00
|
|
|
|
2023-01-31 23:07:32 +01:00
|
|
|
void IncXCoordinate( libnum::num x );
|
|
|
|
void IncYCoordinate( libnum::num y );
|
|
|
|
|
|
|
|
int GetXCoordinate( void );
|
|
|
|
int GetYCoordinate( void );
|
|
|
|
|
2023-08-30 10:01:20 +02:00
|
|
|
void SetSpeed( libnum::num s );
|
|
|
|
|
2023-01-27 22:52:13 +01:00
|
|
|
private:
|
|
|
|
libnum::num xlevel, ylevel;
|
2023-08-30 10:01:20 +02:00
|
|
|
libnum::num speed;
|
2023-01-27 22:52:13 +01:00
|
|
|
|
2023-01-26 22:35:33 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|