jQuery plugin that provides a simple box drawing puzzle game.
Requires pstrinkle/jquery-paintbox
See issues.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="/libs/jquery-paintbox/dist/jquery.paintbox.js"></script>
<script src="/libs/jquery-box-game/dist/jquery.box-game.js"></script>
<div id='container'></div>
<script>
$('#container').boxGame({});
</script>
You should specify options like in usage example above.
Name | Type | Default | Description |
---|---|---|---|
rows | integer | 50 |
Number of rows. |
cols | integer | 50 |
Number of columns. |
offColor | css color string | white |
Background color of the gameboard. |
colors | array of CSS color strings | ['black', 'green', 'lightgreen', 'lightblue', 'blue', 'red'] |
Colors for the blocks |
There are a few methods to programmatically change the painting.
Method | Param | Type | Description |
---|---|---|---|
start |
Start the game! |
Event | Handler |
---|---|
color-change |
function(event, color) : - event - jQuery event - color - next block color |
points-earned |
function(event, points) : - event - jQuery event - points - points earned |