Skip to content

Restart game (fresh) #33

Answered by okaybenji
tvb asked this question in Q&A
Discussion options

You must be logged in to vote

You can simply add a custom command to your game. Stick this in the HTML file:

<script>
  const clearScreen = () => document.querySelector('#output').innerHTML = '';
  const reload = () => {
    clearScreen();
    loadDisk();
  };
  commands[0] = Object.assign(commands[0], {reload});
</script>

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by okaybenji
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #30 on October 27, 2023 18:36.