Codehs — 7.1.1 Ghost
function moveGhost() newX < 40) dx = -dx; if (newY > 360 If you can share or which part you're stuck on, I can give you a precise solution.
var eye1 = new Circle(8); eye1.setColor("black"); eye1.setPosition(-20, -10); ghost.add(eye1); 7.1.1 ghost codehs
function start() var ghost = new Circle(40); ghost.setPosition(200, 200); ghost.setColor("white"); add(ghost); var eye1 = new Circle(8); eye1.setPosition(180, 190); eye1.setColor("black"); add(eye1); function moveGhost() newX < 40) dx = -dx;
var eye2 = new Circle(8); eye2.setPosition(220, 190); eye2.setColor("black"); add(eye2); (e.g., blinking eyes, movement, or a mouth): Here’s an example with floating movement : function moveGhost() newX <
var eye2 = new Circle(8); eye2.setColor("black"); eye2.setPosition(20, -10); ghost.add(eye2);
ghost.setPosition(x, y); add(ghost);
function drawGhost(x, y) ghost = new Group();
function moveGhost() newX < 40) dx = -dx; if (newY > 360 If you can share or which part you're stuck on, I can give you a precise solution.
var eye1 = new Circle(8); eye1.setColor("black"); eye1.setPosition(-20, -10); ghost.add(eye1);
function start() var ghost = new Circle(40); ghost.setPosition(200, 200); ghost.setColor("white"); add(ghost); var eye1 = new Circle(8); eye1.setPosition(180, 190); eye1.setColor("black"); add(eye1);
var eye2 = new Circle(8); eye2.setPosition(220, 190); eye2.setColor("black"); add(eye2); (e.g., blinking eyes, movement, or a mouth): Here’s an example with floating movement :
var eye2 = new Circle(8); eye2.setColor("black"); eye2.setPosition(20, -10); ghost.add(eye2);
ghost.setPosition(x, y); add(ghost);
function drawGhost(x, y) ghost = new Group();