-
Notifications
You must be signed in to change notification settings - Fork 0
/
SnakeNode.h
44 lines (32 loc) · 843 Bytes
/
SnakeNode.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef SNAKE_NODE_H
#define SNAKE_NODE_H
#include <SFML/Graphics.hpp>
namespace sfSnake
{
class SnakeNode
{
public:
SnakeNode(bool ishead,sf::Vector2f position = sf::Vector2f(0, 0));
void setPosition(sf::Vector2f position);
void setPosition(float x, float y);
void move(float xOffset, float yOffset);
sf::Vector2f getPosition() const;
sf::FloatRect getBounds() const;
sf::FloatRect getInnerBounds() const;
void createshape(/*sf::Vector2f position = sf::Vector2f(0, 0)*/);
static const float Width;
static const float Height;
void rotate(float radian);
void render(sf::RenderWindow&);
float getRadian() const;
void setRadian(float radian);
void spritesetPosition(sf::Vector2f position);
private:
sf::Sprite rectan;
//sf::CircleShape shape_;
sf::Vector2f position_;
sf::Sprite head;
float radian0_;
};
};
#endif