/***********************
Adjust game variables to make it work
************************/
//change if you make a zelda style
var overhead = false;
//change to show or hide tile numbers
var displayTile = true;
//do you want to shoot bullets?
var bulletsInGame = true; //change to shoot bullets
//jumpstomp?
var jumpstomp = false;
//size of tiles
var tileW = 64;
var tileH = 64;
//size of sprites
var playerW = 50; //less than tileW
var playerH = 50; //less than tileH
//control jumping and falling
var gravity = 0.5;
var jumpstart = -14;
//bullets
var bulletSpeed = 10;
var bulletSize = 10;
var bulletColor = "red";
//baddie AI homing range in tiles
var baddieHomingRange = 10;
//change to your images vvvv
var playerImage = "https://i.postimg.cc/5NKsrPS9/alien-adventure.png";
var baddieImage = "https://i.postimg.cc/gJyMBmN1/baddie-sprite-copy.png";
var tileImage = "https://i.postimg.cc/SQDdXZ5L/tile.png";
var bgImage = "https://i.postimg.cc/SKCVJmFj/backround-adventure-game.png";
//////////////////////
//key controls
//////////////////////
var left = 37; //left arrow
var up = 38; //up arrow
var right = 39; //right arrow
var down = 40; //down arrow
var fire = 32; //space bar
//messages
var winMessage = "Player is Winner";
var loseMessage = "Player is Dead";
//set initial value for level
var level = 1;
/****************
change for your own maps
****************/
var map1 =...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.