Skip to content

Commit

Permalink
Week 2
Browse files Browse the repository at this point in the history
  • Loading branch information
solcloud committed Sep 25, 2022
1 parent 021bbac commit 6287afc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Core/Ramp.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
// todo use only walls and floors for fewer walls and floors or use box $sides param
$this->boxes[] = new Box($point->clone(), $width, $heightSum, $depth);

$heightSum = $stairsGrowingUp ? $heightSum + $stepHeight : $heightSum - $stepHeight;
$heightSum = $stairsGrowingUp ? $heightSum + $stepHeight : $heightSum - $stepHeight; // TODO fix going down
if ($direction->x <> 0) {
$point->addX(($direction->x > 0 ? 1 : -1) * $stepDepth);
} else {
Expand Down
3 changes: 3 additions & 0 deletions test/simulation/data/requests/002.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
public function onTickEnd(GameState $state, int $tick): void
{
$pp = $state->getPlayer(1)->getPositionImmutable();
if ($pp->z > 2435) {
$this->fail("Outside map, tick: $tick");
}
if ($pp->y === 0 && $pp->z === 2435) {
if ($pp->x === 1169) {
$this->fail("Inside Box, tick: $tick");
Expand Down
8 changes: 8 additions & 0 deletions www/assets/js/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export class Game {
}

pause(msg, timeMs) {
const game = this
this.players.forEach(function (player) {
if (player.data.id === game.playerMe.id) {
return
}
player.object.visible = true
})
this.#started = true
this.#paused = true
console.log("Pause: " + msg + " for " + timeMs + "ms")
Expand Down Expand Up @@ -98,6 +105,7 @@ export class Game {
}

playerKilled(playerIdDead, playerIdCulprit, wasHeadshot, killItemId) {
this.players[playerIdDead].object.visible = false
this.#hud.showKill(
this.players[playerIdCulprit].data,
this.players[playerIdDead].data,
Expand Down

0 comments on commit 6287afc

Please sign in to comment.