Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
DinkRoy authored Apr 30, 2024
1 parent e2064bc commit 3f2ac55
Showing 1 changed file with 26 additions and 21 deletions.
47 changes: 26 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,29 +78,34 @@
right: "50%",
joystickInput: false,
inputValues: [4, 5, 6, 7]
},
{
type: "button",
text: "Start",
id: "start",
location: "right",
top: 160,
fontSize: 15,
block: true,
input_value: 3
},
{
type: "button",
text: "Select",
id: "select",
location: "left",
left: 80,
top: 160,
fontSize: 15,
block: true,
input_value: 2
}
]
EJS_onGameStart = function(e) {
(async() => {
let sleep = (ms) => new Promise(r => setTimeout(r, ms));
let state = "suspended";
let popup;
while (state === "suspended") {
if (!window.AL) return;
AL.currentCtx.sources.forEach(ctx => {
state = ctx.gain.context.state;
});
if (state !== "suspended") break;
if (!popup) {
popup = EJS_emulator.createPopup("", {});
const button = EJS_emulator.createElement("div");
button.innerText = "Click to resume Emulator";
button.style.width = "25%";
button.style.height = "25%";
popup.appendChild(button);
button.style["text-align"] = "center";
button.style["font-size"] = "28px";
}
await sleep(10);
}
if (popup) EJS_emulator.closePopup();
})();
}
</script>
<script src="data/loader.js"></script>
</body>
Expand Down

0 comments on commit 3f2ac55

Please sign in to comment.