1 decade ago by Manuel
Hi, i'm making a game jiji, and i just want to know how to make a countdown like fighting games like mortal kombat, street fighter.
Thanks
Thanks
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
ig.module( 'game.entities.countdown' ) .requires( 'impact.entity' ) .defines(function(){ EntityCountdown = ig.Entity.extend({ size: {x:48, y:48}, collides: ig.Entity.COLLIDES.NONE, animSheet: new ig.AnimationSheet( 'media/coutdown.png', 48, 48 ), gravityFactor: 0, init: function( x, y, settings ) { this.parent( x, y, settings ); this.addAnim( '3', 1, [1] ); this.addAnim( '2', 1, [2] ); this.addAnim( '1', 1, [3] ); this.addAnim( 'Fight', 1, [4] ); this.countdown = new ig.Timer(4); }, update: function() { this.currentAnim = this.anims[Math.ceil(Math.abs(this.countdown.delta()))]; this.parent(); } }); });