How to move an object using X and Y coordinates in JavaScript
- by Geroy290
I am making a 2d game with JavaScript and HTML5 and am trying to move an image that I have drawn with JavaScript like so:
//canvas
var c = document.getElementById("gameCanvas");
var ctx = c.getContext("2d");
//baseball
var baseball = new Image();
baseball.onload = function() {
ctx.drawImage(baseball, 400, 425);
…