[고민] 점프 후 물체가 다시 제자리로 오는 방법
const canvas = document.getElementById("canvas"); const ctx = canvas.getContext("2d"); canvas.width = window.innerWidth - 100; canvas.height = window.innerHeight - 100; // 코드를 입력하면 네모(🔲)가 생성이 된다. const dino = { x: 10, y: 200, width: 50, height: 50, draw() { ctx.fillStyle = "green"; ctx.fillRect(this.x, this.y, this.width, this.height); }, }; class Cactus { constructor() { this.x = 500; this.y = ..
2021.09.13