├── .eslintrc.cjs
├── .gitignore
├── LICENSE
├── README.md
├── dist
├── game.zip
└── index.html
├── index.html
├── package-lock.json
├── package.json
├── plugins
└── vite-js13k.js
├── screenshot-bigx1.png
├── screenshot-bigx2.png
├── screenshot-smallx1.png
├── screenshot-smallx2.png
├── src
├── animal.js
├── audio.js
├── cell.js
├── colors.js
├── create-element.js
├── demo-colors.js
├── farm.js
├── find-route.js
├── fish-emoji.js
├── fish-farm.js
├── fish.js
├── gameover.js
├── goat-emoji.js
├── goat-farm.js
├── goat.js
├── grid-toggle.js
├── grid.js
├── hull.js
├── inventory.js
├── keyboard.js
├── layers.js
├── main.js
├── menu-background.js
├── menu.js
├── modified-kontra
│ ├── game-loop.js
│ ├── game-object.js
│ └── updatable.js
├── ox-emoji.js
├── ox-farm.js
├── ox.js
├── path.js
├── person.js
├── pointer.js
├── pond.js
├── remove-path.js
├── shuffle.js
├── spawning.js
├── svg-utils.js
├── svg.js
├── tree.js
├── ui.js
├── vector.js
├── weighted-random.js
└── yurt.js
└── vite.config.js
/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es2021: true,
5 | },
6 | extends: 'airbnb-base',
7 | overrides: [
8 | {
9 | env: {
10 | node: true,
11 | },
12 | files: [
13 | '.eslintrc.{js,cjs}',
14 | ],
15 | parserOptions: {
16 | sourceType: 'script',
17 | },
18 | },
19 | ],
20 | parserOptions: {
21 | ecmaVersion: 'latest',
22 | sourceType: 'module',
23 | },
24 | rules: {
25 | 'no-continue': 'off',
26 | 'no-new': 'off', // GameObjects assign themselves to appropriate lists so are not thrown away
27 | 'no-plusplus': 'off',
28 | 'no-return-assign': 'off',
29 | 'import/prefer-default-export': 'off',
30 | },
31 | };
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /node_modules
2 | /dist/minified.js
3 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 John
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 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Tiny Yurts
2 |
3 |
28 |
4 |
5 | ### [Play online](https://burnt.io/tiny-yurts/)
6 |
7 | > A web game inspired by [Dinosaur Polo Club's](https://dinopoloclub.com/) [Mini Motorways](https://dinopoloclub.com/games/mini-motorways/), created for [Js13kGames](https://js13kgames.com/) 2023
8 | > \- the total size of the [zipped](dist/game.zip) [index.html](dist/index.html) is under 13,312B!
9 |
10 | ### How to play
11 |
12 | - Touch or left click and drag to build paths between your yurts and farms to keep the animals happy!
13 | - You get points for your total number of settlers (2x your number of yurts), plus a point for each animal.
14 | - __Fullscreen__ is highly recommended for mobile.
15 |
16 | ### Tech used
17 | - All the graphics are SVG-based, with CSS transitions and transforms. There is no canvas, and there are no asset files. It's HTML-CSS-SVG-in-JS all the way down.
18 | - JavaScript packer [Roadroller](https://lifthrasiir.github.io/roadroller/) by [Kang Seonghoon](https://mearie.org/).
19 | - [Kontra.js](https://straker.github.io/kontra/) game engine by [Steven Lambert](https://stevenklambert.com/).
20 | - [Karplus-Strong](https://en.wikipedia.org/wiki/Karplus%E2%80%93Strong_string_synthesis) [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API) implementation, from [xem's](https://xem.github.io/) [MiniSynth](https://github.com/xem/js1k19/blob/gh-pages/miniSynth/index.html), based on [Keith Horwood's](https://keithwhor.com/) [audiosynth](https://github.com/keithwhor/audiosynth).
21 | - [JSZip](https://stuk.github.io/jszip/) _and_ [advzip-bin](https://github.com/elliot-nelson/advzip-bin) for zip compression.
22 | - [Vite](https://vitejs.dev/) and [Terser](https://terser.org/) with a messy, unstable, project-specific ([custom plugin](plugins/vite-js13k.js)) for maximum minification.
23 |
24 | ### Tips & Tricks
25 |
(Click to show - minor spoilers)
27 |
29 |
40 |