4 Player::Player(Game
* agame
) {
8 game
->gravityManager
->subscribe(this);
11 Ponto
Player::leftFeet() {
16 Ponto
Player::rightFeet() {
21 Ponto
Player::leftArm() {
26 Ponto
Player::rightArm() {
31 Ponto
Player::cintura() {
36 Ponto
Player::pescoco() {
41 void Player::desenha() {
43 glTranslatef(getX(),getY(),0);
44 Ponto leftfeet
= leftFeet();
45 Ponto rightfeet
= rightFeet();
46 Ponto hips
= cintura();
47 Ponto leftarm
= leftArm();
48 Ponto rightarm
= rightArm();
49 Ponto neck
= pescoco();
51 glVertex3f(hips
.x
,hips
.y
,0);
52 glVertex3f(neck
.x
,neck
.y
,0);
54 glVertex3f(leftfeet
.x
,leftfeet
.y
,0);
55 glVertex3f(hips
.x
,hips
.y
,0);
57 glVertex3f(rightfeet
.x
,rightfeet
.y
,0);
58 glVertex3f(hips
.x
,hips
.y
,0);
60 glVertex3f(leftarm
.x
,leftarm
.y
,0);
61 glVertex3f(neck
.x
,neck
.y
,0);
63 glVertex3f(rightarm
.x
,rightarm
.y
,0);
64 glVertex3f(neck
.x
,neck
.y
,0);
67 glTranslatef(neck
.x
,neck
.y
-10,0);
74 Rect
Player::getBaseRect() {
75 Ponto leftfeet
= leftFeet();
76 Ponto rightfeet
= rightFeet();
77 Rect
ret(leftfeet
.x
+getX(),leftfeet
.y
+getY(),rightfeet
.x
+getX(),-10+getY()+std::min(leftfeet
.y
,rightfeet
.y
));