Advertisement
eliasYFGM

Juego de plataformas en C++/Allegro (Nivel.h)

Jul 21st, 2018
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.80 KB | None | 0 0
  1. // Nivel.h
  2. // Base para juego de plataformas en C++ y Allegro
  3.  
  4. #ifndef NIVEL_H_INCLUDED
  5. #define NIVEL_H_INCLUDED
  6.  
  7.  
  8. // Una plataforma o pared del nivel se representa por una "X" en una cadena.
  9. struct Plataforma
  10. {  float x, y;
  11.  
  12.    Plataforma(float _x, float _y) : x(_x), y(_y)
  13.    {}
  14. };
  15.  
  16.  
  17. // Función para crear el nivel con una cadena de caracteres (string).
  18. void Crear_Nivel(const char *cadena, float& inicio_x, float& inicio_y);
  19.  
  20. // Dibujar el nivel después de crearlo
  21. void Dibujar_Nivel();
  22.  
  23. // Destruir el nivel cuando ya no se necesite
  24. void Destruir_Nivel();
  25.  
  26. // Función para devolver el puntero de una plataforma en la posición indicada.
  27. // Si no hay plataformas en la posición, devolverá "nullptr".
  28. Plataforma *Checar_Plataforma(float _x, float _y);
  29.  
  30.  
  31. #endif // NIVEL_H_INCLUDED
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement