object library zombies as tile game

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>
d

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 = 30;
var bulletColor = "orange";
//baddie homing distance
var baddieDistance = 10;
var winMessage = "YOU ESCAPED";
var loseMessage = "YOU DIED";
//change to your images vvvv
var playerImage = "https://i.postimg.cc/YCC4wYBs/hero-sprite.png";
var baddieImage = "https://i.postimg.cc/rw6vpKJY/alien-adventure.png";
var tileSheet = "https://i.postimg.cc/tTGWZqw0/zombie-shooter-tiles.png";
var bgImage = "http://s28.postimg.cc/66hjuw9lp/mm_bg.png";
var splatImage = "https://i.postimg.cc/VLHX9CTD/splat-image-dead.png";
var goalImage = "https://i.postimg.cc/44Db9yWC/Portal-Sprite-Zomb-Shooter.png";
//images for guns
var shotgunImage = "https://i.postimg.cc/t479hQjK/shotgun.png";
var pistolImage = "https://i.postimg.cc/7LY5JCYT/ump45.png";
var swordImage = "https://i.postimg.cc/1tDv2tpL/sword-zombie-sprite.png";
// ammo, damage, rof, image
var gunsInGame = [];
shotgun = new Gun(7, 20, 1.5, shotgunImage);
//xTile, yTile, ammo, damage, rof, image
pistol = new Gun(16, 4, 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 = 32; //space
var reload = 32; //space
var drop = 69; //e
var cycle = 81; //q
/****************
change for your own maps
****************/
var map1 =...