object library zombies as tile game

tiles with baddie adder from map

by soggydoughnut54

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 = [0, 5, 4, 2];
//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 = "http://s27.postimg.cc/ny55wdhj7/level_game_sprite.png";
var baddieImage = "http://s28.postimg.cc/bsi7njvdp/level_sprite.png";
var tileSheet = "https://i.postimg.cc/fWBcxg5v/zombie-shooter-tiles.png";
var bgImage = "http://s28.postimg.cc/66hjuw9lp/mm_bg.png";
var splatImage = "http://s32.postimg.cc/3l9ir67up/splat.png";
var goalImage = "https://i.postimg.cc/44Db9yWC/Portal-Sprite-Zomb-Shooter.png";
//https://i.postimg.cc/XqH3Gt0x/spash-screen-zombie.png
//"http://s28.postimg.cc/66hjuw9lp/mm_bg.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 = "https://asset-cdn.schoology.com/system/files/imagecache/lightbox_preview/attachments/files/m/201812/2700/270001396/SMG_2_5c0feea4835ee.png";
var swordImage = "https://i.postimg.cc/8czR1fH9/fruit-ninja-sword.png";
// ammo, damage, rof, image
var gunsInGame = [];
shotgun = new Gun(14, 7, 1.5, shotgunImage);
//xTile, yTile, ammo, damage, rof, image
pistol = new Gun(17, 14, 10, pistolImage);
///////////////////////
sword = new Gun(0, 5, 1, swordImage);
//keys
//////////////////////
var left = 65; //left arrow
var right = 68; //right arrow
var up = 87; //w
var down = 83; //s
var fire...