ZShooter - Roy vers.
tiles with baddie adder from map
by Starsavior
HTML
<canvas id="myCanvas" width="700" height="500" style="border:1px solid #000000;"></canvas>
<p id="t">
</p>
JavaScript
function init() {
//initalize the game variable as a Game object VVVV
game = new Game();
//call other game methods here for customization
}
//change to show or hide tile numbers
var displayTile = true;
//which tiles are walkable???
var walkableTiles = [-8, -7, -6, 0, 6, 7, 8];
//size of tiles
var tileW = 64;
var tileH = 64;
//size of sprites
var playerW = 48; //less than tileW
var playerH = 48; //less than tileH
//speed of player
var spd = 8;
//bullet variables
var bulletSpeed = 10;
var bulletColor = "black";
//baddie homing distance
var baddieDistance = 10;
var winMessage = "Player is the winner!";
var loseMessage = "player is dead!";
//change to your images vvvv
var playerImage = "https://i.postimg.cc/G3xs3KcZ/Roy.png";
var baddieImage = "https://i.postimg.cc/rmWf3J6V/zombie.png";
var tileSheet = "https://i.postimg.cc/nrJR4k5y/Tiles.png";
var bgImage = "http://s28.postimg.cc/66hjuw9lp/mm_bg.png";
var splatImage = "http://s32.postimg.cc/3l9ir67up/splat.png";
var goalImage = "";
//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.cc/f4qafl4b5/pistol.png";
var swordImage = "https://s14.postimg.cc/vgzpyxvf5/sword.png";
//var bownarrowImage = "";
var submachinegunImage = "https://i.postimg.cc/y6k5XFpb/Dank-MP-40.png";
var sledgehammerImage = "https://i.postimg.cc/903jt1m7/RDank-Sledge-Hammer.png";
var baseballbatImage = "https://i.postimg.cc/RZpyLGGZ/RDank-Baseball-Bat.png";
var swordImage2 = "https://i.postimg.cc/c1YJwPdX/Rdank-sword-V2.png";
var pipeImage = "https://i.postimg.cc/dV3S3rvP/RDank-pipe-V2.png";
var cleaverImage = "https://i.postimg.cc/TYYtNgKL/Rdank-cleaver.png";
var MusketImage = "https://i.postimg.cc/k5N9YSL9/Musket.png";
var FlameThrowerImage = "https://i.postimg.cc/yYkyBy11/War-Machine.png";
// ammo, damage, rof, image
var gunsInGame = [];
shotgun = new...