This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
for(var i=0;i<14;i++){ for(var j=0;j<14;j++){ var o= ig.game.spawnEntity(EntityLuz,0+i*40,0+j*40); this.luz.push(o); } } for(var n=0;n<this.luz.length;n++){ if(this.distanceTo(this.luz[n])<=this.rangeLuz){ if(this.luz[n].currentAnim.alpha<=1){ this.luz[n].currentAnim.alpha-=.1; } if(this.luz[n].currentAnim.alpha<=0){ this.luz[n].currentAnim.alpha=0; this.luz[n].kill(); } } }
// lib/game/entities/barril.js ig.baked=true;ig.module('game.entities.barril').requires('impact.entity').defines(function(){var o;var ii;var ent=[];var o;var iii;var entpp=[];var iiii;var entshield=[];var pollo;var entpollo=[];EntityBarril=ig.Entity.extend({type:ig.Entity.TYPE.NONE,checkAgainst:ig.Entity.TYPE.A,collides:ig.Entity.COLLIDES.FIXED,offset:{x:0,y:0},size:{x:32,y:32},lobos:[],load:0,zIndex:-99,barril:new ig.Sound('media/sounds/barril.*'),animSheet:new ig.AnimationSheet('media/barril.png',32,32),init:function(x,y,settings){this.parent(x,y,settings);this.addAnim('idle',1,[0]);this.addAnim('abierto',1,[1]);this.currentAnim=this.anims.idle;},update:function(){o=ig.game.getEntitiesByType(EntityHud)[0];this.parent();},check:function(other){this.currentAnim=this.anims.abierto;this.load++;var numero=Math.floor(Math.random()*5);if(this.load==1&&ig.game.maxPC>0&&numero==0){this.barril.play();ii=ig.game.spawnEntity(EntityPocioncura,o.pc[o.gl[o.num]].pos.x,o.pc[o.gl[o.num]].pos.y);o.num++;ent.push(ii);ig.game.maxPC-=1;ig.game.experiencia+=5;} if(this.load==1&&ig.game.maxPP>0&&numero==1){this.barril.play();iii=ig.game.spawnEntity(EntityPocionpoison,o.pp[o.ppgl[o.numpp]].pos.x,o.pp[o.ppgl[o.numpp]].pos.y);o.numpp++;entpp.push(iii);ig.game.maxPP-=1;ig.game.experiencia+=5;} if(this.load==1&&ig.game.maxESCUDO>0&&numero==2){this.barril.play();iiii=ig.game.spawnEntity(EntityShieldicon,o.shieldsel[o.shieldgl[o.numshield]].pos.x,o.shieldsel[o.shieldgl[o.numshield]].pos.y);o.numshield++;entshield.push(iiii);ig.game.maxESCUDO-=1;ig.game.experiencia+=5;} if(this.load==1&&ig.game.maxPOLLO>0&&numero==3){this.barril.play();pollo=ig.game.spawnEntity(EntityPolloicon,o.pollosel[o.pollogl[o.numpollo]].pos.x,o.pollosel[o.pollogl[o.numpollo]].pos.y);o.numpollo++;entpollo.push(pollo);ig.game.maxPOLLO-=1;ig.game.experiencia+=5;}}});EntityPocioncura=ig.Entity.extend({type:ig.Entity.TYPE.B,checkAgainst:ig.Entity.TYPE.NONE,collides:ig.Entity.COLLIDES.PASSIVE,size:{x:60,y:60},bole:false,index:0,zIndex:1000,reload:0,font:new ig.Font('media/impactgreen.png'),bebida:new ig.Sound('media/sounds/bebida.*'),animSheet:new ig.AnimationSheet('media/pocioncura.png',60,60),init:function(x,y,settings){this.parent(x,y,settings);this.addAnim('idle',1,[0]);},update:function(){var p=ig.game.getEntitiesByType(EntityHero)[0];var n=ig.game.getEntitiesByType(EntityCursor)[0];var distance=this.distanceTo(n);if(distance<25&&ig.input.pressed('clic')&&(ig.game.vidaPlayer<100)){o.num--;ent[o.num].kill();ent.splice(o.num,1) game.min.js:387 Uncaught TypeError: Cannot call method 'kill' of undefined (repeated 1680 times)