Timer iznogoud.

This commit is contained in:
MarcEricMartel
2023-12-06 11:16:39 -05:00
parent 9c1cd885cf
commit c975265901
12 changed files with 118 additions and 54 deletions

View File

@@ -137,9 +137,19 @@ Timestamp Connection::Run(World* world) {
in.keys.right,
in.keys.jump, false, el), world, el);
if (player->GetPosition().y < -10.) {
player->InflictDamage(9000);
player->Killer = GetHash(true);
}
out.states.jumping = in.keys.jump;
out.states.running = player->GetVelocity().Length() > .3f;
out.states.dead = player->AmIDead();
if (player->AmIDead()) {
in.keys.shoot = false;
in.keys.block = false;
out.states.dead = true;
}
if (in.keys.block) {
bool block = false;
@@ -152,7 +162,7 @@ Timestamp Connection::Run(World* world) {
}
if (in.keys.shoot && m_shoot_acc <= 0.) {
Bullets.push_back(Bullet(player->GetPOV() + player->GetDirection(), player->GetDirection()));
Bullets.emplace_back(new Bullet(player->GetPOV() + player->GetDirection(), player->GetDirection(), GetHash(true)));
out.states.shooting = true;
}