5
This commit is contained in:
parent
e8d456cc09
commit
9bf5188e0f
@ -117,7 +117,7 @@ private:
|
|||||||
Texture PauseBGTexture;
|
Texture PauseBGTexture;
|
||||||
Texture SplachScreenTexture;
|
Texture SplachScreenTexture;
|
||||||
|
|
||||||
Vector3f m_otherplayerpos = Vector3f(0, 0, 0);
|
Vector3f m_otherplayerpos = Vector3f(999, 999, 999);
|
||||||
|
|
||||||
float m_scale;
|
float m_scale;
|
||||||
float m_time = 0;
|
float m_time = 0;
|
||||||
|
@ -33,51 +33,52 @@ void RemotePlayer::Init()
|
|||||||
|
|
||||||
void RemotePlayer::Feed(const netprot::Output out) {
|
void RemotePlayer::Feed(const netprot::Output out) {
|
||||||
|
|
||||||
current.position = out.position;
|
m_position = Vector3f(out.position);
|
||||||
current.direction = out.direction;
|
//current.position = out.position;
|
||||||
current.states = out.states;
|
//current.direction = out.direction;
|
||||||
current.id = out.id;
|
//current.states = out.states;
|
||||||
|
//current.id = out.id;
|
||||||
|
|
||||||
if (current.position != previous.position)
|
//if (current.position != previous.position)
|
||||||
{
|
//{
|
||||||
Vector3f positionDelta = current.position - previous.position;
|
// Vector3f positionDelta = current.position - previous.position;
|
||||||
m_position = current.position + positionDelta;
|
// m_position = current.position + positionDelta;
|
||||||
m_direction = current.direction;
|
// m_direction = current.direction;
|
||||||
|
|
||||||
}
|
//}
|
||||||
|
|
||||||
if(current.direction != previous.direction)
|
//if(current.direction != previous.direction)
|
||||||
{
|
//{
|
||||||
m_direction = current.direction;
|
// m_direction = current.direction;
|
||||||
current.direction = current.direction;
|
// current.direction = current.direction;
|
||||||
}
|
//}
|
||||||
|
|
||||||
if (current.states.shooting) {
|
//if (current.states.shooting) {
|
||||||
m_animstate = Anim::SHOOTING;
|
// m_animstate = Anim::SHOOTING;
|
||||||
}
|
//}
|
||||||
else if (current.states.jumping) {
|
//else if (current.states.jumping) {
|
||||||
m_animstate = Anim::JUMPING;
|
// m_animstate = Anim::JUMPING;
|
||||||
}
|
//}
|
||||||
else if (current.states.dead) {
|
//else if (current.states.dead) {
|
||||||
m_animstate = Anim::DEAD;
|
// m_animstate = Anim::DEAD;
|
||||||
}
|
//}
|
||||||
else if(current.states.powerup){
|
//else if(current.states.powerup){
|
||||||
m_animstate = Anim::POWERUP;
|
// m_animstate = Anim::POWERUP;
|
||||||
}
|
//}
|
||||||
else if (current.states.still) {
|
//else if (current.states.still) {
|
||||||
m_animstate = Anim::STILL;
|
// m_animstate = Anim::STILL;
|
||||||
}
|
//}
|
||||||
else if (current.states.running) {
|
//else if (current.states.running) {
|
||||||
m_animstate = Anim::RUNNING;
|
// m_animstate = Anim::RUNNING;
|
||||||
}
|
//}
|
||||||
|
|
||||||
previous.direction = current.direction;
|
//previous.direction = current.direction;
|
||||||
previous.position = current.position;
|
//previous.position = current.position;
|
||||||
previous.states = current.states;
|
//previous.states = current.states;
|
||||||
previous.id = current.id;
|
//previous.id = current.id;
|
||||||
|
|
||||||
m_direction = current.direction;
|
//m_direction = current.direction;
|
||||||
m_position = current.position;
|
//m_position = current.position;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime)
|
void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime)
|
||||||
|
Loading…
Reference in New Issue
Block a user