<commit_before>var w = 70;
var h = 25;
var display = new ROT.Display({spacing:1.4, width: w, height: h});
var map ={};
var actors = {};
var mousedown = false;

function init(){
  var gameArea = document.getElementById("GameArea");
  gameArea.appendChild(display.getContainer());
  initMap(map);

  gameArea.addEventListener("mousedown",function(e){
    mousedown = true;
    mouseUsed(display.eventToPosition(e));
  });
  gameArea.addEventListener("mouseup",function(){
    mousedown = false;
  });

  gameArea.addEventListener("mousemove",function (e){
    if(mousedown){
      mouseUsed(display.eventToPosition(e));
    }
  });
}

function mouseUsed(clickCoOrd){
  var mouseType = document.getElementById("tileType").Tile.value;
  if(mouseType !== 'selector'){
    map[clickCoOrd[0]+","+clickCoOrd[1]] = mouseType;
    display.draw(clickCoOrd[0],clickCoOrd[1],mouseType);
  }

  document.getElementById('SelectedCoOrd').innerHTML = "Selected: "+ clickCoOrd[0] + "," + clickCoOrd[1];
}

function initMap(map){
  for(r = 0; r < w; r++){
    for(b = 0; b < h; b++){
      map[r+","+b] = '.';
      display.draw(r,b,'.');
    }
  }
}<commit_msg>Can now delete game objects.<commit_after>var w = 70;
var h = 25;
var display = new ROT.Display({spacing:1.4, width: w, height: h});
var map ={};
var actors = {};
var mousedown = false;
var selected;

function init(){
  var gameArea = document.getElementById("GameArea");
  gameArea.appendChild(display.getContainer());
  initMap(map);

  gameArea.addEventListener("mousedown",function(e){
    mousedown = true;
    mouseUsed(display.eventToPosition(e));
  });
  gameArea.addEventListener("mouseup",function(){
    mousedown = false;
  });

  gameArea.addEventListener("mousemove",function (e){
    if(mousedown){
      mouseUsed(display.eventToPosition(e));
    }
  });
}

function mouseUsed(clickCoOrd){
  var mouseType = document.getElementById("tileType").Tile.value;
  if(mouseType !== 'selector'){
    map[clickCoOrd[0]+","+clickCoOrd[1]] = mouseType;
    display.draw(clickCoOrd[0],clickCoOrd[1],mouseType);
  }
  var found = false;

  for(var dude in actors){
      if(actors[dude].x === clickCoOrd[0] && actors[dude].y === clickCoOrd[1]){
          document.getElementById('SelectedCoOrd').innerHTML = "Selected: "+dude +" <a href=javascript:smite('"+dude+"')>Delete?</a>";
          selected = dude;
          found = true;
      };
  };
  if(!found){
    document.getElementById('SelectedCoOrd').innerHTML = "Selected: "+ clickCoOrd[0] + "," + clickCoOrd[1];
    selected = null;
  }
}
function smite(object){
  display.draw(actors[object].x,actors[object].y,'.');
  delete actors[object];
}
function initMap(map){
  for(r = 0; r < w; r++){
    for(b = 0; b < h; b++){
      map[r+","+b] = '.';
      display.draw(r,b,'.');
    }
  }
}
{'fraction_non_alphanumeric': 0.1885980638221585, 'fraction_numerical': 0.010756543564001434, 'mean_word_length': 4.195530726256983, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1006387', 'n_tokens_mistral': 975, 'n_tokens_neox': 943, 'n_words': 168}