mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
27 lines
691 B
TypeScript
27 lines
691 B
TypeScript
|
|
|
|
var egg = new Egg();
|
|
egg
|
|
.addCode("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}, "konami-code")
|
|
.addHook(function () {
|
|
console.log("Hook called for: " + this.activeEgg.keys);
|
|
console.log(this.activeEgg.metadata);
|
|
})
|
|
.listen();
|
|
|
|
var egg = new Egg("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}).listen();
|
|
|
|
// EGGSAMPLE
|
|
var egg = new Egg();
|
|
egg
|
|
.AddCode("up,up,down,down,left,right,left,right,b,a", function () {
|
|
alert("Konami!");
|
|
}, "konami-code")
|
|
.AddHook(function () {
|
|
console.log("Hook called for: " + this.activeEgg.keys);
|
|
console.log(this.activeEgg.metadata);
|
|
}).Listen(); |