Final Tiles Game
final--add your elements
by Kyle Bezio
HTML
<canvas id="myCanvas" width="500" height="500" style="border:1px solid #000000;"></canvas>
JavaScript
/***********************
Adjust game variables to make it work
************************/
//change if you make a zelda style
var overhead = true;
//change to show or hide tile numbers
var displayTile = true;
//do you want to shoot bullets?
var bulletsInGame = false; //change to shoot bullets
//jumpstomp?
var jumpstomp = false;
//size of tiles
var tileW = 64;
var tileH = 64;
//size of sprites
var manW = 48; //less than tileW
var manH = 48; //less than tileH
//control jumping and falling
var gravity = 0.6;
var jumpstart = -14;
//bullets
var bulletSpeed = 10;
var bulletSize = 10;
var bulletColor = "red";
//change to your images vvvv
var manImage = "https://s12.postimg.org/swzhqoq25/Adventure_Game_Sprite.png";
var baddieImage = "https://s16.postimg.org/dd4gpioed/Baddie_Sprite_Robot.png";
var tileImage = "http://s25.postimg.org/ml4w7u4t7/mario_07.png";
var bgImage = "http://s28.postimg.org/66hjuw9lp/mm_bg.png";
/* Images List
https://s12.postimg.org/swzhqoq25/Adventure_Game_Sprite.png
https://s16.postimg.org/dd4gpioed/Baddie_Sprite_Robot.png
https://s21.postimg.org/3leinmfpj/Cobble_Stone_Wall_Tile.jpg
https://s14.postimg.org/nwzh37z0x/Cobble_Stone_Wall_Round_Tile.png
https://s22.postimg.org/ou2mq3t81/Cobble_Stone_Wall_Tile.png //Round and Hi-Def
*/
//////////////////////
//key controls
//////////////////////
var left = 37;
var up = 38;
var right = 39;
var down = 40;
var fire = 32;
/****************
change for your own maps
****************/
var map1 = [
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1],
[1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1],
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1],
[1, 1, 1, 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,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
...