├── .editorconfig ├── .gitattributes ├── .github ├── FUNDING.yml └── workflows │ ├── build-all.yml │ ├── itch.yml │ └── windows-only.yml ├── .gitignore ├── .gitmodules ├── AUTHORS.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── README.md ├── assets ├── dome-circle.ico ├── icon.rc ├── icon32.res ├── icon64.res └── shell.html ├── docs ├── CNAME ├── Gemfile ├── _config.yml ├── _layouts │ └── default.html ├── android-chrome-192x192.png ├── android-chrome-512x512.png ├── apple-touch-icon.png ├── assets │ ├── badge.svg │ ├── card.png │ ├── css │ │ └── style.scss │ ├── discord.svg │ ├── dome-logo │ │ ├── dome-black.svg │ │ ├── dome-circle-flat.svg │ │ ├── dome-circle.svg │ │ └── dome-white.svg │ ├── favicon │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-512x512.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ └── favicon.ico │ ├── itch.svg │ ├── logo200.png │ ├── logo400.png │ ├── mastodon.svg │ ├── shmup.png │ └── twitter.svg ├── browserconfig.xml ├── faq.md ├── favicon-16x16.png ├── favicon-32x32.png ├── favicon.ico ├── getting-started.md ├── googleb221921b4b2ce5ee.html ├── guides │ ├── audio.md │ ├── distribution.md │ ├── draw.md │ ├── game-loop.md │ ├── index.md │ ├── input.md │ ├── module-imports.md │ └── use-dome.md ├── index.md ├── installation.md ├── modules │ ├── async.md │ ├── audio.md │ ├── collections.md │ ├── dome.md │ ├── graphics.md │ ├── index.md │ ├── input.md │ ├── io.md │ ├── json.md │ ├── math.md │ ├── plugin.md │ └── random.md ├── mstile-144x144.png ├── mstile-150x150.png ├── mstile-310x150.png ├── mstile-310x310.png ├── mstile-70x70.png ├── plugins │ ├── audio.md │ ├── bitmap.md │ ├── canvas.md │ ├── core.md │ ├── example.md │ ├── index.md │ ├── io.md │ └── wren.md ├── quick-start.md ├── safari-pinned-tab.svg └── site.webmanifest ├── examples ├── alpha │ └── main.wren ├── audio │ └── main.wren ├── circle │ └── main.wren ├── clipping │ └── main.wren ├── ellipse │ └── main.wren ├── empty │ └── main.wren ├── fonts │ ├── main.wren │ └── memory.ttf ├── geometry │ └── main.wren ├── plugin │ ├── Makefile │ ├── main.wren │ ├── test.c │ └── test.dylib ├── random │ └── main.wren ├── raycaster │ ├── Makefile │ ├── domath.c │ ├── gfx.c │ ├── main.wren │ ├── map.dat │ ├── object.c │ ├── plugin.c │ ├── raycaster.dylib │ ├── renderer.c │ ├── renderer.h │ ├── renderer.wren │ ├── renderer.wren.inc │ ├── res │ │ ├── DUMMY1.png │ │ ├── DUMMY2.png │ │ ├── DUMMY3.png │ │ ├── DUMMY4.png │ │ ├── DUMMY5.png │ │ ├── DUMMY6.png │ │ ├── DUMMY7.png │ │ ├── DUMMY8.png │ │ ├── blankwall.png │ │ ├── ceil.png │ │ ├── charger-floor.png │ │ ├── charger-walls.png │ │ ├── column.png │ │ ├── column2.png │ │ ├── door.png │ │ ├── energy-bar.png │ │ ├── floor.png │ │ ├── guard-test.png │ │ ├── light.png │ │ ├── pit.png │ │ ├── terminal.png │ │ ├── uibox.png │ │ ├── wall1.png │ │ ├── wall2.png │ │ ├── wall3.png │ │ ├── wall4.png │ │ ├── walls.ase │ │ └── weaponsheet.png │ ├── sbuf.c │ ├── texture.c │ ├── tile.c │ └── wall.png ├── rect │ └── main.wren ├── spaceshooter │ ├── config.txt │ ├── game.egg │ ├── main.wren │ └── res │ │ ├── AerisPiano.ogg │ │ ├── Explosion.wav │ │ ├── Hit_Hurt.wav │ │ ├── Laser_Shoot.wav │ │ ├── around-the-corner.ogg │ │ ├── enemy.png │ │ ├── heart-empty.png │ │ ├── heart-full.png │ │ ├── music.wav │ │ ├── sfx.bfxrlibrary │ │ ├── ship1.png │ │ └── ship2.png ├── textInput │ └── main.wren └── triangles │ └── main.wren ├── include ├── ABC_fifo.h ├── dome.h ├── dr_flac.h ├── dr_mp3.h ├── glibc_compat.c ├── json │ ├── pdjson.c │ └── pdjson.h ├── microtar │ ├── microtar.c │ └── microtar.h ├── mkdirp │ ├── mkdirp.c │ └── mkdirp.h ├── optparse.h ├── stb_image.h ├── stb_image_write.h ├── stb_truetype.h ├── stb_vorbis.c ├── tinydir.h ├── utf8.h ├── vendor.c ├── vendor.h ├── whereami │ ├── whereami.c │ └── whereami.h ├── wren.c └── wren.h ├── main.wren ├── scripts ├── generateEmbedModules.sh ├── set-executable-path.sh ├── setup_static_linux_sdl.sh ├── setup_static_mac_sdl.sh ├── setup_wren_web.sh └── vars.sh └── src ├── api ├── audio.c ├── bitmap.c ├── canvas.c ├── core.c └── io.c ├── audio ├── channel.c ├── engine.c ├── engine.h └── hashmap.c ├── debug.c ├── engine.c ├── engine.h ├── font ├── font.c ├── font8x8.h ├── font8x8_basic.h ├── font8x8_block.h ├── font8x8_box.h ├── font8x8_control.h ├── font8x8_ext_latin.h ├── font8x8_greek.h ├── font8x8_hiragana.h ├── font8x8_latin.h ├── font8x8_misc.h └── font8x8_sga.h ├── game.c ├── io.c ├── main.c ├── math.c ├── modules ├── audio.c ├── audio.wren ├── collections.wren ├── color.wren ├── dome.c ├── dome.wren ├── font.c ├── font.wren ├── graphics.c ├── graphics.wren ├── image.c ├── image.wren ├── input.c ├── input.wren ├── io.c ├── io.wren ├── json.c ├── json.wren ├── map.c ├── math.c ├── math.wren ├── platform.c ├── platform.wren ├── plugin.c ├── plugin.wren ├── random.c ├── random.wren ├── stringUtils.wren └── vector.wren ├── plugin.c ├── plugin.h ├── signature.c.inc ├── strings.c ├── tools ├── embed-standalone.c ├── embed.c ├── embedlib.c ├── fuse.c ├── help.c ├── nest.c └── tools.h └── vm.c /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | insert_final_newline = true 5 | indent_size = 2 6 | indent_style = space 7 | charset = utf-8 8 | 9 | [Makefile] 10 | indent_style = tab 11 | 12 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | $ cat .gitattributes 2 | * text=auto 3 | *.wren linguist-language=JavaScript 4 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: avivbeeri 2 | -------------------------------------------------------------------------------- /.github/workflows/itch.yml: -------------------------------------------------------------------------------- 1 | # This is a basic workflow to help you get started with Actions 2 | 3 | name: CI 4 | 5 | # Controls when the action will run. 6 | on: 7 | # Allows you to run this workflow manually from the Actions tab 8 | workflow_dispatch: 9 | 10 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 11 | jobs: 12 | # This workflow contains a single job called "build" 13 | 14 | itch-release: 15 | # The type of runner that the job will run on 16 | runs-on: ubuntu-latest 17 | strategy: 18 | matrix: 19 | platform: ["windows-x64", "windows-x32", "macosx-all", "linux-x64", "linux-x64-shared"] 20 | 21 | # Steps represent a sequence of tasks that will be executed as part of the job 22 | steps: 23 | 24 | - id: fetch-latest-release 25 | uses: thebritican/fetch-latest-release@v2.0.0 26 | with: 27 | github_token: ${{ github.token }} 28 | - id: get-id 29 | run: | 30 | id=$(echo ${{steps.fetch-latest-release.outputs.tag_name}} | cut -f 2 -d v) 31 | echo "::set-output name=id::$id" 32 | - run: echo "${{steps.get-id.outputs.id}}" 33 | - uses: dsaltares/fetch-gh-release-asset@master 34 | with: 35 | repo: "domeengine/dome" 36 | version: "latest" 37 | file: "dome-${{steps.fetch-latest-release.outputs.tag_name}}-${{matrix.platform}}.zip" 38 | token: ${{ secrets.ASSET_TOKEN }} 39 | - uses: josephbmanley/butler-publish-itchio-action@master 40 | env: 41 | BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }} 42 | CHANNEL: ${{matrix.platform}} 43 | ITCH_GAME: dome 44 | ITCH_USER: avivbeeri 45 | VERSION: ${{steps.get-id.outputs.id}} 46 | PACKAGE: dome-${{steps.fetch-latest-release.outputs.tag_name}}-${{matrix.platform}}.zip 47 | 48 | notify-discord: 49 | runs-on: ubuntu-latest 50 | steps: 51 | - id: fetch-latest-release 52 | uses: thebritican/fetch-latest-release@v2.0.0 53 | with: 54 | github_token: ${{ github.token }} 55 | - name: Discord notification 56 | env: 57 | DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} 58 | DISCORD_EMBEDS: > 59 | [{ 60 | "title": "New Release: '${{steps.fetch-latest-release.outputs.tag_name}}' is now available for download!", 61 | "url": "${{steps.fetch-latest-release.outputs.html_url}}", 62 | "author": { 63 | "name": "${{steps.fetch-latest-release.outputs_login}}", 64 | "url": "${{steps.fetch-latest-release.outputs.html_url}}" 65 | } 66 | }] 67 | uses: Ilshidur/action-discord@0.3.0 68 | -------------------------------------------------------------------------------- /.github/workflows/windows-only.yml: -------------------------------------------------------------------------------- 1 | name: Windows only test build 2 | on: 3 | workflow_dispatch: 4 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 5 | 6 | jobs: 7 | build-windows: 8 | runs-on: windows-latest 9 | strategy: 10 | matrix: 11 | msystem: [MINGW32, MINGW64] 12 | defaults: 13 | run: 14 | shell: msys2 {0} 15 | steps: 16 | - uses: actions/checkout@v3 17 | - uses: msys2/setup-msys2@v2 18 | with: 19 | msystem: ${{ matrix.msystem }} 20 | release: true 21 | update: true 22 | install: git make mercurial subversion 23 | 24 | - run: pacman --noconfirm -S mingw-w64-x86_64-toolchain mingw-w64-x86_64-SDL2 25 | if: ${{ (matrix.msystem == 'MINGW64') }} 26 | - run: pacman --noconfirm -S mingw-w64-i686-toolchain mingw-w64-i686-SDL2 27 | if: ${{ (matrix.msystem == 'MINGW32') }} 28 | 29 | - run: git fetch --prune --unshallow 30 | - run: gcc -v 31 | - run: "make STATIC=1 TARGET_NAME=dome CC=gcc" 32 | - uses: actions/upload-artifact@v3 33 | if: ${{ (matrix.msystem == 'MINGW32') }} 34 | with: 35 | name: dome-windows-x32 36 | path: | 37 | dome.exe 38 | - uses: actions/upload-artifact@v3 39 | if: ${{ (matrix.msystem == 'MINGW64') }} 40 | with: 41 | name: dome-windows-x64 42 | path: | 43 | dome.exe 44 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | DOME-out.log 2 | .mode 3 | .arch 4 | dome 5 | nest 6 | libwren.a 7 | libwrend.a 8 | libadd.so 9 | **/.DS_Store 10 | src/tools/convert 11 | src/tools/embed 12 | src/modules/*.inc 13 | include/SDL2/* 14 | lib/sdl2-config 15 | lib/SDL2* 16 | lib/SDL/special 17 | lib/SDL* 18 | lib/libSDL2* 19 | 20 | lib/wren_all.c 21 | 22 | *.o 23 | *.swp 24 | *.dSYM 25 | obj/ 26 | 27 | node_modules 28 | docs/_site/**/* 29 | docs/**/_site 30 | docs/.sass-cache/ 31 | docs/.jekyll-cache/ 32 | docs/.jekyll-metadata 33 | docs/vendor 34 | docs/.bundle 35 | Gemfile.lock 36 | 37 | dome.data 38 | dome.html 39 | dome.js 40 | dome.wasm 41 | 42 | *.egg 43 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lib/SDL"] 2 | path = lib/SDL 3 | url = https://github.com/libsdl-org/SDL 4 | ignore = untracked 5 | -------------------------------------------------------------------------------- /AUTHORS.md: -------------------------------------------------------------------------------- 1 | Authors 2 | ======= 3 | We'd like to thank the following people for their contributions. 4 | 5 | * Aviv Beeri, aka springogeek [https://github.com/avivbeeri] 6 | * scholar-mage [https://github.com/scholar-mage] 7 | * Francisco Requena, aka frarees [https://github.com/frarees] 8 | * Camilo Castro, aka clsource [https://github.com/clsource] 9 | * Siddhant Rao [https://siddhantrao23.github.io] 10 | * Chayim Refael Friedman [https://github.com/ChayimFriedman2] 11 | * Benjamin Stigsen [https://github.com/benstigsen] 12 | * Alexandru Badiu, aka voidberg [https://github.com/voidberg] 13 | * Aayush Kashyap [https://github.com/TheKing0x9] 14 | * Trevor Martin [https://github.com/trelemar] 15 | * 8_BIT-DEV [https://github.com/8-BIT-DEV] 16 | * catsanddo [https://github.com/catsanddo] 17 | * Kaspar Martin Suursalu [https://github.com/Kasparsu] 18 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies within all project spaces, and it also applies when 49 | an individual is representing the project or its community in public spaces. 50 | Examples of representing a project or community include using an official 51 | project e-mail address, posting via an official social media account, or acting 52 | as an appointed representative at an online or offline event. Representation of 53 | a project may be further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at avbeeri@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | 78 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Aviv Beeri 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /assets/dome-circle.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/assets/dome-circle.ico -------------------------------------------------------------------------------- /assets/icon.rc: -------------------------------------------------------------------------------- 1 | id ICON "dome-circle.ico" 2 | -------------------------------------------------------------------------------- /assets/icon32.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/assets/icon32.res -------------------------------------------------------------------------------- /assets/icon64.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/assets/icon64.res -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | domeengine.com -------------------------------------------------------------------------------- /docs/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # Gems here 4 | gem 'github-pages', group: :jekyll_plugins 5 | 6 | gem "jekyll", "~> 3.9" 7 | 8 | gem "webrick", "~> 1.7" 9 | -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | title: DOME 2 | description: "The comfortable framework for making games in Wren" 3 | theme: jekyll-theme-minimal 4 | show_downloads: false 5 | logo: https://domeengine.com/assets/dome-logo/dome-circle-flat.svg 6 | baseurl: "/" 7 | 8 | -------------------------------------------------------------------------------- /docs/_layouts/default.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | {% seo %} 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 28 | 29 | 30 |
31 |
32 |
33 | 34 | {% if site.logo %} 35 | Logo 36 | {% endif %} 37 | 38 |

{{ site.title | default: site.github.repository_name }}

39 | 40 |

{{ site.description | default: site.github.project_tagline }}

41 |

42 | 43 | Download the latest version here! 44 | 45 |

46 | 47 | {% if site.github.is_project_page %} 48 |

View the Project on GitHub {{ site.github.repository_nwo }}

49 | {% endif %} 50 | 51 |

52 | 53 | 54 | 55 |

56 | 57 | 63 | 64 | 65 | {% if site.github.is_user_page %} 66 |

View My GitHub Profile

67 | {% endif %} 68 | 69 | {% if site.show_downloads %} 70 | 75 | {% endif %} 76 |
77 |
78 | 79 | {{ content }} 80 | 81 |
82 |
83 | 85 |
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 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/assets/shmup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/domeengine/dome/2b2db1198fef0bbba7215b6f40f0d02c898627b5/docs/assets/shmup.png -------------------------------------------------------------------------------- /docs/assets/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | 21 | 22 | 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 | ![Image of Tutorial Shmup](https://domeengine.com/assets/shmup.png) 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