JavaScript
//change to show or hide tile numbers
var displayTile = true;
//which tiles are walkable???
var walkableTiles = [0];
//size of tiles
var tileW = 64;
var tileH = 64;
//size of sprites
var manW = 48; //less than tileW
var manH = 48; //less than tileH
//speed of man
var spd = 6;
//bullet variables
var bulletSpeed = 10;
var bulletColor = "red";
//baddie homing distance
var baddieDistance = 10;
//change to your images vvvv
var manImage = "https://s15.postimg.org/wa9fkddyj/guyman.png";
var baddieImage = "http://s28.postimg.org/bsi7njvdp/level_sprite.png";
var tileSheet = "https://s14.postimg.org/ilwdjf9ip/tile_sheet.png";
var bgImage = "http://s28.postimg.org/66hjuw9lp/mm_bg.png";
var splatImage = "http://s32.postimg.org/3l9ir67up/splat.png";
//images for guns
var shotgunImage = "https://cdn3-1.cdn.schoology.com/system/files/imagecache/lightbox_preview/attachments/files/m/201605/group/565915397/smith_and_wesson_shotgun_572d00c646f98.jpeg";
var pistolImage = "http://s32.postimg.org/f4qafl4b5/pistol.png";
// ammo, damage, rof, image
var gunsInGame = [];
shotgun = new Gun(7, 10, 1.5, shotgunImage);
//xTile, yTile, ammo, damage, rof, image
///////////////////////
//keys
//////////////////////
var left = 37; //left arrow
var right = 39; //right arrow
var up = 38; //up arrow
var down = 40; //down arrow
var fire = 32; //space
var reload = 82; //r
var drop = 69; //e
/****************
change for your own maps
****************/
var map1 = [
[1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,1,1,1],
[1,1,1,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1]
];
var map2 = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...