#2 - Start, Stop, Step


To get early access to devlogs and more you can support me on https://www.buymeacoffee.com/benstigsen

Interpreter

Some changes were made to the Brainf*ck interpreter. Before it worked by calling the function interpret(). While this would interpret correctly, it would also block everything else that was happening in the game. So while it was interpreting it wasn't possible to draw anything on the screen and since the process has to be visualized it doesn't make sense that the interpreter is blocking.

Fixing this also means that it was now possible to create an indicator, stop the interpreter, create step-by-step interpretation as well as show the cells being updated while the interpreter is running.

Start, Stop, Step

Three buttons where added to run the code, stop the code and go through the code step-by-step.

TextBox

The textbox where the user writes Brainf*ck code only allowed for 5 out of the 8 required characters to write in the Brainf*ck language. This is from devlog #1:

This has been discussed a bit on the DOME Discord and there has been opened GitHub issues for it, so it shouldn't be a limitation for too long.

While I do believe that this will be implemented at some point, being able to play the game is a priority. So I decided to update my UI library (DOMEUI). Now the textbox element contains three variables:

  • allowedKeys
    • This is a list of raw characters that the user is allowed to enter into the textbox.
      • Letters (not with caps-lock or shift)
      • Numbers
      • Some symbols (5 out of the 8 needed)
        • + - < , .
  • convertKeys
    • These are keys that are converted
      • Something like SPACE becomes " ".
      • ENTER becomes \n
  • combinations
    • These are a combination of keys e.g:
      • < and LeftShift becomes >
      • 8 and AltGr becomes [
      • 9 and AltGr becomes ]

This now makes it possible for the user to input all 8 required characters.

Indicator

An indicator was added to show what character is currently being interpreted.

It still needs more work in terms of alignment and it isn't going to be green when released.

Engine

The DOME game engine was also updated to the latest version (1.5.2) so that it's now possible to draw multi-line text on screen. https://github.com/domeengine/dome/pull/167

To-Do

  • Add current cell indicator
  • Add test-case system (level completion, correct and wrong results)
  • Add max possible loop amount (to avoid infinite loops when interpreting)
  • Add save / load system
  • Add multiple level pages to the menu
  • Add settings page
  • Add level descriptions
  • Add game manual
  • Add sound effects
  • Fix indicator and UI element alignment

Leave a comment

Log in with itch.io to leave a comment.