Doodle is the game engine for Sketchy Maze written in Go. https://www.sketchymaze.com/
 
 
 
 
 
 
Go to file
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
balance Basic Collision Detection, Toggle Between Play/Edit 2018-07-23 20:10:53 -07:00
cmd/doodle Abstract away all SDL logic into isolated package 2018-07-21 17:12:22 -07:00
doodads Make Collision Detection Flawless! 2018-07-24 22:26:27 -07:00
draw Basic Collision Detection, Toggle Between Play/Edit 2018-07-23 20:10:53 -07:00
events Implement Developer Console with Initial Commands 2018-07-21 20:43:01 -07:00
level Basic Collision Detection, Toggle Between Play/Edit 2018-07-23 20:10:53 -07:00
render Add initial User Interface Toolkit 2018-07-25 09:03:49 -07:00
types Save and restore maps as JSON files 2018-06-17 10:31:44 -07:00
ui Add initial User Interface Toolkit 2018-07-25 09:03:49 -07:00
.editorconfig Initial commit 2017-10-26 18:03:11 -07:00
.gitignore Save and restore maps as JSON files 2018-06-17 10:31:44 -07:00
Changes.md Milestone: Screenshot to PNG Test Feature 2018-06-17 07:56:51 -07:00
Ideas.md Refactor variable name for Scene implementors 2018-07-21 15:11:00 -07:00
Makefile Some initial pixel drawing with the mouse 2017-10-26 19:26:54 -07:00
README.md Add initial User Interface Toolkit 2018-07-25 09:03:49 -07:00
commands.go Make Collision Detection Flawless! 2018-07-24 22:26:27 -07:00
config.go Abstract away all SDL logic into isolated package 2018-07-21 17:12:22 -07:00
doodle.go Add initial User Interface Toolkit 2018-07-25 09:03:49 -07:00
editor_scene.go Add initial User Interface Toolkit 2018-07-25 09:03:49 -07:00
fps.go Better Collision Detection (Bouncy Jumps Up Hills) 2018-07-24 20:57:22 -07:00
log.go Stabilize frame rate, add debug overlay 2018-06-16 19:59:23 -07:00
play_scene.go Make Collision Detection Flawless! 2018-07-24 22:26:27 -07:00
scene.go Basic Collision Detection, Toggle Between Play/Edit 2018-07-23 20:10:53 -07:00
shell.go Make Collision Detection Flawless! 2018-07-24 22:26:27 -07:00

README.md

Doodle

Doodle is a drawing-based maze game written in Go.

Features

(Eventually), the high-level, user-facing features for the game are:

  • Draw your own levels freehand and then play them like a 2D platformer game.
  • In Adventure Mode you can play through a series of official example levels that ship with the game.
  • In Edit Mode you can draw a map freehand-style and lay down physical geometry, and mark which lines are solid or which ones behave like fire.
  • Drag and drop Doodads like buttons, doors and keys into your level and link them together so that buttons open doors and levers activate devices.
  • In Play Mode you can play your level as a 2D platformer game where you collect keys, watch out for enemies, and solve puzzles to get to the exit.
  • Easily Share your custom maps with friends.

Mod-friendly

  • 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.
  • In Edit Mode you can drag custom doodads into your maps.
  • To Share your maps, you can choose to bundle the custom doodads inside your map file itself, so that other players can play the map without needing to install the doodads separately.
  • If you receive a map with custom doodads, you can install the doodads into your copy of the game and use them in your own maps.

Keybindings

Global Keybindings:

Escape
  Close the developer console if open, without running any commands.
  Exit the program otherwise.

Enter
  Open and close the developer console, and run commands while the console
  is open.

In Play Mode:

Cursor Keys
  Move the player around.

In Edit Mode:

F12
  Take a screenshot (generate a PNG based on level data)

Developer Console

Press Enter at any time to open the developer console.

Commands supported:

new
  Create a new map in Edit Mode.

save [filename.json]
  Save the current map in Edit Mode. The filename is required if the map has
  not been saved yet.

edit [filename.json]
  Open a map in Edit Mode.

play [filename.json]
  Open a map in Play Mode.

echo <text>
  Flash a message to the console.

clear
  Clear the console output history.

exit
quit
  Close the developer console.

Milestones

As a rough idea of the milestones needed for this game to work:

SDL Paint Program

  • Create a basic SDL window that you can click on to color pixels.
    • Connect the pixels while the mouse is down to cover gaps.
  • 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.
  • Create a custom map file format (protobufs maybe) and "screenshot" the canvas into this custom file format.
  • Make the program able to read this file format and reproduce the same pixels on the canvas.
  • Abstract away SDL logic into a small corner so it can be replaced with OpenGL or something later on.
  • Implement a command line shell in-game to ease development before a user interface is created.
    • Add support for the shell to pop itself open and ask the user for input prompts.

Alpha Platformer

  • Inflate the pixel history from the map file into a full lookup grid of (X,Y) coordinates. This will be useful for collision detection.
  • Create a dummy player character sprite, probably just a render.Circle(). In Play Mode run collision checks and gravity on the player sprite.
    • Create the concept of the Doodad and make the player character implement one.
  • Get basic movement and collision working. With a cleanup this can make a workable ALPHA RELEASE
    • Ability to move laterally along the ground.
    • Ability to walk up reasonable size slopes but be stopped when running against a steeper wall.
    • Basic gravity

UI Overhaul

  • Create a user interface toolkit which will be TREMENDOUSLY helpful for the rest of this program.
    • Labels
    • Buttons (text only is OK)
      • Buttons wrap their Label and dynamically compute their size based on how wide the label will render, plus padding and border.
      • Border colors and widths and paddings are all configurable.
      • Buttons should interact with the cursor and be hoverable and clickable.
    • UI Manager that will keep track of buttons to know when the mouse is interacting with them.
    • Frames
    • Windows (fixed, non-draggable is OK)
  • Expand the Palette support in levels for solid vs. transparent, fire, etc. with UI toolbar to choose palettes.
  • ???

Building

Fedora dependencies:

$ sudo dnf install SDL2-devel SDL2_ttf-devel