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