From 8d855582edf2b6a774f18cbfa1cbc9ffdd29b19a Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 25 Jun 2019 18:58:48 -0700 Subject: [PATCH] Clean up documentation --- Building.md | 19 +++++ Makefile | 2 +- README.md | 174 +++++++++++++-------------------------------- docs/Milestones.md | 104 +++++++++++++++++++++++++++ 4 files changed, 175 insertions(+), 124 deletions(-) create mode 100644 docs/Milestones.md diff --git a/Building.md b/Building.md index bb3809f..84c2109 100644 --- a/Building.md +++ b/Building.md @@ -1,5 +1,24 @@ # Building Doodle +## Fonts + +The `fonts/` folder is git-ignored. The app currently uses font files here +named: + +* `DejaVuSans.ttf` for sans-serif font. +* `DejaVuSans-Bold.ttf` for bold sans-serif font. +* `DejaVuSansMono.ttf` for monospace font. + +These are the open source **DejaVu Sans [Mono]** fonts, so copy them in from +your `/usr/share/fonts/dejavu` folder or provide alternative fonts. + +```bash +mkdir fonts +cp /usr/share/fonts/dejavu/{DejaVuSans.ttf,DejaVuSans-Bold.ttf,DejaVuSansMono.ttf} fonts/ +``` + +## Makefile + Makefile commands for Linux: * `make setup`: install Go dependencies and set up the build environment diff --git a/Makefile b/Makefile index 6eebf7b..5031a4e 100644 --- a/Makefile +++ b/Makefile @@ -76,7 +76,7 @@ test: dist: build mkdir -p dist/doodle-$(VERSION) cp bin/* dist/doodle-$(VERSION)/ - cp -r assets fonts README.md Changes.md dist/doodle-$(VERSION)/ + cp -r assets fonts README.md dist/doodle-$(VERSION)/ cd dist && tar -czvf doodle-$(VERSION).tar.gz doodle-$(VERSION) cd dist && zip -r doodle-$(VERSION).zip doodle-$(VERSION) diff --git a/README.md b/README.md index 2135e48..cb2903c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Doodle +# Project: Doodle (Working Title) -Doodle is a drawing-based maze game written in Go. +Project: Doodle is a drawing-based maze game written in Go. # Features @@ -20,6 +20,9 @@ Doodle is a drawing-based maze game written in Go. ## Mod-friendly +(Eventually) all these features will support custom content in the +game: + * Users can create **Custom Doodads** to extend the game with a scripting language like JavaScript. The sprites and animations are edited in-game in Edit Mode, but the scripting is done in your text editor. @@ -55,8 +58,51 @@ In Play Mode: ``` Cursor Keys Move the player around. +"E" Key + Edit the map you're currently playing if you came from Edit Mode. ``` +In Edit Mode: + +``` +Cursor Keys + Scroll the view of the map around. +"P" Key + Playtest the current map you're working on. +``` + +# Built-In Doodads + +A brief introduction to the built-in doodads available so far: + +- **Characters** + - Blue Azulian: this is used as the play character for now. If + dragged into a level, it doesn't do anything but is affected + by gravity. + - Red Azulian: an example mobile mob for now. It walks back and + forth, changing directions only when it comes across an + obstacle and can't proceed any further. +- **Doors and Keys** + - Colored Doors: these act like solid barriers until the player or + another doodad collects the matching colored key. + - Colored Keys: these are collectable items that allow the player or + another doodad to open the door of matching color. Note that + inventories are doodad-specific, so other mobs besides the + player can steal a key before the player gets it! (For now) + - Electric Door: this mechanical door stays closed and only + opens when it receives a power signal from a linked button. + - Trapdoor: this door allows one-way access, but once it's closed + behind you, you can't pass through it from that side! +- **Buttons** + - Button: while pressed by a player or other doodad, the button + emits a power signal to any doodad it is linked to. Link a button + to an electric door, and the door will open while the button is + pressed and close when the button is released. + - Sticky Button: this button will stay pressed once activated and + will not release unless it receives a power signal from another + linked doodad. For example, one Button that links to a Sticky + Button will release the sticky button if pressed. + ## Developer Console Press `Enter` at any time to open the developer console. @@ -65,7 +111,7 @@ Commands supported: ``` new - Create a new map in Edit Mode. + Show the "New Level" screen to start editing a new map. save [filename] Save the current map in Edit Mode. The filename is required if the map has @@ -88,111 +134,6 @@ quit Close the developer console. ``` -# Milestones - -As a rough idea of the milestones needed for this game to work: - -## SDL Paint Program - -* [x] Create a basic SDL window that you can click on to color pixels. - * [x] Connect the pixels while the mouse is down to cover gaps. -* [x] Implement a "screenshot" button that translates the canvas to a PNG - image on disk. - * `F12` key to take a screenshot of your drawing. - * It reproduces a PNG image using its in-memory knowledge of the pixels you - have drawn, *not* by reading the SDL canvas. This will be important for - making the custom level format later. - * The PNG I draw looks slightly different to what you see on the SDL canvas; - maybe difference between `Renderer.DrawLine()` and my own algorithm or - the anti-aliasing. -* [x] Create a custom map file format (protobufs maybe) and "screenshot" the - canvas into this custom file format. -* [x] Make the program able to read this file format and reproduce the same - pixels on the canvas. -* [x] Abstract away SDL logic into a small corner so it can be replaced with - OpenGL or something later on. -* [x] Implement a command line shell in-game to ease development before a user - interface is created. - * [x] Add support for the shell to pop itself open and ask the user for - input prompts. - -## Alpha Platformer - -* [x] Inflate the pixel history from the map file into a full lookup grid - of `(X,Y)` coordinates. This will be useful for collision detection. -* [x] Create a dummy player character sprite, probably just a - `render.Circle()`. In **Play Mode** run collision checks and gravity on - the player sprite. - * [x] Create the concept of the Doodad and make the player character - implement one. -* [x] Get basic movement and collision working. With a cleanup this can - make a workable **ALPHA RELEASE** - * [x] Ability to move laterally along the ground. - * [x] Ability to walk up reasonable size slopes but be stopped when - running against a steeper wall. - * [x] Basic gravity - -## UI Overhaul - -* [x] Create a user interface toolkit which will be TREMENDOUSLY helpful - for the rest of this program. - * [x] Labels - * [x] Buttons (text only is OK) - * [x] Buttons wrap their Label and dynamically compute their size based - on how wide the label will render, plus padding and border. - * [x] Border colors and widths and paddings are all configurable. - * [x] Buttons should interact with the cursor and be hoverable and - clickable. - * [x] UI Manager that will keep track of buttons to know when the mouse - is interacting with them. - * [x] Frames - * Like Buttons, can have border (raised, sunken or solid), padding and - background color. - * [x] Should be able to size themselves dynamically based on child widgets. - * [x] Windows (fixed, non-draggable is OK) - * [x] Title bar with label - * [x] Window body implements a Frame that contains child widgets. - * [x] Window can resize itself dynamically based on the Frame. -* [x] Create a "Main Menu" scene with buttons to enter a new Edit Mode, - play an existing map from disk, etc. -* [x] Add user interface Frames or Windows to the Edit Mode. - * [x] A toolbar of buttons (New, Save, Open, Play) can be drawn at the top - before the UI toolkit gains a proper MenuBar widget. - * [x] Expand the Palette support in levels for solid vs. transparent, fire, - etc. with UI toolbar to choose palettes. -* [x] Add a "Canvas" widget that will hold level drawing data and abstract it - out such that the Canvas can have a constrained width and height, position, - and "scrollable" viewport area that determines rendered pixels. Will be VERY - useful for Doodads and working on levels smaller than your window size (like - doodads). - -Lesser important UI features that can come at any later time: - -* [ ] MenuBar widget with drop-down menu support. -* [x] Checkbox and Radiobox widgets. -* [ ] Text Entry widgets (in the meantime use the Developer Shell to prompt for - text input questions) - -## Doodad Editor - -* [x] The Edit Mode should support creating drawings for Doodads. - * [x] It should know whether you're drawing a Map or a Doodad as some - behaviors may need to be different between the two. - * [ ] Compress the coordinates down toward `(0,0)` when saving a Doodad, - by finding the toppest, leftest point and making that `(0,0)` and adjusting - the rest accordingly. This will help trim down Doodads into the smallest - possible space for easy collision detection. - * [ ] Add a UX to edit multiple frames for a Doodad. - * [ ] Edit Mode should be able to fully save the drawings and frames, and an - external CLI tool can install the JavaScript into them. - * [ ] Possible UX to toggle Doodad options, like its collision rules and - whether the Doodad is continued to be "mobile" (i.e. doors and buttons won't - move, but items and enemies may be able to; and non-mobile Doodads don't - need to collision check against level geometry). -* [ ] Edit Mode should have a Doodad Palette (Frame or Window) to drag - Doodads into the map. -* [ ] ??? - # Building Fedora dependencies: @@ -201,19 +142,6 @@ Fedora dependencies: $ sudo dnf install SDL2-devel SDL2_ttf-devel ``` -## Fonts +# Author -The `fonts/` folder is git-ignored. The app currently uses font files here -named: - -* `DejaVuSans.ttf` for sans-serif font. -* `DejaVuSans-Bold.ttf` for bold sans-serif font. -* `DejaVuSansMono.ttf` for monospace font. - -These are the open source **DejaVu Sans [Mono]** fonts, so copy them in from -your `/usr/share/fonts/dejavu` folder or provide alternative fonts. - -```bash -mkdir fonts -cp /usr/share/fonts/dejavu/{DejaVuSans.ttf,DejaVuSans-Bold.ttf,DejaVuSansMono.ttf} fonts/ -``` +Copyright (C) 2019 Noah Petherbridge. All rights reserved. diff --git a/docs/Milestones.md b/docs/Milestones.md new file mode 100644 index 0000000..6f2c149 --- /dev/null +++ b/docs/Milestones.md @@ -0,0 +1,104 @@ +# Milestones + +As a rough idea of the milestones needed for this game to work: + +## SDL Paint Program + +* [x] Create a basic SDL window that you can click on to color pixels. + * [x] Connect the pixels while the mouse is down to cover gaps. +* [x] Implement a "screenshot" button that translates the canvas to a PNG + image on disk. + * `F12` key to take a screenshot of your drawing. + * It reproduces a PNG image using its in-memory knowledge of the pixels you + have drawn, *not* by reading the SDL canvas. This will be important for + making the custom level format later. + * The PNG I draw looks slightly different to what you see on the SDL canvas; + maybe difference between `Renderer.DrawLine()` and my own algorithm or + the anti-aliasing. +* [x] Create a custom map file format (protobufs maybe) and "screenshot" the + canvas into this custom file format. +* [x] Make the program able to read this file format and reproduce the same + pixels on the canvas. +* [x] Abstract away SDL logic into a small corner so it can be replaced with + OpenGL or something later on. +* [x] Implement a command line shell in-game to ease development before a user + interface is created. + * [x] Add support for the shell to pop itself open and ask the user for + input prompts. + +## Alpha Platformer + +* [x] Inflate the pixel history from the map file into a full lookup grid + of `(X,Y)` coordinates. This will be useful for collision detection. +* [x] Create a dummy player character sprite, probably just a + `render.Circle()`. In **Play Mode** run collision checks and gravity on + the player sprite. + * [x] Create the concept of the Doodad and make the player character + implement one. +* [x] Get basic movement and collision working. With a cleanup this can + make a workable **ALPHA RELEASE** + * [x] Ability to move laterally along the ground. + * [x] Ability to walk up reasonable size slopes but be stopped when + running against a steeper wall. + * [x] Basic gravity + +## UI Overhaul + +* [x] Create a user interface toolkit which will be TREMENDOUSLY helpful + for the rest of this program. + * [x] Labels + * [x] Buttons (text only is OK) + * [x] Buttons wrap their Label and dynamically compute their size based + on how wide the label will render, plus padding and border. + * [x] Border colors and widths and paddings are all configurable. + * [x] Buttons should interact with the cursor and be hoverable and + clickable. + * [x] UI Manager that will keep track of buttons to know when the mouse + is interacting with them. + * [x] Frames + * Like Buttons, can have border (raised, sunken or solid), padding and + background color. + * [x] Should be able to size themselves dynamically based on child widgets. + * [x] Windows (fixed, non-draggable is OK) + * [x] Title bar with label + * [x] Window body implements a Frame that contains child widgets. + * [x] Window can resize itself dynamically based on the Frame. +* [x] Create a "Main Menu" scene with buttons to enter a new Edit Mode, + play an existing map from disk, etc. +* [x] Add user interface Frames or Windows to the Edit Mode. + * [x] A toolbar of buttons (New, Save, Open, Play) can be drawn at the top + before the UI toolkit gains a proper MenuBar widget. + * [x] Expand the Palette support in levels for solid vs. transparent, fire, + etc. with UI toolbar to choose palettes. +* [x] Add a "Canvas" widget that will hold level drawing data and abstract it + out such that the Canvas can have a constrained width and height, position, + and "scrollable" viewport area that determines rendered pixels. Will be VERY + useful for Doodads and working on levels smaller than your window size (like + doodads). + +Lesser important UI features that can come at any later time: + +* [ ] MenuBar widget with drop-down menu support. +* [x] Checkbox and Radiobox widgets. +* [ ] Text Entry widgets (in the meantime use the Developer Shell to prompt for + text input questions) + +## Doodad Editor + +* [x] The Edit Mode should support creating drawings for Doodads. + * [x] It should know whether you're drawing a Map or a Doodad as some + behaviors may need to be different between the two. + * [ ] Compress the coordinates down toward `(0,0)` when saving a Doodad, + by finding the toppest, leftest point and making that `(0,0)` and adjusting + the rest accordingly. This will help trim down Doodads into the smallest + possible space for easy collision detection. + * [ ] Add a UX to edit multiple frames for a Doodad. + * [ ] Edit Mode should be able to fully save the drawings and frames, and an + external CLI tool can install the JavaScript into them. + * [ ] Possible UX to toggle Doodad options, like its collision rules and + whether the Doodad is continued to be "mobile" (i.e. doors and buttons won't + move, but items and enemies may be able to; and non-mobile Doodads don't + need to collision check against level geometry). +* [ ] Edit Mode should have a Doodad Palette (Frame or Window) to drag + Doodads into the map. +* [ ] ???