私はthis html5 JavaScriptプラットフォームのチュートリアルを見つけました。私は単純な色からイメージに "プレーヤー"を変更しようとしています。ctx.fillStyleに画像を追加
私が編集しようとしているコードは、この部分です。
player.x += player.velX;
player.y += player.velY;
ctx.fill();
ctx.fillStyle = "green";
ctx.fillRect(player.x, player.y, player.width, player.height);
requestAnimationFrame(update);
はこれを試してみて、参照してくださいhttps://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_canvas_createpattern –
ますおそらく[drawImage](https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/drawImage)を使用したいと考えています –