<commit_before># Mobile Game Skeleton

This project was as a proof of concept for building cross-platform games using <a href="https://cordova.apache.org/">Apache Cordova</a>. Specifically this project can be used to build for Web/Firefox OS _without_ the need to have Cordova installed. Otherwise, building for iOS and Android will require Cordova.

This engine takes a hybrid approach to game development. Menus with button-based navigation are built using familiar HTML and CSS. Navigation involved hiding and showing various screens. Actual game-loop rendering takes place on a dedicated canvas.


## Play the Original Game

If you're interested in how this game looks and performs on your device:

* [Strategic Game of Life in Web Browser](http://zyu.me/apps/sgol)
* [Strategic Game of Life on Google Play](https://play.google.com/store/apps/details?id=name.thomashunter.strategicgol)
* [Strategic Game of Life on Firefox Marketplace](https://marketplace.firefox.com/app/strategic-gol)
* [Strategic Game of Life on iOS App Store](https://itunes.apple.com/us/app/strategic-game-of-life/id1033673016)
* [Strategic Game of Life on Amazon Appstore](http://amzn.to/1NqEtsc)


## Commands

### Getting Started (Build for Web)

First grab all the necessary files:

```bash
npm install -g gulp # might need sudo
npm install
```

Then run the sample server

```bash
cd server
node ./sgol.js
```

In another terminal run a build for the website

```bash
gulp build-web
```

Finally, open [http://localhost:1337](http://localhost:1337) in your web browser and play a sample game.

### Building With Cordova

Project was built using `cordova@5.3.3`, your mileage may vary with different versions.

#### Install Cordova

```bash
npm install -g cordova
```

#### Build Entire Project

Use a different command based on the environment you want to build for:

```bash
gulp build-ios
gulp build-android
gulp build-web
```

#### Build Sub Components

Compiles one of the types `scripts`, `styles`, `html`, or if omitted, all of them.

```bash
gulp <type>
```

#### Automatic Rebuild

Compiles all three types, then when any change occurs, recompiles. You probably want to do this after `gulp build-web` for testing locally.

```bash
gulp watch
```

#### Download Data

Download data from the CMS to tmp/data.json. Needed for Cordova build steps.

```bash
gulp data
```

## Forking Guide

This isn't a library you can simply download and start using, it's actually a complete game. If you want to build a whole new game using this as a base, you'll want to keep the following in mind:

 * CMS uses [Grille](https://www.npmjs.com/package/grille), though you can edit the JSON by hand
  * If demand is high enough I'll include a copy of the original spreadsheet
 * Create a Mixpanel account (or remove any occurrence of `analytics`)
 * Create a Ad Mob account (or remove any occurrence of `interstitial`)


## Platform Specific Notes
<commit_msg>notes notes notes<commit_after># Mobile Game Skeleton

This project was as a proof of concept for building cross-platform games using <a href="https://cordova.apache.org/">Apache Cordova</a>. Specifically this project can be used to build for Web/Firefox OS _without_ the need to have Cordova installed. Otherwise, building for iOS and Android will require Cordova.

This engine takes a hybrid approach to game development. Menus with button-based navigation are built using familiar HTML and CSS. Navigation involved hiding and showing various screens. Actual game-loop rendering takes place on a dedicated canvas.


## Play the Original Game

If you're interested in how this game looks and performs on your device:

* [Strategic Game of Life in Web Browser](http://zyu.me/apps/sgol)
* [Strategic Game of Life on Google Play](https://play.google.com/store/apps/details?id=name.thomashunter.strategicgol)
* [Strategic Game of Life on Firefox Marketplace](https://marketplace.firefox.com/app/strategic-gol)
* [Strategic Game of Life on iOS App Store](https://itunes.apple.com/us/app/strategic-game-of-life/id1033673016)
* [Strategic Game of Life on Amazon Appstore](http://amzn.to/1NqEtsc)


## Commands

### Getting Started (Build for Web)

First grab all the necessary files:

```bash
npm install -g gulp # might need sudo
npm install
```

Then run the sample server

```bash
cd server
node ./sgol.js
```

In another terminal run a build for the website

```bash
gulp build-web
```

Finally, open [http://localhost:1337](http://localhost:1337) in your web browser and play a sample game.

### Building With Cordova

Project was built using `cordova@5.3.3`, your mileage may vary with different versions.

#### Install Cordova

```bash
npm install -g cordova
```

#### Build Entire Project

Use a different command based on the environment you want to build for:

```bash
gulp build-ios
gulp build-android
gulp build-web
```

#### Build Sub Components

Compiles one of the types `scripts`, `styles`, `html`, or if omitted, all of them.

```bash
gulp scripts
gulp styles
gulp html
gulp
```

#### Automatic Rebuild

Compiles all three types, then when any change occurs, recompiles. You probably want to do this after `gulp build-web` for testing locally.

```bash
gulp watch
```

#### Download Data

Download data from the CMS to tmp/data.json. Needed for Cordova build steps.

```bash
gulp data
```

## Forking Guide

This isn't a library you can simply download and start using, it's actually a complete game. If you want to build a whole new game using this as a base, you'll want to keep the following in mind:

 * CMS uses [Grille](https://www.npmjs.com/package/grille), though you can edit the JSON by hand
  * If demand is high enough I'll include a copy of the original spreadsheet
 * Create a Mixpanel account (or remove any occurrence of `analytics`)
 * Create a Ad Mob account (or remove any occurrence of `interstitial`)


## Platform Specific Notes

{'fraction_non_alphanumeric': 0.0923285811269518, 'fraction_numerical': 0.00746775288526816, 'mean_word_length': 4.3670309653916215, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1230262', 'n_tokens_mistral': 1792, 'n_tokens_neox': 1653, 'n_words': 785}