Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by drhayes

I wanted the player to be able to do combos in my RPGish game thing, so I wrote a combo manager. The instructions are in the readme, but briefly:

// in ig.game.init...
this.comboManager = new ComboManager();
var konami = ['up', 'up', 'down', 'down', 'left', 'right', 'left', 'right', 'b', 'a'];
var seconds = 2;
comboManager.add(konami, seconds, function() { console.log('You did it!'); });

// later, in ig.game.update...
this.comboManager.update();

Tada! As always, happy to help and take suggestions via pull requests or messages or whatever.

It currently only works with keypresses, so you can't do anything like "hold down arrow then press left twice". I'm not super worried about this limitation for my game but if you need it to do this I'm sure we could figure it out.

1 decade ago by taddeimania

Another great plugin from drhayes. I will be using this in my march 1gam!

1 decade ago by drhayes

Thanks!

The way I see it, the easier it is to make games the more and better games we'll have. So, really, I have an ulterior motive. ( ;

1 decade ago by taddeimania

For sure! Even if a plugin isn't being used for it's intended use. My case is i'm requiring people to press certain keys before they can advance to the next stage... like a typing tutor - will be super easy to just load in the combo to advance and listen for it.

1 decade ago by Ash_Blue

Cool idea, needed something more like a fighting game's combo system though. This article helped tremendously.

http://www.idevgames.com/forums/thread-7036.html
Page 1 of 1
« first « previous next › last »