|
| Board (int width, int height, Style style) |
| Creates a new Board. More...
|
|
bool | isWall (int x, int y) |
| Tells if there's a wall at #x #y.
|
|
bool | isBorder (int x, int y) |
|
int | getW () |
|
int | getH () |
|
void | draw (Window *win) |
|
void | randomlyFillExceptBy (int x, int y) |
| Places random walls all over the Board except by #x and #y, allowing the Player to move a little bit when starting. More...
|
|
void | teleport (Player *player) |
| Makes the Player teleport if it's on a border.
|
|
void | clear () |
| Makes the whole level empty.
|
|
void | setBoard (std::vector< std::vector< bool > > &newBoard) |
| Sets the whole level content. More...
|
|
int | getStartX () |
|
int | getStartY () |
|
void | setStartX (int x) |
|
void | setStartY (int y) |
|
void | setMetadata (std::string name, std::string value) |
| Sets a meta information from this level.
|
|
std::string | getMetadata (std::string name) |
| Gets a meta information from this level. More...
|
|
bool | hasMetadata (std::string name) |
| Tells if this level has a specific information attached.
|
|
void | scrollLeft () |
|
void | scrollRight () |
|
void | scrollUp () |
|
void | scrollDown () |
|
A level where the snake runs and eats fruits.
- Note
- I couldn't name this class "Level" because it could get confusing with the concept of game speed, which is also based on the word "Level".
This class represents a single level the snake can play on.
It is essentially a 2D matrix of tiles, where each can be either "Walls" or "Empty.
It also contains some extra info, like the position where the player should spawn, and (if this level was created by someone) the author, date and stuff.
Definition at line 32 of file Board.hpp.