player = {
x: 0,
y: 0,
speed: Math.floor(units/8),
velX: 0.02,
velY: 0,
},
friction = units/42.5,
gravity = player.speed/13.4,
Jumping:
player.velY = -player.speed * 2;
Movement:
player.velX+= units/8;
friction and gravity are then subtracted from the velX and velY properties, which are then added to the players x and y position