Skip to content

Commit

Permalink
Merge branch 'master' into gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
daformat committed May 20, 2014
2 parents 9f91331 + 87ad0bb commit e7dae43
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 20 deletions.
67 changes: 53 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,73 @@
cryptris
Cryptris
========

### A game about asymetric cryptography

To test the board, go to game.html
Cryptris is a game designed to help people in getting a grasp about how cryptography works, by playing an arguably tetris-like game.

The game was developped by [Digital Cuisine][digital-cuisine] for [Inria][inria] and is based on a concept created by Léo Ducas.

Test the game

'r' => Generate a key.
### Technology

'b' => Load a 8 column board with the message 24
This game uses html, css and javascript. No server were harmed during the developpment process.

'c' => Load a 10 column board with the message 78

'd' => Load a 12 column board with the message 31
### Installation

The whole application is designed to be a serverless application, hence the installation is pretty straightforward: simply clone this repository or download it as an archive.


Test the Create Key test
### Launching the game

'a' => load the create_key screen.
To launch the game, simply open the `index.html` file in a compatible web browser.

'e' => launch the computer process

### Configuring the game for using on a custom domain / url

Changin the app's url is just a matter of changing the url that social networks will use to fetch data about Cryptris (title, descriptions, picture previews…). Unfortunately, due to the serverless nature of this project, a few occurences of this url _had to be_ hard-coded in the html files' meta tags. A global configuration variable is used everywhere else where the app's url is needed, this variable can be found in the `js/cryptris-settings.js` file.

To switch at a specific dialog, in the console :
**Before publishing the game,** make sure that you proceed to the following:

currentGame.switchDialog(dialogNumber);
* open up `js/cryptris-settings.js`.
* look for the line where `cryptrisSettings.appUrl` is defined.
* copy `appUrl`'s actual value (e.g. http://daformat.github.io/cryptris)
* search and replace this url in the game's `.html` files.
* set `cryptrisSettings.appUrl` to whatever your new url is.
* upload to your new url and carefully test that every sharing function still works as expected.

To know the current dialog number :
Be sure to update the app settings for facebook (facebook apps) and google+ (google API console), as of may 2014, twitter doesn't ask for this.

currentGame.currentDialog();

### Hosting the game on github

To publish on github the only thing you need to do is to make sure that your `gh-pages` branch is up-to-date and push it to your github account. You should be able to access it via http://[username].github.io/cryptris where [username] should be replaced by your actual github username.


### Credits

Basé sur une idée originale de Léo Ducas

#### Scénario
Mathieu Jouhet & Nicolas Pelletier

#### Inria
* *Coordination :* Service communication du centre de recherche Inria Paris - Rocquencourt
* *Référents médiation :* Thierry Vieville et Laurent Viennot
* *Référent scientifique :* Léo Ducas

#### Digital Cuisine
* *Directeur Artistique :* Mathieu Jouhet ([@daformat](https://twitter.com/daformat))
* *Graphiste :* Nicolas Pelletier
* *Game engine :* Vincent Mézino
* *Intégration html, développement javascript:* Mathieu Jouhet
* *Test :* Olivier Lance, Pierre-Jean Quilleré

___

### Links & references
[Digital Cuisine][digital-cuisine]
[digital-cuisine]: www.digitalcuisine.fr

[Inria][inria]
[inria]: www.inria.fr
20 changes: 20 additions & 0 deletions game.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,24 @@
<script type="text/javascript" src="./js/jeu.js"></script>

</body>

<!--
#### Test the game
'r' => Generate a key.
'b' => Load a 8 column board with the message 24
'c' => Load a 10 column board with the message 78
'd' => Load a 12 column board with the message 31
Test the Create Key test
'a' => load the create_key screen.
'e' => launch the computer process
To switch at a specific dialog, in the console :
currentGame.switchDialog(dialogNumber);
To know the current dialog number :
currentGame.currentDialog();
-->

</html>
4 changes: 2 additions & 2 deletions js/game_engine/share.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ function createCryptedMessage() {
var hrefPath = url,
title = "Défi! Cryptris, un jeu gratuit sur la cryptographie asymétrique",
text = "Déchiffrez le message: ",
preview = "http://daformat.github.io/cryptris/img/cryptis-social-preview-600x600.png",
preview_xl = "http://daformat.github.io/cryptris/img/cryptis-social-preview-1200x630.png",
preview = cryptrisSettings.appUrl + "/img/cryptis-social-preview-600x600.png",
preview_xl = cryptrisSettings.appUrl + "/img/cryptis-social-preview-1200x630.png",
code = string_to_ternary(crypted_message.plain_message.toString()).join('').substr(0,80);

/** Setup sharing urls **/
Expand Down
4 changes: 2 additions & 2 deletions js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ $(function(){
hrefPath = url,
title = "Cryptris, un jeu gratuit sur la cryptographie asymétrique",
text = "Défiez l’ordinateur pour savoir qui arrivera à décrypter le plus rapidement. De nombreux défis cryptologiques vous attendent, êtes-vous prêts ?",
preview = "http://daformat.github.io/cryptris/img/cryptis-social-preview-600x600.png";
preview_xl = "http://daformat.github.io/cryptris/img/cryptis-social-preview-1200x630.png";
preview = cryptrisSettings.appUrl + "/img/cryptis-social-preview-600x600.png";
preview_xl = cryptrisSettings.appUrl + "/img/cryptis-social-preview-1200x630.png";

/** Setup sharing urls **/

Expand Down
4 changes: 2 additions & 2 deletions js/jeu.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,8 @@ $(document).ready(function() {
hrefPath = url,
title = "Cryptris, un jeu gratuit sur la cryptographie asymétrique",
text = "Je viens de terminer Cryptris - un jeu sur l’univers de la cryptographie asymétrique. Affrontez l’ordinateur",
preview = "http://daformat.github.io/cryptris/img/cryptis-social-preview-600x600.png";
preview_xl = "http://daformat.github.io/cryptris/img/cryptis-social-preview-1200x630.png";
preview = cryptrisSettings.appUrl + "/img/cryptis-social-preview-600x600.png";
preview_xl = cryptrisSettings.appUrl + "/img/cryptis-social-preview-1200x630.png";

/** Setup sharing urls **/

Expand Down

0 comments on commit e7dae43

Please sign in to comment.