Spaces:
Running
Running
WatchOutForMike
commited on
Commit
β’
301e2c9
1
Parent(s):
a1f88e8
Update main.js
Browse files
main.js
CHANGED
@@ -1,19 +1,17 @@
|
|
1 |
-
const { Alpine } = window.Alpine;
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
})();
|
14 |
-
|
15 |
-
function
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
console.log("DaisyUI loaded");
|
|
|
1 |
+
const { Alpine } = window.Alpine; const { Daisy } = window.Daisy;
|
2 |
+
|
3 |
+
(() => { const root = document.getElementById("app"); root.innerHTML = ${root.innerHTML} {{#each wrestler in wrestlers}} <div class="wrestler"> <h3>${wrestler.name}</h3> <button class="btn btn-success" @click="${() => onWrestlerClick(wrestler)}">Play</button> </div> {{/each}}; })();
|
4 |
+
|
5 |
+
function onWrestlerClick(wrestler) { console.log(Clicked on wrestler ${wrestler.name}); alert(You clicked on wrestler ${wrestler.name}); playSound("wrestling_bell"); updateGameState(wrestler); }
|
6 |
+
|
7 |
+
function updateGameState(wrestler) { // Add code to update the game state with the selected wrestler }
|
8 |
+
|
9 |
+
function playSound(soundName) { // Add code to play a sound effect using the soundName }
|
10 |
+
|
11 |
+
const moves = [ { name: "Uppercut", damage: 10, }, { name: "Jab", damage: 5, }, { name: "Hook", damage: 15, }, { name: "Knee", damage: 10, }, { name: "Elbow", damage: 15, }, ];
|
12 |
+
|
13 |
+
function onMoveClick(move) { console.log(Clicked on move ${move.name}); alert(You selected the ${move.name} move); updateMove(move); }
|
14 |
+
|
15 |
+
function updateMove(move) { // Add code to update the move in the game state }
|
16 |
+
|
17 |
+
console.log("DaisyUI loaded");
|
|
|
|