Game Instructions

Tap a tile to toggle its color. When a tile changes nearby tiles may change as well. Each move affect multiple tiles. The target is to turn all tiles into yellow in the fewest steps possible.

Press 'j' to show/hide the game. Press 'i' to show/hide the instructions. Press 't' to show/hide the top score table.

Steps: 0

Top Scores

Name Steps
Press J to toggle the game, I to toggle instructions, and T to toggle the top scores

Congratulations!

You solved the puzzle in 0 steps!

Success!

Score submitted successfully!

Error

Failed to submit score. Please try again.

Inheritance using MooTools PRO

When using MooTools, in order to define a class that extends another we should use the Extends key and assign it with the name of the parent class as its value. In order to invoke a method that was overridden we should use this.parent.

<!DOCTYPE html>
<html>
<head>
    <title>mootools functions binding demo</title>
    <script type="text/javascript" src="mootools-core-1.4.5-full-compat.js">
    </script>
    <script type="text/javascript">
        var Person = new Class({
            //properties
            fName: '',
            lName: '',
            id: 0,
            //constructor
            initialize: function(first,last,idVal)
            {
                this.fName = first;
                this.lName = last;
                this.id = idVal;
            },
            //methods
            sleep: function()
            {
                document.write(this.fName + ' is sleeping.' + "<br>");
            },
            talk: function()
            {
                document.write(this.fName + ' is talking.' + "<br>");
            }
        });
        var Student = new Class({
            //inheritance
            Extends:Person,
            //properties
            average:0,
            //constructor
            initialize: function(first,last,idVal,avgVal)
            {
                this.parent(first,last,idVal);
                average = avgVal;
            },
            //methods
            printDetails: function()
            {
                document.write(this.fName+" "+this.lName+" "+this.id+" "+average);
            }
        });
        var std = new Student("moshe","jonas",123123,98);
        std.printDetails();
    </script>
</head>
<body>

</body>
</html>

The following video clip shows the execution of this code sample, overviews it and explains it.

Share:

The Beauty of Code

Coding is Art! Developing Code That Works is Simple. Develop Code with Style is a Challenge!

Update cookies preferences