feat: update game
This commit is contained in:
13
index.html
13
index.html
@@ -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>
|
||||
|
Reference in New Issue
Block a user