Harshit Juneja Posted January 9, 2016 Share Posted January 9, 2016 // Constantly getting the above mentioned error. Here is my update function. Can I use the add method inside update function ? Is this why I am getting the error ? function update(){ if(game.physics.arcade.collide(idie,frame)){ hit++; fno = Math.floor((Math.random() * 6)); storeFnoOnHit[hit-1]=fno; idie.animations.add('touch_bounds',[fno],10,true,true); idie.animations.play('touch_bounds',10,false); } else{ if(hit=0){ noHitTillHit++; fno = Math.floor((Math.random() * 6)); noTouchFrame[noHitTillHit-1]=fno; var temp = noTouchFrame[0]; idie.animations.add('b4_touch_bounds',[temp],10,true,true); idie.animations.play('b4_touch_bounds',10,false); } else{ var temp1 = storeFnoOnHit[hit-1]; idie.animations.add('no_touch_bounds',[temp1],10,true,true); idie.animations.play('no_touch_bounds',10,false); } } updateTimer(); } Link to comment Share on other sites More sharing options...
Recommended Posts