Skip to content

pstrinkle/jquery-box-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jquery-box-game

jQuery plugin that provides a simple box drawing puzzle game.

Requires pstrinkle/jquery-paintbox

Plans

See issues.

Usage

<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>

Options

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

Methods

There are a few methods to programmatically change the painting.

Method Param Type Description
start Start the game!

Events

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

License

Apache License 2.0

About

jQuery plugin that provides a simple box drawing puzzle game.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published