<commit_before># chocolatier

A work-in-progress web game engine for repl driven game development written in ClojureScript using Pixi.js as a rendering engine.

## Usage

### With `figwheel`
The following instructions will start a browser connected repl and launch the demo game:

0. Clone the project and all submodules `git clone --recursive https://github.com/alexkehayias/chocolatier`
1. Start the browser REPL server `lein figwheel`
2. Navigate your browser to `http://127.0.0.1:3449` to connect to the REPL
3. In the REPL, change namespaces `(in-ns 'chocolatier.core)` then start the game `(restart-game!)`. This may take a few seconds to load assets and init WebGL (if your browser supports it).

### With `figwheel` and emacs using `cider`

The recommended setup is to connect to the `figwheel` REPL server from emacs `cider` so that you can integrate the text editor into the development workflow. This allows you to send code to the running repl for evaluation using emacs `cider-mode`.

After completing step 2 from the `figwheel` instructions above, in emacs:

1. Connect to the `figwheel` REPL `M-x cider-connect RET localhost RET 8999`
2. Start ClojureScript REPL `(do (use 'figwheel-sidecar.repl-api) (cljs-repl))`
3. Open the game file `C-x C-f RET /chocolatier/src/cljs/chocolatier/core.cljs`
4. Change to the namespace in that file `C-c M-n`
5. Evaluate the file `C-c M-k`
6. Start the demo game `(restart-game!)`

### Compiling with advanced optimizations

Currently not supported due to external library dependencies which will require an externs file or a rewrite of how external objects are called.

## Entity Component System

The game engine implemented using a modified entity component system which organizes aspects of a game modularly. Think about it less as a bunch of objects with their own state and methods and more like a database where you query for functionality, state, based on a certain aspect or entity.

Organization:
<commit_msg>Update readme for advanced compilation build<commit_after># chocolatier

A work-in-progress web game engine for repl driven game development written in ClojureScript using Pixi.js as a rendering engine.

## Usage

### With `figwheel`
The following instructions will start a browser connected repl and launch the demo game:

0. Clone the project and all submodules `git clone --recursive https://github.com/alexkehayias/chocolatier`
1. Start the browser REPL server `lein figwheel`
2. Navigate your browser to `http://127.0.0.1:3449` to connect to the REPL
3. In the REPL, change namespaces `(in-ns 'chocolatier.core)` then start the game `(restart-game!)`. This may take a few seconds to load assets and init WebGL (if your browser supports it).

### With `figwheel` and emacs using `cider`

The recommended setup is to connect to the `figwheel` REPL server from emacs `cider` so that you can integrate the text editor into the development workflow. This allows you to send code to the running repl for evaluation using emacs `cider-mode`.

After completing step 2 from the `figwheel` instructions above, in emacs:

1. Connect to the `figwheel` REPL `M-x cider-connect RET localhost RET 8999`
2. Start ClojureScript REPL `(do (use 'figwheel-sidecar.repl-api) (cljs-repl))`
3. Open the game file `C-x C-f RET /chocolatier/src/cljs/chocolatier/core.cljs`
4. Change to the namespace in that file `C-c M-n`
5. Evaluate the file `C-c M-k`
6. Start the demo game `(restart-game!)`

### Compiling with advanced optimizations

1. Run `lein cljsbuild once min`
2. Update `resources/public/index.html` to use `resources/public/js/compiled/chocolatier-min.js`

## Entity Component System

The game engine implemented using a modified entity component system which organizes aspects of a game modularly. Think about it less as a bunch of objects with their own state and methods and more like a database where you query for functionality, state, based on a certain aspect or entity.

Organization:

{'fraction_non_alphanumeric': 0.0743174924165824, 'fraction_numerical': 0.01314459049544995, 'mean_word_length': 4.42798353909465, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '843321', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1127, 'n_words': 570}