86 |
87 | {% if site.google_analytics %}
88 |
96 | {% endif %}
97 |
98 |
99 |
--------------------------------------------------------------------------------
/docs/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/android-chrome-192x192.png
--------------------------------------------------------------------------------
/docs/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/android-chrome-512x512.png
--------------------------------------------------------------------------------
/docs/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/apple-touch-icon.png
--------------------------------------------------------------------------------
/docs/assets/card.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/card.png
--------------------------------------------------------------------------------
/docs/assets/discord.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/assets/favicon/android-chrome-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/favicon/android-chrome-192x192.png
--------------------------------------------------------------------------------
/docs/assets/favicon/android-chrome-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/favicon/android-chrome-512x512.png
--------------------------------------------------------------------------------
/docs/assets/favicon/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/favicon/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/assets/favicon/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/favicon/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/assets/favicon/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/favicon/favicon.ico
--------------------------------------------------------------------------------
/docs/assets/itch.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs/assets/logo200.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/logo200.png
--------------------------------------------------------------------------------
/docs/assets/logo400.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/logo400.png
--------------------------------------------------------------------------------
/docs/assets/mastodon.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
--------------------------------------------------------------------------------
/docs/assets/shmup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/shmup.png
--------------------------------------------------------------------------------
/docs/assets/twitter.svg:
--------------------------------------------------------------------------------
1 |
2 |
3 |
23 |
--------------------------------------------------------------------------------
/docs/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #8d3cff
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/docs/faq.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | Frequently Asked Questions
4 | =================
5 |
6 | ## Why Wren?
7 |
8 | Wren is a great language for making games in:
9 | * Wren has a simple syntax, and a small core API, so it's easy to learn and work with.
10 | * Dynamic typing, which makes writing code easy, for fast prototyping.
11 | * The language runtime is designed to be fast, which is perfect for games.
12 | * Wren supports functional and object-oriented programming paradigms, making it possible to express your ideas clearly.
13 | * Finally, it's fun!
14 |
15 | ## What makes DOME comfortable?
16 | DOME has been designed to provide simple APIs for making games, so that you feel comfortable, whatever you're making.
17 | It aims to rely on as few dependencies as possible, easy to build on most platforms and games made with DOME should be easy to share!
18 |
19 | ## Have any games been made with DOME?
20 |
21 | Sort of! Take a look:
22 | * There's an [example game](https://github.com/domeengine/dome/tree/main/examples/spaceshooter) in the GitHub repository, which shows off a number of features. It's based on [this tutorial](https://ztiromoritz.github.io/pico-8-shooter/) for the PICO-8.
23 | * Check out [this repository](https://github.com/domeengine/dome-examples) for example games taken from "Code the Classics", but ported from Python and pygame to Wren and DOME.
24 | * A entry to "A Game By It's Cover 2018": [Grid](https://avivbeeri.itch.io/grid) - [Source](https://github.com/avivbeeri/grid)
25 | * [Station Salvage](https://avivbeeri.itch.io/station-salvage), a fine 7DRL 2020 entry.
26 | * [CyberRunner](https://github.com/Sandvich/CyberRunner), an experimental endless runner (WIP)
27 | * A entry to "A Game By It's Cover 2020": [ALLNIGHTER](https://avivbeeri.itch.io/allnighter) - Parts of ALLNIGHTER's development were live streamed, with recordings available [here](https://www.youtube.com/channel/UCAk93TqgFFQLabjRsxp6bSA).
28 | * [Pop-Up!](https://github.com/whmsft/popup) by whmsft, a little reaction game.
29 |
--------------------------------------------------------------------------------
/docs/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/favicon-16x16.png
--------------------------------------------------------------------------------
/docs/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/favicon-32x32.png
--------------------------------------------------------------------------------
/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/favicon.ico
--------------------------------------------------------------------------------
/docs/getting-started.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | Getting Started
4 | =================
5 |
6 | To get started, make sure you've acquired DOME using the [installation](installation) instructions.
7 |
8 | Place the `dome` executable to a directory which will serve as your workspace.
9 |
10 | Next, create a new file in your workspace directory named `main.wren`. DOME looks by default for a `main.wren` or `game.egg` file (see [Distributing your Game](guides/distribution)) as the entry point to your game.
11 |
12 | Open `main.wren` in your favourite text editor and enter the following:
13 |
14 | ```
15 | class Main {
16 | construct new() {}
17 | init() {}
18 | update() {}
19 | draw(alpha) {}
20 | }
21 |
22 | var Game = Main.new()
23 | ```
24 |
25 | Save the file and navigate to your workspace in the terminal. Run `./dome` and you should see a black box appear.
26 | Now you're ready to make your first game!
27 |
28 |
--------------------------------------------------------------------------------
/docs/googleb221921b4b2ce5ee.html:
--------------------------------------------------------------------------------
1 | google-site-verification: googleb221921b4b2ce5ee.html
--------------------------------------------------------------------------------
/docs/guides/audio.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | How to play sounds?
4 | ==========================
5 |
6 | DOME supports playback of audio files in OGG, MP3, FLAC and WAV formats. It will convert
7 | all files to its native sample rate of 44.1kHz (CD quality audio), but the
8 | re-sampling algorithm used is naive and may introduce audio artifacts. It is
9 | recommended that you produce your audio with a 44.1kHz sample-rate, for the
10 | best quality audio.
11 |
12 | You can access most of DOME's audio functions through the
13 | [`AudioEngine`](/modules/audio#audioengine) class in the
14 | [`audio`](/modules/audio) module.
15 |
16 | ## Loading
17 |
18 | Before you can play a file, you need to load it into the AudioEngine. Files are
19 | loaded and assigned a label, for future playback. After that, the audio is playable.
20 |
21 | ```
22 | import "audio" for AudioEngine
23 | AudioEngine.load("cool-sounds", "path/to/file")
24 | ```
25 |
26 | Now, you can use the AudioEngine to play the `"cool-sounds"` audio asset.
27 |
28 | ## Playing
29 |
30 |
31 | When an audio file is played, it plays in its own "channel". All the channels
32 | are stereo, and mixed together by DOME based on volume and pan settings.
33 | A channel can also be stopped early. Channels can repeat, but once stopped,
34 | they are no longer usable. You need to play the sound again to create a new
35 | channel.
36 |
37 | Here is a simple example of playing a sound, and configuring the volume and pan settings:
38 | ```
39 | import "audio" for AudioEngine
40 |
41 | AudioEngine.load("cool-sounds", "path/to/file")
42 | var channel = AudioEngine.play("cool-sounds")
43 | channel.volume = 0.5 // Play at half volume
44 | channel.pan = 0.3 // Position towards the right
45 | ```
46 |
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/docs/guides/draw.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | How to draw to the screen?
4 | ==========================
5 |
6 | An important part of most applications is the ability to draw on screen.
7 | DOME lets you draw primitive shapes (lines, rectangles, circles and ovals) as
8 | well as sprites loaded from image files.
9 |
10 | Make sure to draw in DOME during the `draw()` portion of DOME's game-loop.
11 | The reason for this is discussed further in the [Game Loop guide](/guides/game-loop).
12 |
13 | You can access most of the graphical functions through the [`Canvas`](/modules/graphics#canvas) class
14 | in the [`graphics`](/modules/graphics) module.
15 |
16 | ## Primitives
17 |
18 | The `Canvas` class contains functions for drawing the different shapes. There's an outline and "filled" version:
19 |
20 | * `Canvas.line` - Draw a line between two points. There's an optional thickness option.
21 | * `Canvas.rect`, `Canvas.rectfill` - Draw a rectangle. You need to give it a top-left corner point, and a size.
22 | * `Canvas.circle`, `Canvas.circlefill` - Draw a circle. Provide it a center and a radius.
23 | * `Canvas.ellipse`, `Canvas.ellipsefill` - Draw an ellipse. It requires a top-left and bottom-right corner, and draws between the two.
24 |
25 | These also require a [`Color`](/modules/graphics#color) value. There's a collection of default colors built into DOME, but you can also specify
26 | custom colors using `Color.rgb`, `Color.hex` and `Color.hsv`.
27 |
28 | ## Text
29 |
30 | Most applications will require some kind of text to be displayed on screen to convey things
31 | to the user. DOME comes with a built-in pixel font (8x8 pixels), as well as support for TTF-based fonts.
32 |
33 | In order to print text on screen, you can use `Canvas.print(text, x, y, color)`. This uses the built-in font by
34 | default, but you can change this.
35 |
36 | Here's how you use a font:
37 |
38 | ```javascript
39 | import "graphics" for Font, Color
40 |
41 | // Default font
42 | Canvas.print("Defaults Words", 0, 0, Color.green)
43 |
44 | var fontPointSize = 16
45 | var myFont = Font.load("uniqueName", "path/to/file.format", fontPointSize)
46 |
47 | // You can print in two ways. Canvas:
48 | Canvas.print("Words", 0, 8, Color.green, "uniqueName")
49 | // or the Font class:
50 | Font["uniqueName"].print("Words", 0, 8, Color.green)
51 | ```
52 |
53 | DOME also lets you change the default font used for `Canvas.print`, by setting `Canvas.font` to the font's unique name.
54 |
55 | ```javascript
56 | import "graphics" for Font, Color
57 |
58 | var fontPointSize = 16
59 | var myFont = Font.load("uniqueName", "path/to/file.format", fontPointSize)
60 |
61 | Canvas.font = "uniqueName"
62 | // Print using the font
63 | Canvas.print("Words", 0, 8, Color.green)
64 |
65 | Canvas.font = Font.default
66 | Canvas.print("Default words", 0, 0, Color.green)
67 | ```
68 |
69 | Look at the [`Font`](/modules/graphics#font) class for more information.
70 |
71 | ## Images
72 |
73 | You'll need the `ImageData` class from the `graphics` module for these.
74 |
75 | DOME supports the following image formats:
76 |
77 | * JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
78 | * PNG 1/2/4/8/16-bit-per-channel
79 | * BMP non-1bpp, non-RLE
80 |
81 | Here's an example, loading an image and drawing it to the Canvas:
82 |
83 | ```javascript
84 | var image = ImageData.load("path/to/file.format")
85 | image.draw(6, 7)
86 | ```
87 |
88 | DOME also supports scaling and rotation, as well as drawing sub-regions, and that can be achieved using
89 | the [`ImageData.transform`](/modules/graphics#transformparametermap-drawable) method.
90 |
91 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/docs/guides/game-loop.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | Game-Loop Behaviour
4 | ===================
5 |
6 | DOME handles the logistics of operating a game loop, so you only have to worry about what happens during your update loop.
7 |
8 | The game loop is broken into three stages:
9 | * Input and Asynchronous Event Handling
10 | * Update
11 | * Draw
12 |
13 | The default game-loop can be described as having a "fixed timestep with variable rendering".
14 |
15 | This means that the the Update Phase runs with a fixed granularity of 16.6ms but the Input and Draw phases are processed at every opportunity.
16 | Therefore, you can rely on your game having deterministic behaviour as every update is the same time-slice, and DOME should gracefully handle a variety of machines of differing power. If the draw and input phases take too long, DOME may run your update code multiple times to "catch up".
17 | In addition, DOME can ask your game to render at arbitrary times between ticks. It provides your `Game` with a `draw(alpha)` call, where `alpha` is a value between 0.0 and 1.0, a percentage of how far between the last tick and the next you are executing. You can use this to extrapolate the game state from the previous tick to "now".
18 |
19 | DOME also starts with VSync enabled by default, so it will wait under the VBlank before executing the next frame's game loop.
20 |
21 | ## Options
22 |
23 | There is no way for DOME to detect if it is running on a system which supports VSync, so you can disable it programmatically using the `Window.vsync` setting in the [dome](/modules/dome) module.
24 |
25 | It's possible that you spot a single-frame stutter while the game is running at a high framerate. This is due to slight errors in frame time counting, and so DOME catches up unnecessarily. You can disable the catchup behaviour using `Window.lockstep = true`.
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/docs/guides/index.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | Guides
4 | ============
5 |
6 | DOME has a lot of features, so we've put together some guides to help you get started.
7 |
8 | Basic Guides:
9 | * [How to configure DOME](use-dome)
10 | * [How to draw to the screen?](draw)
11 | * [How to play sounds?](audio)
12 | * [How to handle input?](input)
13 |
14 | Advanced Guides:
15 | * [Import Resolution](module-imports)
16 | * [Game Loop Behaviour](game-loop)
17 | * [Distributing your game](distribution)
18 |
19 |
--------------------------------------------------------------------------------
/docs/guides/input.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | How to read input?
4 | ==========================
5 |
6 | DOME allows your projects to handle input from Keyboard, Mouse and SDL2-supported GamePads.
7 | You can check on the state of a particular input during each update tick of the game loop, and
8 | respond accordingly.
9 |
10 | To get started, import the [`input`](/modules/input) module.
11 |
12 | ## Mouse and Keyboard
13 |
14 | Mouse and Keyboard are read in similar ways. There's a static [`Mouse`](/modules/inpuP#mouse) and [`Keyboard`](/modules/input#keyboard) class, which
15 | can be used to get the state of particular buttons.
16 |
17 | For example:
18 |
19 | ```
20 | import "input" for Mouse, Keyboard
21 |
22 | if (Mouse["left"].down) {
23 | // do something
24 | }
25 | if (Keyboard["a"].down) {
26 | // do something else
27 | }
28 | ```
29 |
30 | More information about button state can be found in the [`DigitalInput`](/modules/input#digitalinput) documentation.
31 |
32 | ### Mouse Position
33 |
34 | You can also get the position of the Mouse using the `x`, `y`, and `position` fields of the `Mouse` class.
35 | ```
36 | import "input" for Mouse
37 |
38 | var pos = Mouse.position
39 | var x = Mouse.x
40 | var y = Mouse.y
41 | System.print(pos)
42 | System.print("%(x), %(y)")
43 | ```
44 |
45 |
46 | ## GamePads
47 |
48 | DOME assumes that a computer only has one mouse and keyboard attached to the system, but
49 | it allows for any number of game pads to be connected. Unfortunately, this means that you need to
50 | handle multiple game pads, and detect which is the one to receive input from.
51 |
52 | You can get a list of all active game pads using `GamePad.all`, and then loop through them to
53 | pick the right one for your needs. (You could test if a specific button is pressed, for example.)
54 |
55 | If you don't care too much about which GamePad is used, `GamePad.next` will return a single gamepad which is attached to the system. You should cache the result.
56 |
57 | Now that you've acquired a specific [`GamePad`](/modules/input#gamepad), you can retrieve input from it.
58 |
59 | ### Buttons
60 |
61 | GamePads usually support some set of standard buttons, listed in the [documentation](/modules/input#isbuttonpressedbutton-string-boolean). These can be accessed in the same way as the Mouse and Keyboard:
62 |
63 | ```
64 | import "input" for GamePad
65 | var pad = GamePad.next
66 | if (pad != null) {
67 | System.print(pad["start"])
68 | System.print(pad["leftstick"])
69 | }
70 | ```
71 |
72 | ### Analog Sticks
73 |
74 | You can get the position of analog sticks (`"left"` and `"right"`) using `.getAnalogStick(_)`. Sticks report their position as values between -1.0 and 1.0.
75 |
76 | ```
77 | import "input" for GamePad
78 | var pad = GamePad.next
79 | if (pad != null) {
80 | System.print(pad.getAnalogStick("left"))
81 | }
82 | ```
83 |
84 | ### Triggers
85 | Similar to the analog sticks, you can retrieve the analog position of triggers using `.getTrigger(_)`. They are represented by a value between 0.0 - 1.0.
86 | ```
87 | import "input" for GamePad
88 | var pad = GamePad.next
89 | if (pad != null) {
90 | System.print(pad.getTrigger("left"))
91 | }
92 | ```
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/docs/guides/module-imports.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | Import Resolution
4 | ===================
5 |
6 | Wren allows scripts to import modules of reusable functionality specific to the embedding environment.
7 |
8 | In our case, DOME allows for modules to be imported by path like this:
9 |
10 | ```
11 | import "[module_path]" for ClassName
12 | ```
13 |
14 | DOME currently resolves paths in a very simple way: All are relative to the entry point of the game, which is usually `main.wren`.
15 |
16 | Module paths are resolved with the following priority:
17 | * DOME's [built-in modules](../modules)
18 | * Wren VM built-in modules `random` and `meta`.
19 | * User-provided modules at the specified path, relative to the game entry point
20 |
21 | As an example, imagine this directory structure:
22 | ```
23 | .
24 | +-- dome
25 | +-- main.wren
26 | +-- map.wren
27 | +-- objects
28 | +-- sprite.wren
29 | +-- background.wren
30 | +-- utils
31 | +-- math.wren
32 | +-- vectors.wren
33 | ```
34 |
35 | To import a class from `utils/math.wren` from `objects/sprite.wren`, you would have an import statement like this:
36 | ```
37 | import "./utils/math" for Math
38 | ```
39 | This is because even though `sprite.wren` is in the `objects` folder, the path has to be relative to the `main.wren` of the project.
40 |
41 |
42 |
--------------------------------------------------------------------------------
/docs/guides/use-dome.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | How to configure DOME
4 | ===================
5 |
6 | Now that you have DOME [installed](/installation) you can use it to create whatever application you wish.
7 | It comes with a number of settings pre-configured, but you may want to change some of these defaults,
8 | to suit your project or for performance reasons.
9 |
10 | This article goes over a few different things you might want to adjust.
11 |
12 | ## Setup a project
13 |
14 | DOME begins execution from a "main.wren" file. It treats the location of that file as the "root" of the project directory.
15 | All module imports and asset paths are relative to it.
16 | It's recommended to keep your project contained within that directory
17 | (although nested folders are allowed) to make packaging your project for distribution easier.
18 |
19 | ## Set up your window
20 |
21 | Most of DOME's engine settings can be accessed in the [`dome`](/modules/dome) module. This includes the `Window` which has a few useful settings to modify.
22 |
23 | From this class, you can:
24 |
25 | * Change the window title ([`Window.title`](/modules/dome#static-title-string))
26 | * Resize the window([`Window.resize`](/modules/dome#static-resizewidth-number-height-number-void))
27 | * Enable fullscreen mode ([`Window.fullscreen`](/modules/dome#static-fullscreen-boolean))
28 | * Enable and disable VSync ([`Window.vsync`](/modules/dome#static-vsync-boolean))
29 | * Change Window background color ([`Window.color`](/modules/dome#static-color-color))
30 | * Configuring the gameloop mode ([`Window.lockstep`](/modules/dome#static-lockstep-boolean))
31 |
32 | ## Feature Management
33 |
34 | DOME strives to be backwards-compatible, but it is possible that your project relies on features from a version of DOME that
35 | is newer than the version running the project.
36 |
37 | In that case, you can use the [`Version`](/modules/dome#version) class (found in the `dome` module) to test the currently running version, and assert that you
38 | are at that minimum level.
39 |
40 | ## Logging and Error Handling
41 |
42 | By default, DOME displays syntax errors and uncaught exceptions in a couple places for easy access:
43 |
44 | * An OS dialog is displayed, containing the encountered error.
45 | * The message is printed out to a `DOME-log.out` file, placed in the same location as your `main.wren` file.
46 | * If possible, it also prints to `stdout`, but this is only visible on a terminal.
47 |
48 | For some, the OS dialog is obnoxious, so it can be disabled setting `Process.errorDialog` to `false`.
49 |
50 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/docs/index.md:
--------------------------------------------------------------------------------
1 | Welcome
2 | ============
3 |
4 | DOME is a framework for making 2D games using the [Wren programming language](http://wren.io) which can be played across platforms.
5 |
6 | Get help in the [DOME Discord Server](https://discord.gg/Py96zeH)!
7 |
8 | Check out the documentation:
9 |
10 | * [Installation](installation)
11 | * [Getting Started](getting-started)
12 | * [FAQ](faq)
13 | * [Guides](guides)
14 | * [How to configure DOME](guides/use-dome)
15 | * [How to draw to the screen?](guides/draw)
16 | * [How to play sounds?](guides/audio)
17 | * [How to handle input?](guides/input)
18 | * [Import Resolution](guides/module-imports)
19 | * [Game Loop Behaviour](guides/game-loop)
20 | * [Distributing your game](guides/distribution)
21 | * [Modules](modules/)
22 | * [audio](modules/audio)
23 | * [collections](modules/collections)
24 | * [dome](modules/dome)
25 | * [graphics](modules/graphics)
26 | * [input](modules/input)
27 | * [io](modules/io)
28 | * [json](modules/json)
29 | * [math](modules/math)
30 | * [plugin](modules/plugin)
31 | * [random](modules/random)
32 | * [Native Plugins](plugins/)
33 | * Examples
34 | * [DOMEjam](https://itch.io/jam/domejam)
35 |
--------------------------------------------------------------------------------
/docs/installation.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | Installation
4 | =================
5 |
6 | You can either download the compiled binaries from GitHub, or you can build the DOME executable from source.
7 |
8 | ## Method 1: Download
9 |
10 | You can download the latest public version of DOME from [itch.io](https://avivbeeri.itch.io/dome) or [GitHub](https://github.com/domeengine/dome/releases/latest). Pick the correct version for your computer's operating system and architecture.
11 |
12 | Once the download is complete, unzip the downloaded archive and place its contents in the directory you want to make your game in.
13 |
14 | At this point, you should have an executable named `dome` in your current directory. Test your installation by opening a terminal/command-prompt, navigating to the directory and executing:
15 |
16 | ```
17 | > ./dome -v
18 | ```
19 | It should print out its version and SDL versions.
20 |
21 | You can also download the example `game.egg` from the GitHub repository to test dome. Place it in the same folder as your executable and then run dome, and it should begin playing.
22 |
23 | ## Method 2: Install using Homebrew
24 | If you have [Homebrew](https://brew.sh/) installed (Mac OS X, [Linux and WSL](https://docs.brew.sh/Homebrew-on-Linux)), you can install DOME using the following commands:
25 |
26 | ```
27 | > brew tap domeengine/tap
28 | > brew install dome
29 | ```
30 | This will install `dome` as a global command for use anywhere.
31 |
32 | ## Method 3: Build from Source
33 |
34 | DOME should build on most unix-like platforms, so long as gcc, git and SDL2 are installed. If these are installed, you can skip to the [Compilation](#compilation) step below.
35 |
36 |
37 | ### Pre-requisite: SDL2
38 |
39 | On Mac OS X, you can install SDL2 by using [Homebrew](https://brew.sh) via the command `brew install sdl2`, or installing the official SDL2.framework file from [the SDL2 website](https://www.libsdl.org/download-2.0.php). Finally, you can also compile SDL2 from source and install it "the unix way".
40 |
41 | Windows is supported, but it's only been tested using a MinGW-w64 MSYS2 environment. For information on setting this up, follow [this guide.](https://github.com/orlp/dev-on-windows/wiki/Installing-GCC--&-MSYS2). You will need a version of SDL2 which is prepared specifically for MinGW-w64.
42 |
43 | To compile on Linux, you need to either build SDL2 from source "the unix way", or install a pre-prepared package appropriate to your distribution.
44 |
45 | ### Compilation
46 |
47 | Once the prerequisites are met, you can clone the DOME repository and build an executable binary by doing the following in your terminal:
48 |
49 | ```
50 | > git clone https://github.com/domeengine/dome.git
51 | > cd dome
52 | > make
53 | ```
54 |
55 | At this point, you should have an executable named `dome` in your current directory. Test your installation by running:
56 |
57 | ```
58 | > ./dome examples/spaceshooter
59 | ```
60 |
61 | If all is well, you should see the example game:
62 |
63 | 
64 |
--------------------------------------------------------------------------------
/docs/modules/async.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | io
4 | ================
5 |
6 | The `io` module provides an interface to the host machine's file system, in order to read and write data files.
7 |
8 | It contains the following classes:
9 |
10 | * [FileSystem](#filesystem)
11 | * [DataBuffer](#databuffer)
12 | * [AsyncOperation](#asyncoperation)
13 |
14 | ## FileSystem
15 |
16 | ### Static Methods
17 |
18 | #### `static load(path)`
19 |
20 |
21 | ## DataBuffer
22 |
23 | ### Instance fields
24 |
25 | #### `data`
26 | #### `length`
27 | #### `ready`
28 |
29 |
30 | ## AsyncOperation
31 |
32 | ### Instance fields
33 |
34 | #### `complete`
35 | #### `result`
36 |
--------------------------------------------------------------------------------
/docs/modules/index.md:
--------------------------------------------------------------------------------
1 | [< Back](..)
2 |
3 | Modules
4 | ============
5 |
6 | DOME includes a number of modules to interact with the user through graphics and audio, access their inputs and hard drive. It also has a few useful utilities for mathematical operations.
7 |
8 | The modules you can import are here:
9 |
10 | * [audio](audio)
11 | * [collections](collections)
12 | * [dome](dome)
13 | * [graphics](graphics)
14 | * [input](input)
15 | * [io](io)
16 | * [json](json)
17 | * [math](math)
18 | * [plugin](plugin)
19 | * [random](random)
20 |
21 | For example, the `graphics` module can be imported to access the `Canvas` and `Color` classes, like this:
22 |
23 | ```wren
24 | import "graphics" for Canvas, Color
25 |
26 | ...
27 |
28 | Canvas.cls()
29 | Canvas.print("Hello world", 20, 20, Color.white)
30 | ```
31 |
--------------------------------------------------------------------------------
/docs/modules/io.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | io
4 | ================
5 |
6 | The `io` module provides an interface to the host machine's file system, in order to read and write data files.
7 |
8 | It contains the following classes:
9 |
10 | * [FileSystem](#filesystem)
11 |
12 | ## FileSystem
13 |
14 | ### Static Methods
15 |
16 | #### `static basePath(): String`
17 | This returns the path to the directory where your application's entry point is.
18 |
19 | #### `static listDirectories(path: String): List`
20 | Returns a list of all directories contained in the directory
21 |
22 | #### `static listFiles(path: String): List`
23 | Returns a list of all files in the directory.
24 |
25 | #### `static load(path: String): String`
26 | Given a valid file `path`, this loads the file data into a String object.
27 | This is a blocking operation, and so execution will stop while the file is loaded.
28 |
29 | #### `static prefPath(org: String, appName: String): String`
30 | This gives you a safe path where you can write personal game files (saves and settings), which are specific to this application. The given `org` and `appName` should be unique to this application. Either or both values may end up in the given file path, so they must adhere to some specific rules. Use letters, numbers, spaces, underscores. Avoid other punctuation.
31 |
32 | #### `static save(path: String, buffer: String): Void`
33 | Given a valid file `path`, this will create or overwrite the file the data in the `buffer` String object.
34 | This is a blocking operation, and so execution will stop while the file is saved.
35 |
36 | #### `static createDirectory(path: String): Void`
37 | Given a valid `path`, creates the directory, if it doesn't already exist and makes parent directories as needed.
38 |
39 | #### `static doesFileExist(path: String): Boolean`
40 | Checks if the path to the given file exists. Does not check the tar bundle
41 |
42 | #### `static doesDirectoryExist(path: String): Boolean`
43 | Checks if the path to the given directory exists. Will also return false if the path is to A file instead.
44 | Does not check the tar bundle.
45 |
--------------------------------------------------------------------------------
/docs/modules/json.md:
--------------------------------------------------------------------------------
1 | [< Back](.)
2 |
3 | json
4 | ================
5 |
6 | The `json` module provides a simple interface to read and write [json files and strings](https://www.json.org/json-en.html).
7 |
8 | It contains the following classes:
9 |
10 | * [Json](#json)
11 | * [JsonOptions](#jsonoptions)
12 | * [JsonError](#jsonerror)
13 |
14 | ## Json
15 |
16 | ### Static Methods
17 |
18 | #### `static encode(object: Object): String`
19 |
20 | #### `static encode(object: Object, options: Num): String`
21 |
22 | Transform the object to a _Json_ encoded string. With default or custom options.
23 | Encoding only works for primitive data types (_Bool_, _Map_, _Num_, _Null_, _List_, _String_). If a non primitive object is passed, the encoder will call it's _toString_ method.
24 |
25 | #### `static decode(value: String, options: Num): Object`
26 |
27 | #### `static decode(value: String): Object`
28 |
29 | Returns a new _Json_ object with default or custom options.
30 |
31 | #### `static load(path: String): Object`
32 |
33 | #### `static load(path: String, options: Num): Object`
34 |
35 | Reads the contents of a file in `path` and returns a new _Json_ object with default or custom options.
36 |
37 | #### `static save(path: String, object: Object)`
38 |
39 | #### `static save(path: String, object: Object, options: Num)`
40 |
41 | This will encode the object and then save the result to a file specified in `path`. With default or custom options.
42 |
43 | ### Examples
44 |
45 | #### Encoding a Simple Object
46 |
47 | A simple object made with only primitive data structures.
48 |
49 | ```js
50 | Json.encode({
51 | "is": true
52 | })
53 | ```
54 |
55 | #### Encoding a Complex Object
56 |
57 | An object made with custom data structures.
58 |
59 | ```js
60 | import "json" for Json
61 |
62 | class MyClass {
63 | // override toString to provide a serializable representation
64 | // of the object. This serialization will be called by the
65 | // Json.encode() method.
66 | toString { Json.encode(toMap) }
67 | toMap { { "is": isTrue } }
68 |
69 | isTrue { _isTrue }
70 |
71 | construct new(isTrue) {
72 | _isTrue = isTrue
73 | }
74 | }
75 |
76 | var obj = MyClass.new(true)
77 |
78 | // prints: { "is":true }
79 | System.print(Json.encode(obj))
80 | ```
81 |
82 | ## JsonOptions
83 |
84 | ### Constants
85 |
86 | #### `static nil: Num`
87 |
88 | No options selected.
89 |
90 | #### `static escapeSlashes: Num`
91 |
92 | This will encode solidus character (`/`). When converting a `Map` object to a `String`. This encoding is optional and is useful when you need to embed `JSON` inside `HTML