nsnake
Classic snake game for the terminal
|
Public Types | |
enum | Direction { UP, DOWN, LEFT, RIGHT } |
Public Member Functions | |
Player (int x, int y) | |
bool | isAlive () |
int | getSize () |
int | getX () |
Returns the head's x position. | |
int | getY () |
Returns the head's y position. | |
void | moveTo (int x, int y) |
void | move (Direction direction) |
void | kill () |
void | update (Board *board) |
void | draw (Window *win) |
bool | headHit (int x, int y) |
bool | bodyHit (int x, int y, bool isCheckingHead=false) |
Tells if something at #x and #y collides with any part of the snake. More... | |
void | increase () |
Definition at line 23 of file Player.hpp.
bool Player::bodyHit | ( | int | x, |
int | y, | ||
bool | isCheckingHead = false |
||
) |
Tells if something at #x and #y collides with any part of the snake.
Definition at line 146 of file Player.cpp.