Skip to content

Instantly share code, notes, and snippets.

@LessWig
LessWig / spaceblock.js
Created January 26, 2016 02:42
Space Block code
var canvasBg = document.getElementById("canvasBg"),
ctxBg = canvasBg.getContext("2d"),
canvasEntities = document.getElementById("canvasEntities"),
ctxEntities = canvasEntities.getContext("2d"),
canvasWidth = canvasBg.width,
canvasHeight = canvasBg.height,
background = new Background(0, 0),
spaceship = new Spaceship(0, canvasHeight/2),
alienShip = new AlienShip(100, 0),
alienShip2 = new AlienShip(300, 500),