feat: add char selection

This commit is contained in:
2023-12-24 03:12:49 +08:00
parent 3bb0b0b753
commit 2532235a8d
2 changed files with 44 additions and 11 deletions

View File

@@ -31,17 +31,8 @@
<button id="start-button" onclick="startGame()"></button>
<script>
function startGame() {
// 定义游戏页面的数组
var gamePages = ['qinshihuanggame.html', 'luoisgame.html'];
// 生成一个随机索引
var randomIndex = Math.floor(Math.random() * gamePages.length);
// 使用随机索引从数组中选择一个游戏页面
var selectedGame = gamePages[randomIndex];
// 跳转到选中的游戏页面
window.location.href = selectedGame;
// 跳转
window.location.href = "choice.html";
}
</script>
</body>