doodle/Debug Notes.md
Noah Petherbridge 41e1838549 Add JS + History to Shell, Add Main Scene
* The shell now supports an "eval" command, or "$" for short.
  * Runs it in an Otto JavaScript VM.
  * Some global variables are available, like `d` is the Doodle object
    itself, `log`, `RGBA()` and `Point()`
* The shell supports paging through input history using the arrow keys.
* Added an initial Main Scene
2018-07-25 19:38:54 -07:00

47 lines
924 B
Markdown

# Debug Notes
## Entering Debug Mode
Command line argument:
```bash
% doodle -debug
# running the dev build uses debug mode by default
% make run
```
In the developer console:
```dos
> boolProp Debug true
> boolProp D true
```
## Debug Options
The `boolProp` command can also be used to toggle on and off different
debug options while the game is running.
```
DebugOverlay
DO
Toggles the main debug text overlay with FPS counter.
DebugCollision
DC
Toggles the collision detection bounding box lines.
```
## JavaScript Shell
The developer console can parse JavaScript commands for more access to the
game's internal objects.
The following global variables are available to the shell:
* `d` is the master Doodle struct.
* `log` is the master logger object for logging messages to the terminal.
* `RGBA()` is the `render.RGBA()` function for creating a Color value.
* `Point(x, y)` to create a `render.Point`