// global varibels
// player movement vars
var s;
var dir;
var scl = 20;
// platforms
var b1x = 230
var b1y = 400
var b1width = 200
var b1height = 40
function setup() {
createCanvas(800, 600);
s = new snake()
}
function draw() {
s.update()
s.show()
//
}
function keyPressed () {
if (keyCode === UP_ARROW) {
s.dir (0,-1)
}else if (keyCode === RIGHT_ARROW) {
s.dir (1,0)
}else if (keyCode === LEFT_ARROW) {
s.dir (-1,0)
}
}
function snake() { //including game stages
this.x = 800