Laid groundwork for creating a snake body
Laid groundwork for creating a snake body. Implementation should be added and working next push.
This commit is contained in:
parent
3d8dcf23ac
commit
c03b16f0e9
@ -26,33 +26,33 @@ void SnakeMovement(sf::Keyboard keyboard)
|
|||||||
/*
|
/*
|
||||||
if (keyboard.pressed(Left))
|
if (keyboard.pressed(Left))
|
||||||
snakeHead.moveleft();
|
snakeHead.moveleft();
|
||||||
|
|
||||||
if (keyboard.pressed(Right))
|
if (keyboard.pressed(Right))
|
||||||
snakeHead.moveRight();
|
snakeHead.moveRight();
|
||||||
if (keyboard.pressed(Down))
|
if (keyboard.pressed(Down))
|
||||||
snakeHead.moveDown();
|
snakeHead.moveDown();
|
||||||
if (keyboard.pressed(Up))
|
if (keyboard.pressed(Up))
|
||||||
snakeHead.moveUp();
|
snakeHead.moveUp();
|
||||||
if (!snakeHead.isTouchingFood())
|
|
||||||
snakeQueue.pop();
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Snake::ExtendSnake()
|
void Snake::ExtendSnake()
|
||||||
{
|
{
|
||||||
/*
|
// Create a new deque RectangleShape without popping old
|
||||||
snakeBody.push_back(newLocation);
|
|
||||||
*/
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Snake::MoveSnake()
|
void Snake::MoveSnake()
|
||||||
{
|
{
|
||||||
/*
|
// Create a new deque RectangleShape and pop old
|
||||||
head.snakeBody()
|
// Todo: Depreciate ExtendSnake and just add a collision test
|
||||||
*/
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Snake::Snake()
|
||||||
|
{
|
||||||
|
// Possibly unnecessary
|
||||||
|
// The big 3 could be used to create a fresh game state
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// SnakeNode::SnakeNode();
|
// SnakeNode::SnakeNode();
|
||||||
|
@ -21,6 +21,7 @@ class Snake
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::deque<sf::RectangleShape> snakeBody;
|
std::deque<sf::RectangleShape> snakeBody;
|
||||||
|
Snake();
|
||||||
public:
|
public:
|
||||||
// Instead of popping like in MoveSnake()
|
// Instead of popping like in MoveSnake()
|
||||||
// Simply add to deque
|
// Simply add to deque
|
||||||
|
Loading…
Reference in New Issue
Block a user