You are the leader of a small village in this very hostile world you need to decide if you will pay tribute to the gods or stand on your own against plagues that visit this world every year. Manage your villagers assign them to work so they can gather resources for sacrifices or village development. Or leave them idle so they can multiply and sacrifice them to permanently weaken creatures disturbing this world.
You can check this project here: The greatest sacrifice - ludumdare 43
You can also check benchmarking subproject where I check efficiency of different approaches to solving encountered optimization problems.
npm i
npm run game:build:prod
npm run game:start
This project uses InversifyJS
for dependency injection React
to provide web interface, and Phaser
as sound and asset management. I treat it as proof of concept that all those technologies can be connected via dependency injection.
Everything is builded via Webpack
with some default setup provided from xes-webpack-core
. This project helps me to figure out what default configuration should be provided by xes-webpack-core
.
Potentially reusable parts are places under src
folder. Game specific files are placed under game
folder. As this is work in progress files and their location will change drastically.
npm run game:serve
or
npm run game:serve:https
For extracting translation string into pot
files run:
npm run game:xi18n
Then under game/locales/messages.pot
you can fin newly extracted segments you can use them to update already translated segments in game/locales/messages.#lang#.po
or add new translations.
TODO: create single source of true for language configuration
src/lib/interfaces.ts
add new locale string to LanguageType
.
Then update locale selection components.
You can check benchmarks code in benchmarks
folder.
To run in development mode:
npm run benchmarks:serve
To build for production:
npm run benchmarks:build:prod
npm run benchmarks:start
If we need to handle some vendors libraries that do not work well with standard webpack module exports and imports we have few options to choose from:
- if you want to export some variable from vendor library with webpack use inlined
export-loader
- if you want to import some dependency into vendor library with webpack use inlined
import-loader
- if you want to expose to global scope some variable in vendor library with webpack use inlined
expose-loader
Links:
- easy way to add service worker caching with workbox actually used in this project
- article about service worker on CSS Tricks
- for generating ssl certificates research mkcert
To be able to visualize progress of downloading modules splitted by weback I needed to use ChunkProgressWebpackPlugin
it converts request for lazy loaded modules into XHR request. Unfortunately it didn't handle correctly progress of downloading gziped content. In general in chrome when downloading gziped content we get lengthComputable === false
so we need to send additional header info with uncompressed data size as suggested in stackoverflow.
This solution requires to create own server that can add those additional data or not show precentage progress of downloading if this additional data is not available.
- Why I don't use
Function.bind
and instead use instance functions when it supposed to be more optimized?this
in Typescript
- Data Storage Redux
- Dependency Injection Modules with InversifyJS
- Theming - ability to choose layout styles from some predefined set of themes
- Audio manager - module for handling playing music and sounds
- Preloader - reduce initial download size to what is only needed to display loader
- I18n - add ability to translate application UI extracting translation segments to be translated with Poedit and switch language dynamically by application user
- Fullscreen - handle switching to full screen view
- ServiceWorker - cache application for running offline
- Configuration view component handling configuration of audio and theming
- Large-Allocation header
- connect react router history to redux store
- separate audio from phaser or init phaser in compact mode
- add about view
- work on phaser states
- analytics with gtag vs google tag manager
- research open id
- connect playfab
- use immer
- web monetization