diff --git "a/docs/01_Env/ENV_07_\343\203\206\343\202\271\343\203\210\346\223\215\344\275\234\346\211\213\351\240\206.txt" "b/docs/01_Env/ENV_07_\343\203\206\343\202\271\343\203\210\346\223\215\344\275\234\346\211\213\351\240\206.txt" index a9d8e84..9d943c7 100644 --- "a/docs/01_Env/ENV_07_\343\203\206\343\202\271\343\203\210\346\223\215\344\275\234\346\211\213\351\240\206.txt" +++ "b/docs/01_Env/ENV_07_\343\203\206\343\202\271\343\203\210\346\223\215\344\275\234\346\211\213\351\240\206.txt" @@ -60,6 +60,7 @@ ・MOVE_TICK_MS: 移動送信間隔 (ms) ・BOT_SPEED: 移動速度 ・BOT_RADIUS: プレイヤー半径 + ・BOT_CAN_MOVE: ボット移動の有効化 (true/false) ・START_DELAY_MS: 開始遅延 (ms) ・MAX_X: X座標上限 ・MAX_Y: Y座標上限 diff --git a/test/load-bot.constants.ts b/test/load-bot.constants.ts index 95eb9a4..9be73a9 100644 --- a/test/load-bot.constants.ts +++ b/test/load-bot.constants.ts @@ -13,6 +13,7 @@ export const START_DELAY_MS = 800; export const MAX_X = GAME_CONFIG.GRID_COLS; export const MAX_Y = GAME_CONFIG.GRID_ROWS; +export const BOT_CAN_MOVE = true; export const ROOM_ID = "03"; export const START_GAME = true; export const SOCKET_PATH = NETWORK_CONFIG.SOCKET_IO_PATH; diff --git a/test/load-bot.ts b/test/load-bot.ts index 928e386..aaa57b9 100644 --- a/test/load-bot.ts +++ b/test/load-bot.ts @@ -1,6 +1,7 @@ import { io } from "socket.io-client"; import { BOTS, + BOT_CAN_MOVE, DURATION_MS, JOIN_DELAY_MS, MAX_X, @@ -62,6 +63,7 @@ roomId: ROOM_ID, durationMs: DURATION_MS, joinDelayMs: JOIN_DELAY_MS, + botCanMove: BOT_CAN_MOVE, startGame: START_GAME, startDelayMs: START_DELAY_MS, moveTickMs: MOVE_TICK_MS, @@ -121,6 +123,10 @@ }; const tickMove = () => { + if (!BOT_CAN_MOVE) { + return; + } + const dtSec = MOVE_TICK_MS / 1000; posX += dirX * BOT_SPEED * dtSec; posY += dirY * BOT_SPEED * dtSec; @@ -174,7 +180,7 @@ } // サーバー状態と同期後に定期的な移動イベントを送信。 - if (gameStarted && !moveTimer && MOVE_TICK_MS > 0) { + if (gameStarted && BOT_CAN_MOVE && !moveTimer && MOVE_TICK_MS > 0) { updateDirection(); moveTimer = setInterval(tickMove, MOVE_TICK_MS); }