Compare commits
5 Commits
SQC-31
...
SQC-15_ani
Author | SHA1 | Date | |
---|---|---|---|
|
2e30995f1b | ||
|
9572a7d6fd | ||
|
f22c405915 | ||
|
bc7127ef7d | ||
|
06a5bb67d3 |
@@ -41,8 +41,11 @@ typedef uint8_t BlockType;
|
||||
enum BLOCK_TYPE { BTYPE_AIR, BTYPE_DIRT, BTYPE_GRASS, BTYPE_METAL, BTYPE_ICE, BTYPE_GREENGRASS, BTYPE_LAST };
|
||||
typedef uint8_t BoostType;
|
||||
enum BOOST_TYPE { BTYPE_SPEED, BTYPE_HEAL, BTYPE_DAMAGE, BTYPE_INVINCIBLE, BTYPE_BOOST_LAST };
|
||||
|
||||
//anim
|
||||
enum ANIM_TYPE { STILL = 0, SHOOTING = 8, JUMPING = 16, JUMPINGSHOOTING = 24, DEAD = 32, TYPE_LAST = 40};
|
||||
enum ANIM_POS {FRONT, QUARTER_FRONT_LEFT, QUATER_FRONT_RIGHT, PROFIL_LEFT, PROFIL_RIGHT, QUARTER_BACK_LEFT, QUARTER_BACK_RIGHT, BACK , POS_LAST};
|
||||
|
||||
typedef uint64_t Timestamp;
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@@ -248,6 +248,8 @@ void Player::SetDirection(Vector3f dir) { m_direction = dir; }
|
||||
|
||||
Vector3f Player::GetPosition() const { return Vector3f(m_position.x + CHUNK_SIZE_X * WORLD_SIZE_X / 2, m_position.y, m_position.z + CHUNK_SIZE_Z * WORLD_SIZE_Y / 2); }
|
||||
|
||||
Vector3f Player::GetPositionAbs() const { return m_position; }
|
||||
|
||||
Vector3f Player::GetVelocity() const { return m_velocity; }
|
||||
|
||||
Vector3f Player::GetPOV() const { return Vector3f(GetPosition().x, m_POV, GetPosition().z); }
|
||||
|
@@ -26,6 +26,7 @@ public:
|
||||
|
||||
void SetDirection(Vector3f dir);
|
||||
Vector3f GetPosition() const;
|
||||
Vector3f GetPositionAbs() const;
|
||||
Vector3f GetDirection() const;
|
||||
Vector3f GetVelocity() const;
|
||||
Vector3f GetPOV() const;
|
||||
|
@@ -100,7 +100,7 @@ void Connection::Run(World* world) {
|
||||
in.keys.right,
|
||||
in.keys.jump, false, el), world, el);
|
||||
|
||||
out.position = player.get()->GetPosition();
|
||||
out.position = player.get()->GetPositionAbs();
|
||||
out.direction = in.direction;
|
||||
out.timestamp = in.timestamp;
|
||||
out.id = m_playinfo.id;
|
||||
|
@@ -28,8 +28,17 @@
|
||||
#define BASE_WIDTH 640
|
||||
#define BASE_HEIGHT 480
|
||||
|
||||
|
||||
#define ANIME_PATH_JUMP "./media/textures/AssetOtherPlayer/FinalPNGJumping/"
|
||||
#define ANIME_PATH_STILL "./media/textures/AssetOtherPlayer/FinalPNGStanding/"
|
||||
|
||||
//1 = jump shoot sans anim, 2 = jump shoot avec anim
|
||||
#define ANIM_PATH_JSHOOT1 "./media/textures/AssetOtherPlayer/FinalPNGJumpingShooting/"
|
||||
#define ANIM_PATH_JSHOOT2 "./media/textures/AssetOtherPlayer/FinalPNGJumpingShooting/ShootingJump/"
|
||||
//1 = shoot sans anim, 2 = shoot avec anim
|
||||
#define ANIM_PATH_SSHOOT1 "./media/textures/AssetOtherPlayer/FinalPNGShooting/"
|
||||
#define ANIM_PATH_SSHOOT2 "./media/textures/AssetOtherPlayer/FinalPNGShooting/Shooting/"
|
||||
|
||||
#define TEXTURE_PATH "./media/textures/"
|
||||
#define SHADER_PATH "./media/shaders/"
|
||||
#define AUDIO_PATH "./media/audio/"
|
||||
|
@@ -76,7 +76,7 @@ void Engine::DrawSplachScreen()
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
|
||||
m_gamestate = GameState::MAIN_MENU;
|
||||
m_gamestate = GameState::OPTIONS;
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ void Engine::DrawMenu()
|
||||
glVertex2i(0, 200);
|
||||
glEnd();*/
|
||||
|
||||
MenuOptionsTexture.Bind();
|
||||
/*MenuOptionsTexture.Bind();
|
||||
glTranslated(0, -100, 0);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
@@ -170,7 +170,7 @@ void Engine::DrawMenu()
|
||||
glVertex2i(sButton, 200);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2i(0, 200);
|
||||
glEnd();
|
||||
glEnd();*/
|
||||
|
||||
MenuQuitTexture.Bind();
|
||||
glTranslated(0, -100, 0);
|
||||
@@ -188,7 +188,7 @@ void Engine::DrawMenu()
|
||||
}
|
||||
else
|
||||
{
|
||||
MenuOptionsTexture.Bind();
|
||||
/*MenuOptionsTexture.Bind();
|
||||
glTranslated(200, 0, 0);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
@@ -201,7 +201,7 @@ void Engine::DrawMenu()
|
||||
glVertex2i(0, 200);
|
||||
glEnd();
|
||||
|
||||
/*WireFrameTexture.Bind();
|
||||
WireFrameTexture.Bind();
|
||||
glTranslated(0, 300, 0);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
@@ -212,9 +212,9 @@ void Engine::DrawMenu()
|
||||
glVertex2i(sButton, 200);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2i(0, 200);
|
||||
glEnd();*/
|
||||
glEnd();
|
||||
|
||||
/*OnOffBtnTexture.Bind();
|
||||
OnOffBtnTexture.Bind();
|
||||
glTranslated(200, 0, 0);
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
@@ -226,7 +226,7 @@ void Engine::DrawMenu()
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2i(0, 200);
|
||||
glEnd();
|
||||
glTranslated(-400, -300, 0);*/
|
||||
glTranslated(-400, -300, 0);
|
||||
|
||||
MusicTexture.Bind();
|
||||
glTranslated(200, 200, 0);
|
||||
@@ -265,7 +265,7 @@ void Engine::DrawMenu()
|
||||
glVertex2i(sButton, 200);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2i(0, 200);
|
||||
glEnd();
|
||||
glEnd();*/
|
||||
}
|
||||
|
||||
//glEnable(GL_LIGHTING);
|
||||
@@ -278,7 +278,7 @@ void Engine::DrawMenu()
|
||||
ShowCursor();
|
||||
}
|
||||
|
||||
void Engine::DrawOption()
|
||||
void Engine::DrawPause()
|
||||
{
|
||||
static const int sTitle = 400;
|
||||
static const int sButton = 225;
|
||||
@@ -295,36 +295,19 @@ void Engine::DrawOption()
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
|
||||
MenuBGTexture.Bind();
|
||||
PauseBGTexture.Bind();
|
||||
glLoadIdentity();
|
||||
glBegin(GL_QUADS);
|
||||
glTexCoord2f(0, 0);
|
||||
glVertex2i(0, 0);
|
||||
glTexCoord2f(1, 0);
|
||||
glVertex2i(Width(), 0); //
|
||||
glVertex2i(800, 0);
|
||||
glTexCoord2f(1, 1);
|
||||
glVertex2i(Width(), Height());
|
||||
glVertex2i(800, 600);
|
||||
glTexCoord2f(0, 1);
|
||||
glVertex2i(0, Height());
|
||||
glVertex2i(0, 600);
|
||||
glEnd();
|
||||
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBlendEquation(GL_FUNC_ADD);
|
||||
glEnable(GL_BLEND);
|
||||
|
||||
//glEnable(GL_LIGHTING);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
ShowCursor();
|
||||
}
|
||||
|
||||
void Engine::Init() {
|
||||
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
@@ -457,9 +440,7 @@ void Engine::LoadResource() {
|
||||
|
||||
LoadTexture(MenuTitleTexture, TEXTURE_PATH "BrouillonbackgroundMenu.png");
|
||||
LoadTexture(MenuBGTexture, TEXTURE_PATH "BrouillonbackgroundMenu.png");
|
||||
|
||||
LoadTexture(MenuBGOptionTexture, TEXTURE_PATH "BrouillonbackgroundMenu.png");
|
||||
|
||||
LoadTexture(PauseBGTexture, TEXTURE_PATH "BrouillonbackgroundMenu.png");
|
||||
LoadTexture(SplachScreenTexture, TEXTURE_PATH "sc2.png");
|
||||
LoadTexture(MenuQuitTexture, MENU_ITEM_PATH "BasicQuit.png");
|
||||
LoadTexture(MenuOptionsTexture, MENU_ITEM_PATH "test.png");
|
||||
@@ -478,28 +459,70 @@ void Engine::LoadResource() {
|
||||
|
||||
//AJOUTER LES TEXTURES DANS L'ORDRE DE L'ÉNUM
|
||||
|
||||
//STILL//STANDING
|
||||
TextureAtlas::TextureIndex StillFront = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueFrontRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeft.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRight.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilLeft.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueProfilRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueLeftBack.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueRightBack.png");
|
||||
//TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueBackRight.png");
|
||||
|
||||
//SHOOTINGSTILL SANS TIRER
|
||||
//TextureAtlas::TextureIndex StillFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueFrontRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingLeft.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueProfilShootingRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackLeftShootingLeft.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueBackRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex StillBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT1 "BlueShootingBackRight.png");
|
||||
|
||||
//SHOOTINGSTILL TIRER
|
||||
//TextureAtlas::TextureIndex StillFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueFrontRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontLeftFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueLeftShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueProfilShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackLeftShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueBackRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex StillBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_SSHOOT2 "BlueShootingBackRightShoot1.png");
|
||||
|
||||
|
||||
//JUMP
|
||||
//TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpFront = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueFrontJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftFrontJumpLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightFrontJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBackJumpLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBackJumpRight.png");
|
||||
//TextureAtlas::TextureIndex JumpBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackJumpRight.png");
|
||||
|
||||
|
||||
//SHOOTINGJUMP SANS TIRER
|
||||
//TextureAtlas::TextureIndex JumpFrontShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontJumpRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontLeftJumpLeftShootingLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueFrontRightJumpRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueProfilLeftJumpLeftShootingLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BluerProfilRightJumprightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackLeftShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackLeftJumpLeftShootingLeft.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackRightShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackRightJumpRightShootingRight.png");
|
||||
//TextureAtlas::TextureIndex JumpBackShoot = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT1 "BlueBackJumpRightShootingRight.png");
|
||||
|
||||
|
||||
//SHOOTINGJUMP TIRER
|
||||
//TextureAtlas::TextureIndex JumpFrontShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontJumpRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontLeftJumpLeftShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterFrontRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueFrontRightJumpRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueProfilLeftJumpLeftShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpProfiltRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BluerProfilRightJumprightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackLeftShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackLeftJumpLeftShootingLeftShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpQuarterBackRightShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackRightJumpRightShootingRightShoot1.png");
|
||||
//TextureAtlas::TextureIndex JumpBackShootFire = m_animeAtlas.AddTexture(ANIM_PATH_JSHOOT2 "BlueBackJumpRightShootingRightShoot1.png");
|
||||
|
||||
//STILL
|
||||
//TextureAtlas::TextureIndex StillBack = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueBackRight.png");
|
||||
TextureAtlas::TextureIndex StillFront = m_animeAtlas.AddTexture(ANIME_PATH_STILL "BlueFrontRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeftBack.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterBackRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRightBack.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilLeft.png");
|
||||
//TextureAtlas::TextureIndex StillProfiltRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueProfilRight.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontLeft = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueLeft.png");
|
||||
//TextureAtlas::TextureIndex StillQuarterFrontRight = m_animeAtlas.AddTexture(ANIME_PATH_JUMP "BlueRight.png");
|
||||
|
||||
//SHOOTINGSTILL
|
||||
//SHOOTINGJUMP
|
||||
|
||||
if (!m_animeAtlas.Generate(TEXTURE_SIZE, false)) {
|
||||
std::cout << " Unable to generate texture atlas ..." << std::endl;
|
||||
@@ -1260,12 +1283,16 @@ void Engine::Render(float elapsedTime) {
|
||||
Sync sync;
|
||||
uint64_t id = m_conn.getId();
|
||||
static std::vector<char*> lsPck;
|
||||
static uint64_t sync_acc = 0;
|
||||
sync_acc += tstamp;
|
||||
|
||||
if (false) { // TODO: Faire un checkup pour chaque ~1000ms.
|
||||
if (sync_acc >= 1000) {
|
||||
sync_acc -= 1000;
|
||||
sync.sid = id;
|
||||
sync.timestamp = tstamp;
|
||||
sync.position = m_player.GetPosition();
|
||||
sync.position = m_player.GetPositionAbs();
|
||||
sync.hp = m_player.GetHP();
|
||||
|
||||
// TODO: Garrocher ca quelque-part.
|
||||
}
|
||||
|
||||
@@ -1313,15 +1340,14 @@ void Engine::Render(float elapsedTime) {
|
||||
lsPck.clear();
|
||||
}
|
||||
}
|
||||
else if (m_gamestate == GameState::MAIN_MENU)
|
||||
else if (m_gamestate == GameState::MAIN_MENU || m_gamestate == GameState::OPTIONS)
|
||||
{
|
||||
DrawMenu();
|
||||
}
|
||||
else if (m_gamestate == GameState::SINGLEMULTI)
|
||||
DisplaySingleOrMultiplayerMenu();
|
||||
else if (m_gamestate == GameState::OPTIONS)
|
||||
{
|
||||
DrawOption();
|
||||
if (!m_soloMultiChoiceMade) {
|
||||
DisplaySingleOrMultiplayerMenu();
|
||||
}
|
||||
else {
|
||||
DrawMenu();
|
||||
}
|
||||
}
|
||||
else if (m_gamestate == GameState::PAUSE)
|
||||
{
|
||||
@@ -1534,13 +1560,11 @@ void Engine::MousePressEvent(const MOUSE_BUTTON& button, int x, int y) {
|
||||
else if (m_gamestate == GameState::MAIN_MENU)
|
||||
{
|
||||
if ((m_mousemx >= 285 && m_mousemx <= 490) && (m_mousemy >= 150 && m_mousemy <= 250))
|
||||
m_gamestate = GameState::SINGLEMULTI;
|
||||
m_gamestate = GameState::PLAY;
|
||||
if ((m_mousemx >= 305 && m_mousemx <= 450) && (m_mousemy >= 300 && m_mousemy <= 400))
|
||||
m_gamestate = GameState::OPTIONS;
|
||||
if ((m_mousemx >= 305 && m_mousemx <= 450) && (m_mousemy >= 450 && m_mousemy <= 500))
|
||||
m_gamestate = GameState::QUIT;
|
||||
}
|
||||
else if (m_gamestate == GameState::SINGLEMULTI)
|
||||
else if (m_gamestate == GameState::OPTIONS)
|
||||
{
|
||||
float buttonWidthProportion = 0.4f;
|
||||
float buttonHeightProportion = 0.075f;
|
||||
|
@@ -31,7 +31,7 @@ public:
|
||||
Engine();
|
||||
virtual ~Engine();
|
||||
virtual void DrawMenu();
|
||||
virtual void DrawOption();
|
||||
virtual void DrawPause();
|
||||
virtual void DrawSplachScreen();
|
||||
virtual void Init();
|
||||
virtual void DeInit();
|
||||
@@ -107,20 +107,15 @@ private:
|
||||
std::chrono::high_resolution_clock::time_point m_startTime;
|
||||
|
||||
//Menu
|
||||
enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY,SINGLEMULTI };
|
||||
|
||||
enum class GameState: uint8_t { MAIN_MENU, OPTIONS, QUIT, NEWG, PLAY, PAUSE };
|
||||
GameState m_gamestate = GameState::MAIN_MENU;
|
||||
Texture MenuTitleTexture;
|
||||
Texture MenuBGTexture;
|
||||
Texture MenuBGOptionTexture;
|
||||
Texture MenuStartTexture;
|
||||
Texture MenuQuitTexture;
|
||||
Texture MenuOptionsTexture;
|
||||
Texture PauseBGTexture;
|
||||
Texture SplachScreenTexture;
|
||||
Texture MusicTexture; //TODO
|
||||
Texture OnOffBtnTexture;//TODO
|
||||
Texture BackBtnTexture;//TODO
|
||||
|
||||
|
||||
float m_scale;
|
||||
|
Before Width: | Height: | Size: 264 KiB |
Before Width: | Height: | Size: 320 KiB |
Before Width: | Height: | Size: 337 KiB |
Before Width: | Height: | Size: 360 KiB |
Before Width: | Height: | Size: 394 KiB |
Before Width: | Height: | Size: 339 KiB |
Before Width: | Height: | Size: 374 KiB |
Before Width: | Height: | Size: 656 KiB |
Before Width: | Height: | Size: 653 KiB |
Before Width: | Height: | Size: 656 KiB |
Before Width: | Height: | Size: 652 KiB |
Before Width: | Height: | Size: 485 KiB |
Before Width: | Height: | Size: 512 KiB |
Before Width: | Height: | Size: 575 KiB |
Before Width: | Height: | Size: 512 KiB |
Before Width: | Height: | Size: 575 KiB |
Before Width: | Height: | Size: 716 KiB |
Before Width: | Height: | Size: 732 KiB |
Before Width: | Height: | Size: 715 KiB |
Before Width: | Height: | Size: 731 KiB |
Before Width: | Height: | Size: 629 KiB |
Before Width: | Height: | Size: 649 KiB |
Before Width: | Height: | Size: 644 KiB |
Before Width: | Height: | Size: 646 KiB |
Before Width: | Height: | Size: 326 KiB |
Before Width: | Height: | Size: 268 KiB |
Before Width: | Height: | Size: 660 KiB |
Before Width: | Height: | Size: 680 KiB |
Before Width: | Height: | Size: 659 KiB |
Before Width: | Height: | Size: 680 KiB |
Before Width: | Height: | Size: 486 KiB |
Before Width: | Height: | Size: 494 KiB |
Before Width: | Height: | Size: 517 KiB |
Before Width: | Height: | Size: 493 KiB |
Before Width: | Height: | Size: 517 KiB |
Before Width: | Height: | Size: 695 KiB |
Before Width: | Height: | Size: 710 KiB |
Before Width: | Height: | Size: 701 KiB |
Before Width: | Height: | Size: 728 KiB |
Before Width: | Height: | Size: 696 KiB |
Before Width: | Height: | Size: 732 KiB |
Before Width: | Height: | Size: 694 KiB |
Before Width: | Height: | Size: 710 KiB |
Before Width: | Height: | Size: 410 KiB |
Before Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 413 KiB |
Before Width: | Height: | Size: 402 KiB |
Before Width: | Height: | Size: 413 KiB |
@@ -33,48 +33,51 @@ void RemotePlayer::Init()
|
||||
|
||||
void RemotePlayer::Feed(const netprot::Output out) {
|
||||
|
||||
//current.position = out.position;
|
||||
//current.direction = out.direction;
|
||||
//current.states = out.states;
|
||||
//current.id = out.id;
|
||||
current.position = out.position;
|
||||
current.direction = out.direction;
|
||||
current.states = out.states;
|
||||
current.id = out.id;
|
||||
|
||||
//if (current.position != previous.position)
|
||||
//{
|
||||
// Vector3f positionDelta = current.position - previous.position;
|
||||
// m_position = current.position + positionDelta;
|
||||
// m_direction = current.direction;
|
||||
if (current.position != previous.position)
|
||||
{
|
||||
Vector3f positionDelta = current.position - previous.position;
|
||||
m_position = current.position + positionDelta;
|
||||
m_direction = current.direction;
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
//if(current.direction != previous.direction)
|
||||
//{
|
||||
// m_direction = current.direction;
|
||||
// current.direction = current.direction;
|
||||
//}
|
||||
if(current.direction != previous.direction)
|
||||
{
|
||||
m_direction = current.direction;
|
||||
current.direction = current.direction;
|
||||
}
|
||||
|
||||
//if (current.states.shooting) {
|
||||
// m_animstate = Anim::SHOOTING;
|
||||
//}
|
||||
//else if (current.states.jumping) {
|
||||
// m_animstate = Anim::JUMPING;
|
||||
//}
|
||||
//else if (current.states.dead) {
|
||||
// m_animstate = Anim::DEAD;
|
||||
//}
|
||||
//else if(current.states.powerup){
|
||||
// m_animstate = Anim::POWERUP;
|
||||
//}
|
||||
//else if (current.states.still) {
|
||||
// m_animstate = Anim::STILL;
|
||||
//}
|
||||
//else if (current.states.running) {
|
||||
// m_animstate = Anim::RUNNING;
|
||||
//}
|
||||
if (current.states.shooting) {
|
||||
m_animstate = Anim::SHOOTING;
|
||||
}
|
||||
else if (current.states.jumping) {
|
||||
m_animstate = Anim::JUMPING;
|
||||
}
|
||||
else if (current.states.dead) {
|
||||
m_animstate = Anim::DEAD;
|
||||
}
|
||||
else if(current.states.powerup){
|
||||
m_animstate = Anim::POWERUP;
|
||||
}
|
||||
else if (current.states.still) {
|
||||
m_animstate = Anim::STILL;
|
||||
}
|
||||
else if (current.states.running) {
|
||||
m_animstate = Anim::RUNNING;
|
||||
}
|
||||
|
||||
//previous.direction = current.direction;
|
||||
//previous.position = current.position;
|
||||
//previous.states = current.states;
|
||||
//previous.id = current.id;
|
||||
previous.direction = current.direction;
|
||||
previous.position = current.position;
|
||||
previous.states = current.states;
|
||||
previous.id = current.id;
|
||||
|
||||
m_direction = current.direction;
|
||||
m_position = current.position;
|
||||
}
|
||||
|
||||
void RemotePlayer::Render(TextureAtlas& atlas, Shader& shader, Transformation tran, float elapsedTime)
|
||||
|