feat: update game

This commit is contained in:
2023-12-13 20:39:01 +08:00
parent 8f2d6cc1a3
commit cc388b5e56
9 changed files with 188 additions and 8 deletions

View File

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