WatchOutForMike commited on
Commit
301e2c9
β€’
1 Parent(s): a1f88e8

Update main.js

Browse files
Files changed (1) hide show
  1. main.js +17 -19
main.js CHANGED
@@ -1,19 +1,17 @@
1
- const { Alpine } = window.Alpine;
2
- const { Daisy } = window.Daisy;
3
-
4
- (() => {
5
- const root = document.getElementById("app");
6
- root.innerHTML = `${root.innerHTML}
7
- {{#each wrestler in wrestlers}}
8
- <div class="wrestler">
9
- <h3>${wrestler.name}</h3>
10
- <button class="btn btn-success" @click="${() => onWrestlerClick(wrestler)}">Play</button>
11
- </div>
12
- {{/each}}`;
13
- })();
14
-
15
- function onWrestlerClick(wrestler) {
16
- console.log(`Clicked on wrestler ${wrestler.name}`);
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");