playable moar
This commit is contained in:
+10
-4
@@ -288,7 +288,7 @@ void Engine::Initiate()
|
|||||||
netText->text = "";
|
netText->text = "";
|
||||||
netText->fontsize = 0.5f;
|
netText->fontsize = 0.5f;
|
||||||
netText->Color = { 1.0f, 1.0f, 1.0f };
|
netText->Color = { 1.0f, 1.0f, 1.0f };
|
||||||
netText->t2d.position = { 1.0f, 0.0f, 0.0f, 40.0f };
|
netText->t2d.position = { 1.0f, 0.0f, 0.0f, 110.0f };
|
||||||
netText->t2d.center = { 1.0f, 0.0f };
|
netText->t2d.center = { 1.0f, 0.0f };
|
||||||
netText->textCenter = { 1.0f, 0.5f };
|
netText->textCenter = { 1.0f, 0.5f };
|
||||||
netText->t2d.size = { 0.0f, 0.0f, 360.0f, 40.0f };
|
netText->t2d.size = { 0.0f, 0.0f, 360.0f, 40.0f };
|
||||||
@@ -309,12 +309,12 @@ void Engine::Initiate()
|
|||||||
TextBox* hpText = new TextBox();
|
TextBox* hpText = new TextBox();
|
||||||
hpText->font = arial;
|
hpText->font = arial;
|
||||||
hpText->text = "100/100 HP";
|
hpText->text = "100/100 HP";
|
||||||
hpText->fontsize = 0.7f;
|
hpText->fontsize = 0.6f;
|
||||||
hpText->Color = { 1.0f, 1.0f, 1.0f };
|
hpText->Color = { 1.0f, 1.0f, 1.0f };
|
||||||
hpText->t2d.position = { 0.0f, 1.0f, 20.0f, -20.0f };
|
hpText->t2d.position = { 0.0f, 1.0f, 20.0f, -20.0f };
|
||||||
hpText->t2d.center = { 0.0f, 1.0f };
|
hpText->t2d.center = { 0.0f, 1.0f };
|
||||||
hpText->textCenter = { 0.0f, 0.5f };
|
hpText->textCenter = { 0.0f, 0.5f };
|
||||||
hpText->t2d.size = { 0.0f, 0.0f, 220.0f, 50.0f };
|
hpText->t2d.size = { 0.0f, 0.0f, 400.0f, 90.0f };
|
||||||
hpText->BindToRenderSystem();
|
hpText->BindToRenderSystem();
|
||||||
|
|
||||||
TextBox* grappleText = new TextBox();
|
TextBox* grappleText = new TextBox();
|
||||||
@@ -457,6 +457,8 @@ void Engine::Initiate()
|
|||||||
float slideCooldown = 0.0f;
|
float slideCooldown = 0.0f;
|
||||||
const float dashCooldownTime = 1.5f; // seconds between dashes
|
const float dashCooldownTime = 1.5f; // seconds between dashes
|
||||||
float dashCooldown = 0.0f;
|
float dashCooldown = 0.0f;
|
||||||
|
const float shootCooldownTime = 0.5f; // seconds between shots
|
||||||
|
float shootCooldown = 0.0f;
|
||||||
glm::vec3 slideDir(0.0f);
|
glm::vec3 slideDir(0.0f);
|
||||||
|
|
||||||
// Shockwave (key Q): projectile that explodes on the first surface it touches. The blast
|
// Shockwave (key Q): projectile that explodes on the first surface it touches. The blast
|
||||||
@@ -646,7 +648,10 @@ void Engine::Initiate()
|
|||||||
camera->ProcessMouseMovement(xoffset, yoffset);
|
camera->ProcessMouseMovement(xoffset, yoffset);
|
||||||
}
|
}
|
||||||
else if (buffer.GetType() == Mouse::Event::Type::LPress) {
|
else if (buffer.GetType() == Mouse::Event::Type::LPress) {
|
||||||
Shoot();
|
if (shootCooldown <= 0.0f) {
|
||||||
|
shootCooldown = shootCooldownTime;
|
||||||
|
Shoot();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (buffer.GetType() == Mouse::Event::Type::RPress) {
|
else if (buffer.GetType() == Mouse::Event::Type::RPress) {
|
||||||
camera->lockedcursor = !camera->lockedcursor;
|
camera->lockedcursor = !camera->lockedcursor;
|
||||||
@@ -802,6 +807,7 @@ void Engine::Initiate()
|
|||||||
grappleCooldown = std::max(grappleCooldown - deltatime, 0.0f);
|
grappleCooldown = std::max(grappleCooldown - deltatime, 0.0f);
|
||||||
slideCooldown = std::max(slideCooldown - deltatime, 0.0f);
|
slideCooldown = std::max(slideCooldown - deltatime, 0.0f);
|
||||||
dashCooldown = std::max(dashCooldown - deltatime, 0.0f);
|
dashCooldown = std::max(dashCooldown - deltatime, 0.0f);
|
||||||
|
shootCooldown = std::max(shootCooldown - deltatime, 0.0f);
|
||||||
const float accel = 40.0f;
|
const float accel = 40.0f;
|
||||||
const float damp = 0.75f;
|
const float damp = 0.75f;
|
||||||
const float groundTopSpeed = movespeed * accel * refDt * damp / (1.0f - damp);
|
const float groundTopSpeed = movespeed * accel * refDt * damp / (1.0f - damp);
|
||||||
|
|||||||
Reference in New Issue
Block a user