Click here for free DL of the app version that can save data.
No:4348 1715
Prev Next
Pictogram Slot
Developer User3771|Date and time 23/6/27 20:22:36
Build time 17.176 sec|Game capacity 1.505KB|Script


僕は、絵文字スロットというゲームを作成しました。 HTMLファイルには、以下のようなコードを含みます。

絵文字スロット


JavaScriptコードには、以下のようなコードを含みます。 const reels = ["😀", "🤔", "😱", "😎", "🤓", "😂", "👻", "🤩", "😇"]; // スロットに表示されるアイテム const spinButton = document.querySelector("#spin-button"); // スピンボタン spinButton.addEventListener("click", () => { const reel1 = document.querySelector("#reel-1"); // リール1 const reel2 = document.querySelector("#reel-2"); // リール2 const reel3 = document.querySelector("#reel-3"); // リール3 const items = [reel1, reel2, reel3]; items.forEach(item => { const randomIndex = Math.floor(Math.random() * reels.length); item.innerHTML = reels[randomIndex]; }); }); これによって、ボタンが押されると、3つのリールが回転し、ランダムに選ばれたアイテムが表示されます。絵文字スロットを作成することで、スマートフォンでも楽しめるシンプルなゲームを作成しました。

Prev Next   Back  0  0 Menu 

[PR]現在の売れ筋ゲームランキング

Click here for free DL of the app version that can save data.

(C)2023 HisashiApp