Only auto aim and healthbars
This commit is contained in:
1 parent
54c6327ac7
commit
a914bd74fe
14 files changed
+95
-89
No files matched your search
@@ -240,7 +240,6 @@ final class GameSimulator
|
||||
$keys = is_array($frame['keys'] ?? null) ? $frame['keys'] : [];
|
||||
$input->keys = array_values(array_filter($keys, 'is_string'));
|
||||
$input->fire = (bool) ($frame['fire'] ?? false);
|
||||
$input->autoAim = (bool) ($frame['autoAim'] ?? false);
|
||||
|
||||
$aim = $frame['aim'] ?? null;
|
||||
if (is_array($aim)) {
|
||||
@@ -265,10 +264,8 @@ final class GameSimulator
|
||||
$entry['engine']->tick($dt);
|
||||
|
||||
if ($room->state === Room::STATE_OVER) {
|
||||
$room->seq++;
|
||||
$this->broadcastRoom($room);
|
||||
} elseif ($this->frame % self::SNAPSHOT_EVERY === 0) {
|
||||
$room->seq++;
|
||||
$this->broadcastRoom($room);
|
||||
}
|
||||
}
|
||||
@@ -280,6 +277,8 @@ final class GameSimulator
|
||||
return;
|
||||
}
|
||||
|
||||
$room->seq++;
|
||||
|
||||
$players = [];
|
||||
foreach ($room->players as $player) {
|
||||
$players[] = $player->toSnapshot();
|
||||
|
||||
Reference in new issue
Block a user