ja guarda la configuracio
This commit is contained in:
@@ -5,42 +5,43 @@
|
||||
#ifndef JOC_ASTEROIDES_HPP
|
||||
#define JOC_ASTEROIDES_HPP
|
||||
|
||||
#include "core/types.hpp"
|
||||
#include "game/constants.hpp"
|
||||
#include <SDL3/SDL.h>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include "core/types.hpp"
|
||||
#include "game/constants.hpp"
|
||||
|
||||
// Classe principal del joc
|
||||
class JocAsteroides {
|
||||
public:
|
||||
JocAsteroides(SDL_Renderer* renderer);
|
||||
~JocAsteroides() = default;
|
||||
JocAsteroides(SDL_Renderer *renderer);
|
||||
~JocAsteroides() = default;
|
||||
|
||||
void inicialitzar();
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar();
|
||||
void processar_input(const SDL_Event& event);
|
||||
void inicialitzar();
|
||||
void actualitzar(float delta_time);
|
||||
void dibuixar();
|
||||
void processar_input(const SDL_Event &event);
|
||||
|
||||
private:
|
||||
SDL_Renderer* renderer_;
|
||||
SDL_Renderer *renderer_;
|
||||
|
||||
// Estat del joc
|
||||
Triangle nau_;
|
||||
std::array<Poligon, Constants::MAX_ORNIS> orni_;
|
||||
std::array<Poligon, Constants::MAX_BALES> bales_;
|
||||
Poligon chatarra_cosmica_;
|
||||
uint16_t itocado_;
|
||||
// Estat del joc
|
||||
Triangle nau_;
|
||||
std::array<Poligon, Constants::MAX_ORNIS> orni_;
|
||||
std::array<Poligon, Constants::MAX_BALES> bales_;
|
||||
Poligon chatarra_cosmica_;
|
||||
uint16_t itocado_;
|
||||
|
||||
// Funcions de dibuix
|
||||
bool linea(int x1, int y1, int x2, int y2, bool dibuixar);
|
||||
void rota_tri(const Triangle& tri, float angul, float velocitat, bool dibuixar);
|
||||
void rota_pol(const Poligon& pol, float angul, bool dibuixar);
|
||||
// Funcions de dibuix
|
||||
bool linea(int x1, int y1, int x2, int y2, bool dibuixar);
|
||||
void rota_tri(const Triangle &tri, float angul, float velocitat,
|
||||
bool dibuixar);
|
||||
void rota_pol(const Poligon &pol, float angul, bool dibuixar);
|
||||
|
||||
// Moviment
|
||||
void mou_orni(Poligon& orni, float delta_time);
|
||||
void mou_bales(Poligon& bala, float delta_time);
|
||||
void tocado();
|
||||
// Moviment
|
||||
void mou_orni(Poligon &orni, float delta_time);
|
||||
void mou_bales(Poligon &bala, float delta_time);
|
||||
void tocado();
|
||||
};
|
||||
|
||||
#endif // JOC_ASTEROIDES_HPP
|
||||
|
||||
Reference in New Issue
Block a user