Skip to content

tyroneneill/konami-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

konami-manager.js

JavaScript konami manager

alt tag

Usage

<script src="konami-manager.js"></script>
<script>

   /**
     * Attach Konami { ← ← a }
     */
    konamiManager.add(attackFireball, [Keyboard.LEFT, Keyboard.LEFT, Keyboard.A]);

    /**
     * Attach Konami { → → a }
     */
    konamiManager.add(attackIceball, [Keyboard.RIGHT, Keyboard.RIGHT, Keyboard.A]);

    /**
     * Attack Fireball callback handler
     */
    function attackFireball() {
        console.log('Fireball attack');
    }

    /**
     * Attack Iceball callback handler
     */
    function attackIceball() {
        console.log('Iceball attack');
    }

</script>

About

Left, Left, Right, Right, Down, High-Punch, Fire-ball!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published