Commit Graph

13 Commits (41e1838549125f9488f4751f0c0b199e1c001c46)

Author SHA1 Message Date
Noah 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
Noah 94c1df050b Add initial User Interface Toolkit
With Labels and Buttons so far.

* Labels are pretty much complete, they wrap a render.Text and have a
  Compute() method that returns their Width and Height when rendered
  onto an SDL Surface.
* Buttons wrap a Label widget and Compute() its size and takes that into
  consideration when rendering itself. Buttons render themselves from
  scratch in a "Windows 95" themed way, with configurable colors, border
  widths and outline.
2018-07-25 09:03:49 -07:00
Noah e141203c4b Basic Collision Detection, Toggle Between Play/Edit
Known bugs:
* The Pixel format in the Grid has DX and DY attributes and
  it wreaks havoc on collision detection in Play Mode when you
  come straight from the editor. Reloading the map from disk to
  play is OK cuz it lacks these attrs.
2018-07-23 20:10:53 -07:00
Noah 9356502a50 Implement Developer Console with Initial Commands
Implements the dev console in-game with various commands to start out
with.

Press the Enter key to show or hide the console. Commands supported:

new
    Start a new map in Edit Mode.

save [filename.json]
    Save the current map to disk. Filename is required unless you
    have saved recently.

edit filename.json
    Open a map from disk in Edit Mode.

play filename.json
    Play a map from disk in Play Mode.
2018-07-21 20:43:01 -07:00
Noah 30be42c343 Abstract away all SDL logic into isolated package 2018-07-21 17:12:22 -07:00
Noah 90f1704886 Add initial Play scene 2018-06-20 19:00:46 -07:00
Noah ede3d58e1d Restructure the app to be scene-based 2018-06-20 18:43:14 -07:00
Noah 27fafdc96d Save and restore maps as JSON files
First pass at a level storage format to save and restore maps.

To save a map: press F12. It takes a screenshot PNG into the
screenshots/ folder and outputs a map JSON in the working directory.

To restore a map: "go run cmd/doodle/main.go map.json"
2018-06-17 10:31:44 -07:00
Noah 407ef7f455 Milestone: Screenshot to PNG Test Feature 2018-06-17 07:56:51 -07:00
Noah f8fe40c5ef Add global tick counter for debugging, fix unclick state errors 2018-06-16 20:21:42 -07:00
Noah b7751507e4 Stabilize frame rate, add debug overlay 2018-06-16 19:59:23 -07:00
Noah 33e8cff79f Some initial pixel drawing with the mouse 2017-10-26 19:26:54 -07:00
Noah 8c884d4cab Initial commit 2017-10-26 18:03:11 -07:00