src/scripts/modules/gameutils.js
/**
   * this stops the game and returns the index of hit area; use click() instead !
   */
this stops the game and returns the index of hit area; use click() instead !
this stops the game and returns the index of hit area ; use click () instead !
function stop() {
    var computedStyle = window.getComputedStyle(data.bargraph);
    var left = computedStyle.getPropertyValue('left');
    data.bargraph.style.left=left;
    data.bargraph.style.transition = null; 
    var total = window.getComputedStyle(data.bargraph.parentNode).getPropertyValue('width');
    left =parseFloat(left.split('px')),total=parseFloat(total.split('px'));
    left = 100*left/total+data.barsize/2;
    var res =-1; 
    for(var i=data.areas.length-1; i>=0;i--) {
      if(data.areas[i].a<=left && left<=data.areas[i].b) res=i; 
    }
    data.run=false;
    return(res);
  }
function stop ( ) { var computedStyle = window . getComputedStyle ( data . bargraph ) ; var left = computedStyle . getPropertyValue ( 'left' ) ; data . bargraph . style . left = left ; data . bargraph . style . transition = null ; var total = window . getComputedStyle ( data . bargraph . parentNode ) . getPropertyValue ( 'width' ) ; left = parseFloat ( left . split ( 'px' ) ) , total = parseFloat ( total . split ( 'px' ) ) ; left = 100 * left / total + data . barsize / 2 ; var res = - 1 ; for ( var i = data . areas . length - 1 ; i >= 0 ; i -- ) { if ( data . areas [ i ] . a <= left && left <= data . areas [ i ] . b ) res = i ; } data . run = false ; return ( res ) ; }
this stops the game and returns the index of hit area; use click() instead !
this stops the game and returns the index of hit area ; use click () instead !
// disable transition AFTER fetching computed value ! //detect if area was hit or not