Documentation ¶
Index ¶
- Constants
- Variables
- func GetMemUsage()
- type Command
- func (c Command) BoolProp(d *Doodle) error
- func (c Command) Close(d *Doodle) error
- func (c Command) Default(d *Doodle) error
- func (c Command) Edit(d *Doodle) error
- func (c Command) ExtractBindata(d *Doodle, path string) error
- func (c Command) Help(d *Doodle) error
- func (c Command) New(d *Doodle) error
- func (c Command) Play(d *Doodle) error
- func (c Command) Quit() error
- func (c Command) Run(d *Doodle) error
- func (c Command) RunScript(d *Doodle, code string) (goja.Value, error)
- func (c Command) Save(d *Doodle) error
- func (c Command) TitleScreen(d *Doodle) error
- type Doodle
- func (d *Doodle) ConfirmExit()
- func (d *Doodle) DrawCollisionBox(canvas *uix.Canvas, actor *uix.Actor)
- func (d *Doodle) DrawDebugOverlay()
- func (d *Doodle) EditDrawing(filename string) error
- func (d *Doodle) EditFile(filename string) error
- func (d *Doodle) FindLikelySupervisor() (*ui.Supervisor, error)
- func (d *Doodle) Flash(template string, v ...interface{})
- func (d *Doodle) FlashError(template string, v ...interface{})
- func (d *Doodle) Goto(scene Scene) error
- func (d *Doodle) GotoLoadMenu()
- func (d *Doodle) GotoNewDoodadMenu()
- func (d *Doodle) GotoNewMenu()
- func (d *Doodle) GotoPlayMenu()
- func (d *Doodle) GotoSettingsMenu()
- func (d *Doodle) MakeCheatsWindow(supervisor *ui.Supervisor) *ui.Window
- func (d *Doodle) MakeHelpMenu(menu *ui.MenuBar, supervisor *ui.Supervisor) *ui.MenuButton
- func (d *Doodle) MakeSettingsWindow(supervisor *ui.Supervisor) *ui.Window
- func (d *Doodle) NewDoodad(width, height int)
- func (d *Doodle) NewMap()
- func (d *Doodle) PlayFromLevelpack(pack *levelpack.LevelPack, which levelpack.Level) error
- func (d *Doodle) PlayLevel(filename string) error
- func (d *Doodle) Prompt(question string, callback func(string))
- func (d *Doodle) PromptPre(question string, prefilled string, callback func(string))
- func (d *Doodle) Run() error
- func (d *Doodle) SetPlayerCharacter(filename string)
- func (d *Doodle) SetWindowSize(width, height int)
- func (d *Doodle) SetupEngine() error
- func (d *Doodle) Title() string
- func (d *Doodle) TrackFPS(skipped uint32)
- type DraggableActor
- type EditorScene
- func (s *EditorScene) AutoSave() error
- func (s *EditorScene) ConfirmUnload(fn func())
- func (s *EditorScene) Destroy() error
- func (s *EditorScene) Draw(d *Doodle) error
- func (w *EditorScene) GetDrawing() *uix.Canvas
- func (s *EditorScene) LoadDoodad(filename string) error
- func (s *EditorScene) LoadLevel(filename string) error
- func (s *EditorScene) Loop(d *Doodle, ev *event.State) error
- func (s *EditorScene) MenuNewDoodad()
- func (s *EditorScene) MenuNewLevel()
- func (s *EditorScene) MenuOpen()
- func (s *EditorScene) MenuSave(as bool) func()
- func (s *EditorScene) Name() string
- func (s *EditorScene) Playtest()
- func (s *EditorScene) PlaytestFrom(p render.Point)
- func (s *EditorScene) Reset()
- func (s *EditorScene) SaveDoodad(filename string) error
- func (s *EditorScene) SaveLevel(filename string) error
- func (s *EditorScene) Setup(d *Doodle) error
- func (s *EditorScene) UpdateLevelScreenshot(lvl *level.Level) error
- type EditorUI
- func (u *EditorUI) ConfigureWindow(d *Doodle, window *ui.Window)
- func (u *EditorUI) ExpandCanvas(e render.Engine)
- func (u *EditorUI) FinishSetup(d *Doodle)
- func (u *EditorUI) Loop(ev *event.State) error
- func (u *EditorUI) OpenDoodadDropper()
- func (u *EditorUI) OpenFileSystemWindow()
- func (u *EditorUI) OpenLayersWindow()
- func (u *EditorUI) OpenPaletteWindow()
- func (u *EditorUI) OpenPublishWindow()
- func (u *EditorUI) OpenTextTool()
- func (u *EditorUI) Present(e render.Engine)
- func (u *EditorUI) Resized(d *Doodle)
- func (u *EditorUI) SetupCanvas(d *Doodle) *uix.Canvas
- func (u *EditorUI) SetupMenuBar(d *Doodle) *ui.MenuBar
- func (u *EditorUI) SetupPalette(d *Doodle) *ui.Window
- func (u *EditorUI) SetupPopups(d *Doodle)
- func (u *EditorUI) SetupStatusBar(d *Doodle) *ui.Frame
- func (u *EditorUI) SetupToolbar(d *Doodle) *ui.Frame
- func (u *EditorUI) SetupWorkspace(d *Doodle) *ui.Frame
- func (u *EditorUI) Teardown()
- type Flash
- type GUITestScene
- type MainScene
- func (s *MainScene) ButtonFrame() *ui.Frame
- func (s *MainScene) Destroy() error
- func (s *MainScene) Draw(d *Doodle) error
- func (s *MainScene) LabelHint() *ui.Label
- func (s *MainScene) LabelVersion() *ui.Label
- func (s *MainScene) Loop(d *Doodle, ev *event.State) error
- func (s *MainScene) LoopLazyScroll()
- func (s *MainScene) MakePhotogenic(v bool)
- func (s *MainScene) Name() string
- func (s *MainScene) Resized(width, height int)
- func (s *MainScene) Setup(d *Doodle) error
- func (s *MainScene) SetupDemoLevel(d *Doodle) error
- type MenuScene
- type PlayScene
- func (s *PlayScene) BeatLevel()
- func (s *PlayScene) Canvas() *uix.Canvas
- func (s *PlayScene) Destroy() error
- func (s *PlayScene) DieByFire(name string)
- func (s *PlayScene) Draw(d *Doodle) error
- func (s *PlayScene) DrawTouchable()
- func (s *PlayScene) Drawing() *uix.Canvas
- func (s *PlayScene) EditLevel()
- func (s *PlayScene) FailLevel(message string)
- func (s *PlayScene) GetCheated() bool
- func (s *PlayScene) GetPerfect() bool
- func (s *PlayScene) LoadLevel(filename string) error
- func (s *PlayScene) Loop(d *Doodle, ev *event.State) error
- func (s *PlayScene) LoopTouchable(ev *event.State)
- func (s *PlayScene) Name() string
- func (s *PlayScene) PlaceResizeCanvas()
- func (s *PlayScene) ResetTimer()
- func (s *PlayScene) RestartLevel()
- func (s *PlayScene) RetryCheckpoint()
- func (s *PlayScene) ScriptSupervisor() *scripting.Supervisor
- func (s *PlayScene) SetCheated()
- func (s *PlayScene) SetCheckpoint(where render.Point)
- func (s *PlayScene) SetImperfect()
- func (s *PlayScene) SetPlayerCharacter(filename string)
- func (s *PlayScene) Setup(d *Doodle) error
- func (s *PlayScene) ShowEndLevelModal(success bool, title, message string)
- type Scene
- type Shell
Constants ¶
const ( // Millisecond64 is a time.Millisecond casted to float64. Millisecond64 = float64(time.Millisecond) )
Variables ¶
var ( DebugOverlay = false DebugCollision = false DebugTextPadding = 8 DebugTextSize = 24 DebugTextColor = render.SkyBlue DebugTextStroke = render.Grey DebugTextShadow = render.Black )
Debug mode options, these can be enabled in the dev console like: boolProp DebugOverlay true
Functions ¶
Types ¶
type Command ¶
type Command struct { Raw string // The complete raw command the user typed. Command string // The first word of their command. Args []string // The shell-args array of parameters. ArgsLiteral string // The args portion of the command literally. }
Command is a parsed shell command.
func (Command) ExtractBindata ¶
ExtractBindata dumps the app's embedded bindata to the filesystem.
func (Command) TitleScreen ¶
TitleScreen loads the title with a custom user level.
type Doodle ¶
type Doodle struct { Debug bool Engine render.Engine Scene Scene // contains filtered or unexported fields }
Doodle is the game object.
func (*Doodle) ConfirmExit ¶
func (d *Doodle) ConfirmExit()
ConfirmExit may shut down Doodle gracefully after showing the user a confirmation modal.
func (*Doodle) DrawCollisionBox ¶
DrawCollisionBox draws the collision box around a Doodad.
The canvas will be the level Canvas, and the collision box is drawn in world space using the canvas.DrawStrokes function.
func (*Doodle) DrawDebugOverlay ¶
func (d *Doodle) DrawDebugOverlay()
DrawDebugOverlay draws the debug FPS text on the SDL canvas.
func (*Doodle) EditDrawing ¶
EditDrawing loads a drawing (Level or Doodad) in Edit Mode.
func (*Doodle) EditFile ¶
EditFile opens a drawing file (Level or Doodad) in the EditorScene.
The filename can be one of the following:
- A simple filename with no path separators in it and/or no file extension.
- An absolute path beginning with "/"
- A relative path beginning with "./"
If the filename has an extension (`.level` or `.doodad`), that will disambiguate how to find the file and which mode to start the EditorMode in. Otherwise, the "levels" folder is checked first and the "doodads" folder second.
func (*Doodle) FindLikelySupervisor ¶
func (d *Doodle) FindLikelySupervisor() (*ui.Supervisor, error)
FindLikelySupervisor will locate a most likely ui.Supervisor depending on the current Scene, if it understands the Scene and knows where it keeps its Supervisor.
func (*Doodle) FlashError ¶
FlashError flashes an error-colored message to the user.
func (*Doodle) GotoLoadMenu ¶
func (d *Doodle) GotoLoadMenu()
GotoLoadMenu loads the MenuScene and shows the "Load" window.
DEPRECATED: loads the old menu, in dev console run `$ d.GotoLoadMenu()` to see.
func (*Doodle) GotoNewDoodadMenu ¶
func (d *Doodle) GotoNewDoodadMenu()
GotoNewDoodadMenu loads the MenuScene and shows the "New" window, but selected on the Doodad tab by default.
func (*Doodle) GotoNewMenu ¶
func (d *Doodle) GotoNewMenu()
GotoNewMenu loads the MenuScene and shows the "New" window.
func (*Doodle) GotoPlayMenu ¶
func (d *Doodle) GotoPlayMenu()
GotoPlayMenu loads the MenuScene and shows the "Load" window for playing a level, not editing it.
DEPRECATED: loads the old menu, in dev console run `$ d.GotoPlayMenu()` to see.
func (*Doodle) GotoSettingsMenu ¶
func (d *Doodle) GotoSettingsMenu()
GotoSettingsMenu loads the settings screen.
func (*Doodle) MakeCheatsWindow ¶
func (d *Doodle) MakeCheatsWindow(supervisor *ui.Supervisor) *ui.Window
MakeCheatsWindow initializes the windows/cheats_menu.go window from anywhere you need it, binding all the variables in. If you pass a nil Supervisor, this function will attempt to find one based on your Scene and
func (*Doodle) MakeHelpMenu ¶
func (d *Doodle) MakeHelpMenu(menu *ui.MenuBar, supervisor *ui.Supervisor) *ui.MenuButton
MakeHelpMenu creates the "Help" menu with its common items across any scene.
func (*Doodle) MakeSettingsWindow ¶
func (d *Doodle) MakeSettingsWindow(supervisor *ui.Supervisor) *ui.Window
MakeSettingsWindow initializes the windows/settings.go window from anywhere you need it, binding all the variables in.
func (*Doodle) NewDoodad ¶
NewDoodad loads a new Doodad in Edit Mode. If size is zero, it prompts the user to select a size or accept the default size.
func (*Doodle) PlayFromLevelpack ¶
PlayFromLevelpack initializes the Play Scene from a level as part of a levelpack.
func (*Doodle) SetPlayerCharacter ¶
SetPlayerCharacter -- this is designed to be called in-game with the developer console. Sets your player character to whatever doodad you want, not just the few that have cheat codes. If you set an invalid filename, you become the dummy default doodad sprite (a red "X").
func (*Doodle) SetWindowSize ¶
SetWindowSize sets the size of the Doodle window.
func (*Doodle) SetupEngine ¶
SetupEngine sets up the rendering engine.
type DraggableActor ¶
type DraggableActor struct {
// contains filtered or unexported fields
}
DraggableActor is a Doodad being dragged from the Doodad palette.
func (*DraggableActor) Teardown ¶
func (da *DraggableActor) Teardown()
Teardown the DraggableActor and free its textures.
type EditorScene ¶
type EditorScene struct { // Configuration for the scene initializer. DrawingType enum.DrawingType OpenFile bool Filename string DoodadSize render.Rect RememberScrollPosition render.Point // Play mode remembers it for us UI *EditorUI // The current level or doodad object being edited, based on the // DrawingType. Level *level.Level Doodad *doodads.Doodad ActiveLayer int // which layer (of a doodad) is being edited now? // contains filtered or unexported fields }
EditorScene manages the "Edit Level" game mode.
func (*EditorScene) AutoSave ¶
func (s *EditorScene) AutoSave() error
AutoSave takes an autosave snapshot of the level or drawing.
func (*EditorScene) ConfirmUnload ¶
func (s *EditorScene) ConfirmUnload(fn func())
ConfirmUnload may pop up a confirmation modal to save the level before the user performs an action that may close the level, such as click File->New.
func (*EditorScene) GetDrawing ¶
func (w *EditorScene) GetDrawing() *uix.Canvas
GetDrawing returns the uix.Canvas
func (*EditorScene) LoadDoodad ¶
func (s *EditorScene) LoadDoodad(filename string) error
LoadDoodad loads a doodad from disk.
func (*EditorScene) LoadLevel ¶
func (s *EditorScene) LoadLevel(filename string) error
LoadLevel loads a level from disk.
func (*EditorScene) Loop ¶
func (s *EditorScene) Loop(d *Doodle, ev *event.State) error
Loop the editor scene.
func (*EditorScene) MenuNewDoodad ¶
func (s *EditorScene) MenuNewDoodad()
func (*EditorScene) MenuSave ¶
func (s *EditorScene) MenuSave(as bool) func()
File->Save, or Ctrl-S File->Save As, or Shift-Ctrl-S NOTICE: this one returns a func() so you need to call that one!
func (*EditorScene) Playtest ¶
func (s *EditorScene) Playtest()
Playtest switches the level into Play Mode.
func (*EditorScene) PlaytestFrom ¶
func (s *EditorScene) PlaytestFrom(p render.Point)
PlaytestFrom enters play mode starting at a custom spawn point.
func (*EditorScene) Reset ¶
func (s *EditorScene) Reset()
Reset the editor scene from scratch. Good nuclear option when you change the level's palette on-the-fly or some other sticky situation and want to reload the editor.
func (*EditorScene) SaveDoodad ¶
func (s *EditorScene) SaveDoodad(filename string) error
SaveDoodad saves the doodad to disk.
func (*EditorScene) SaveLevel ¶
func (s *EditorScene) SaveLevel(filename string) error
SaveLevel saves the level to disk.
func (*EditorScene) UpdateLevelScreenshot ¶
func (s *EditorScene) UpdateLevelScreenshot(lvl *level.Level) error
UpdateLevelScreenshot updates a level screenshot in its zipfile.
type EditorUI ¶
type EditorUI struct { Scene *EditorScene // Variables StatusBoxes []*string StatusMouseText string StatusPaletteText string StatusFilenameText string StatusScrollText string Supervisor *ui.Supervisor Canvas *uix.Canvas Workspace *ui.Frame MenuBar *ui.MenuBar StatusBar *ui.Frame ToolBar *ui.Frame PlayButton *ui.Button // Palette window. Palette *ui.Window PaletteTab *ui.Frame DoodadTab *ui.Frame // Draggable Doodad canvas. DraggableActor *DraggableActor // contains filtered or unexported fields }
EditorUI manages the user interface for the Editor Scene.
func NewEditorUI ¶
func NewEditorUI(d *Doodle, s *EditorScene) *EditorUI
NewEditorUI initializes the Editor UI.
func (*EditorUI) ConfigureWindow ¶
ConfigureWindow sets default window config functions, like centering them on screen.
func (*EditorUI) ExpandCanvas ¶
ExpandCanvas manually expands the Canvas to fill the frame, to work around UI packing bugs. Ideally I would use `Expand: true` when packing the Canvas in its frame, but that would artificially expand the Canvas also when it _wanted_ to be smaller, as in Doodad Editing Mode.
func (*EditorUI) FinishSetup ¶
FinishSetup runs the Setup tasks that must be postponed til the end, such as rendering the Palette window so that it can accurately show the palette loaded from a level.
func (*EditorUI) OpenDoodadDropper ¶
func (u *EditorUI) OpenDoodadDropper()
OpenDoodadDropper opens the Doodad Dropper window.
func (*EditorUI) OpenFileSystemWindow ¶
func (u *EditorUI) OpenFileSystemWindow()
OpenPublishWindow opens the FileSystem window.
func (*EditorUI) OpenLayersWindow ¶
func (u *EditorUI) OpenLayersWindow()
Opens the "Layers" window (for editing doodads)
func (*EditorUI) OpenPaletteWindow ¶
func (u *EditorUI) OpenPaletteWindow()
OpenPaletteWindow opens the Palette Editor window.
func (*EditorUI) OpenPublishWindow ¶
func (u *EditorUI) OpenPublishWindow()
OpenPublishWindow opens the Publisher window.
func (*EditorUI) OpenTextTool ¶
func (u *EditorUI) OpenTextTool()
OpenTextTool opens the Text Tool window.
func (*EditorUI) Resized ¶
Resized handles the window being resized so we can recompute the widgets.
func (*EditorUI) SetupCanvas ¶
SetupCanvas configures the main drawing canvas in the editor.
func (*EditorUI) SetupMenuBar ¶
SetupMenuBar sets up the menu bar.
func (*EditorUI) SetupPalette ¶
SetupPalette sets up the palette panel.
func (*EditorUI) SetupPopups ¶
SetupPopups preloads popup windows like the DoodadDropper.
func (*EditorUI) SetupStatusBar ¶
SetupStatusBar sets up the status bar widget along the bottom of the window.
func (*EditorUI) SetupToolbar ¶
SetupToolbar configures the UI for the Tools panel.
func (*EditorUI) SetupWorkspace ¶
SetupWorkspace configures the main Workspace frame that takes up the full window apart from toolbars. The Workspace has a single child element, the Canvas, so it can easily full-screen it or center it for Doodad editing.
type GUITestScene ¶
type GUITestScene struct { Supervisor *ui.Supervisor // Private widgets. Frame *ui.Frame Window *ui.Frame // contains filtered or unexported fields }
GUITestScene implements the main menu of Doodle.
func (*GUITestScene) Draw ¶
func (s *GUITestScene) Draw(d *Doodle) error
Draw the pixels on this frame.
type MainScene ¶
type MainScene struct { Supervisor *ui.Supervisor LevelFilename string // custom level filename to load in background // Lazy scroll variables. See LoopLazyScroll(). PauseLazyScroll bool // exported for dev console // contains filtered or unexported fields }
MainScene implements the main menu of Doodle.
func (*MainScene) ButtonFrame ¶
ButtonFrame returns the main button frame.
func (*MainScene) LabelVersion ¶
LabelVersion returns the version widget.
func (*MainScene) LoopLazyScroll ¶
func (s *MainScene) LoopLazyScroll()
LoopLazyScroll gently scrolls the title screen demo level, called each Loop.
func (*MainScene) MakePhotogenic ¶
MakePhotogenic tweaks some variables to make a screenshotable title screen.
This function is designed to be called from the developer shell:
$ d.Scene.MakePhotogenic(true)
It automates the pausing of lazy scroll and hiding of UI elements except for just the title and version number.
func (*MainScene) SetupDemoLevel ¶
SetupDemoLevel configures the wallpaper behind the New screen, which demos a title screen demo level.
type MenuScene ¶
type MenuScene struct { // Configuration. StartupMenu string NewDoodad bool Supervisor *ui.Supervisor // contains filtered or unexported fields }
MenuScene holds the main dialog menu UIs for:
* New Level * Open Level * Settings
DEPRECATED: migrate these prompts into popup windows to appear on the MainScene or elsewhere as wanted.
func (*MenuScene) DebugGetWindow ¶
DebugGetWindow surfaces the underlying private window.
type PlayScene ¶
type PlayScene struct { // Configuration attributes. Filename string Level *level.Level CanEdit bool // i.e. you came from the Editor Mode HasNext bool // has a next level to load next RememberScrollPosition render.Point // for the Editor quality of life SpawnPoint render.Point // if not zero, overrides Start Flag // If this level was part of a levelpack. The Play Scene will read it // from the levelpack ZIP file in priority over any other location. LevelPack *levelpack.LevelPack // UI widgets. Supervisor *ui.Supervisor // Player character Player *uix.Actor // contains filtered or unexported fields }
PlayScene manages the "Edit Level" game mode.
func (*PlayScene) BeatLevel ¶
func (s *PlayScene) BeatLevel()
BeatLevel handles the level success condition.
func (*PlayScene) Canvas ¶
Canvas returns the main level canvas - useful to call from the debug console as `d.Scene.Canvas()`
func (*PlayScene) DrawTouchable ¶
func (s *PlayScene) DrawTouchable()
DrawTouchable draws any UI elements if needed for the touch UI.
func (*PlayScene) Drawing ¶
Drawing returns the private world drawing, for debugging with the console.
func (*PlayScene) EditLevel ¶
func (s *PlayScene) EditLevel()
EditLevel toggles out of Play Mode to edit the level.
func (*PlayScene) FailLevel ¶
FailLevel handles a level failure triggered by a doodad or fire pixel.
If the Survival GameRule is set, this ends the level with a note on how long the player had survived for and they get a silver rating.
func (*PlayScene) GetCheated ¶
GetCheated gives read-only access to tell if you have been cheating. However, by querying this in the dev console during gameplay, you would be marked as cheating. ;)
func (*PlayScene) GetPerfect ¶
GetPerfect gives read-only access to the perfectRun flag.
func (*PlayScene) LoadLevel ¶
LoadLevel loads a level from disk.
If the PlayScene was called with a LevelPack, it will check there first before the usual locations.
The usual locations are: embedded bindata, ./assets folder on disk, and user content finally.
func (*PlayScene) LoopTouchable ¶
LoopTouchable is called as part of PlayScene.Loop while the simulation is running.
It looks for touch events on proportional regions of the window and emulates key input bindings to move the character, jump, etc.
TODO: this function manipulates the event.State to set Up, Down, Left, Right and Space keys and may need love for reconfigurable keybinds later.
func (*PlayScene) PlaceResizeCanvas ¶
func (s *PlayScene) PlaceResizeCanvas()
PlaceResizeCanvas updates the Canvas size and placement on the screen, e.g. if an ultra HD monitor plays a Bounded level where the entirety of a level bounds is on-screen, the drawing should be cut there and the canvas centered.
func (*PlayScene) ResetTimer ¶
func (s *PlayScene) ResetTimer()
ResetTimer sets the level elapsed timer back to zero.
func (*PlayScene) RestartLevel ¶
func (s *PlayScene) RestartLevel()
RestartLevel starts the level over again.
func (*PlayScene) RetryCheckpoint ¶
func (s *PlayScene) RetryCheckpoint()
RetryCheckpoint moves the player back to their last checkpoint.
func (*PlayScene) ScriptSupervisor ¶
func (s *PlayScene) ScriptSupervisor() *scripting.Supervisor
ScriptSupervisor returns the scripting supervisor for play mode.
func (*PlayScene) SetCheated ¶
func (s *PlayScene) SetCheated()
SetCheated marks the level as having been cheated. The developer shell will call this if the user enters a cheat code during gameplay.
func (*PlayScene) SetCheckpoint ¶
SetCheckpoint sets the player's checkpoint.
func (*PlayScene) SetImperfect ¶
func (s *PlayScene) SetImperfect()
SetImperfect sets the perfectRun flag to false and changes the icon for the timer.
func (*PlayScene) SetPlayerCharacter ¶
SetPlayerCharacter changes the doodad used for the player, by destroying the current player character and making it from scratch.
func (*PlayScene) ShowEndLevelModal ¶
ShowEndLevelModal centralizes the EndLevel modal config. This is the common handler function between easy methods such as BeatLevel, FailLevel, and DieByFire.
type Scene ¶
type Scene interface { Name() string Setup(*Doodle) error Destroy() error // Loop should update the scene's state but not draw anything. Loop(*Doodle, *event.State) error // Draw should use the scene's state to figure out what pixels need // to draw to the screen. Draw(*Doodle) error }
Scene is an abstraction for a game mode in Doodle. The app points to one scene at a time and that scene has control over the main loop, and its own state information.
type Shell ¶
type Shell struct { Open bool Prompt string Repl bool Text string History []string Output []string Flashes []Flash // contains filtered or unexported fields }
Shell implements the developer console in-game.
Source Files ¶
- cheats.go
- commands.go
- common_menubar.go
- config.go
- doodle.go
- editor_scene.go
- editor_scene_debug.go
- editor_ui.go
- editor_ui_doodad.go
- editor_ui_menubar.go
- editor_ui_palette.go
- editor_ui_popups.go
- editor_ui_toolbar.go
- fps.go
- guitest_scene.go
- main_scene.go
- menu_scene.go
- play_inventory.go
- play_scene.go
- play_scene_menubar.go
- play_scene_touch.go
- player_physics.go
- scene.go
- shell.go
Directories ¶
Path | Synopsis |
---|---|
builds
Package builds handles build-specific branding strings.
|
Package builds handles build-specific branding strings. |
Package campaign contains types and functions for the single player campaigns.
|
Package campaign contains types and functions for the single player campaigns. |
Package chatbot provides the RiveScript bot that lives in the developer shell.
|
Package chatbot provides the RiveScript bot that lives in the developer shell. |
Package cursor handles custom mouse cursor sprite images.
|
Package cursor handles custom mouse cursor sprite images. |
dummy
Package dummy implements a dummy doodads.Drawing.
|
Package dummy implements a dummy doodads.Drawing. |
Package enum defines all the little enum types used throughout Doodle.
|
Package enum defines all the little enum types used throughout Doodle. |
Package gamepad provides game controller logic for the game.
|
Package gamepad provides game controller logic for the game. |
Package keybind centralizes the global hotkey bindings.
|
Package keybind centralizes the global hotkey bindings. |
publishing
Package publishing contains functionality for "publishing" a Level, which involves the writing and reading of custom doodads embedded inside the levels.
|
Package publishing contains functionality for "publishing" a Level, which involves the writing and reading of custom doodads embedded inside the levels. |
rle
Package rle contains support for Run-Length Encoding of level chunks.
|
Package rle contains support for Run-Length Encoding of level chunks. |
Package levelpack handles ZIP archives for level packs.
|
Package levelpack handles ZIP archives for level packs. |
Package modal provides UI pop-up modals for Doodle.
|
Package modal provides UI pop-up modals for Doodle. |
loadscreen
Package loadscreen implements a modal "Loading" screen for the game, which can be shown or hidden by gameplay scenes as needed.
|
Package loadscreen implements a modal "Loading" screen for the game, which can be shown or hidden by gameplay scenes as needed. |
Package native provides native system functions for Linux, MacOS and Windows to perform operating system-specific tasks such as open web links or native dialog boxes.
|
Package native provides native system functions for Linux, MacOS and Windows to perform operating system-specific tasks such as open web links or native dialog boxes. |
Package pattern applies a kind of brush texture to a palette swatch.
|
Package pattern applies a kind of brush texture to a palette swatch. |
Package plus connects the open source Doodle engine to the Doodle++ feature.
|
Package plus connects the open source Doodle engine to the Doodle++ feature. |
bootstrap
Package bootstrap is a common import between the Doodle and Doodad programs.
|
Package bootstrap is a common import between the Doodle and Doodad programs. |
Package scripting manages the JavaScript VMs for Doodad scripts.
|
Package scripting manages the JavaScript VMs for Doodad scripts. |
exceptions
Package exceptions handles JavaScript errors nicely for the game.
|
Package exceptions handles JavaScript errors nicely for the game. |
Package sound manages music and sound effects.
|
Package sound manages music and sound effects. |
Package sprites manages miscellaneous in-game sprites.
|
Package sprites manages miscellaneous in-game sprites. |
magic-form
Package magicform helps create simple form layouts with go/ui.
|
Package magicform helps create simple form layouts with go/ui. |
Package updater checks for updates to Doodle.
|
Package updater checks for updates to Doodle. |
Package usercfg has functions around the user's Game Settings.
|
Package usercfg has functions around the user's Game Settings. |