“Mahjong solitaire” Documentation by “sney2002” v1.0


“Mahjong solitaire”

Thank you for purchasing my game. If you have any questions, please feel free to contact me here.


Table of Contents

  1. Getting Started
  2. Available options
  3. Creating maps
  4. Creating a tile set
  5. Events
  6. JavaScript
  7. Sources and Credits

Features - top


A) Getting started - top

To install the game just upload the files to the server. you can select one of the four default maps: wall, heart, default or pyramid. or create your own map.

there are also three set of tiles: flowers, letters and symbols.


B) Available options - top

Below is an example with all available options and their defaults values:

C) Creating a tile set - top

To create your own set of tiles follow the measures of the template in templates/photoshop:

I know what you think, I suck at photoshop. Then creates a sprite of 36 tiles, like this:


D) Creating maps - top

You can create your own maps, just remember:

Examples

Right

Wrong


E) Events - top

There are three events you can subscribe:

  1. shuffle: when the user shuffle the tiles.
  2. gameover: game over: when.
  3. finish: when the game is finished, you receive the time needed to complete the game.

To subscribe an event you use the method on.


F) JavaScript - top

This game imports three Javascript files.

  1. canvas-event-js: javascript library that add events to the canvas element.
  2. jquery: used for ajax and events.
  3. mahjong: The mahjong game.

To initialize the app create an instance of game.Mahjong()* after the DOM is ready. you can customise the instance through the options.

*Use jQuery.ready


G) Sources and Credits - top

I've used the following code:


Jhonatan Salguero

Go To Table of Contents