: In your start() or main() function, call drawGhost at different positions to fill your canvas. Why This Matters
class Ghost: def (self, canvas, x, y, color): self.canvas = canvas self.x = x self.y = y self.color = color self.ghost_id = canvas.create_oval(x, y, x+40, y+50, fill=color) canvas.create_oval(x+10, y+15, x+18, y+25, fill='white') canvas.create_oval(x+22, y+15, x+30, y+25, fill='white')
Remember: every programmer has faced a stubborn "ghost" in their code. The cure is methodical debugging, not a quick Google copy-paste. Happy coding—and don’t let the ghosts scare you! 7.1.1 ghost codehs
: Inside this function, call sub-functions like drawBody() and drawEyes() .
: Establish the heights, widths, and offsets for every part of the ghost. : In your start() or main() function, call
If you can share or which part you're stuck on, I can give you a precise solution.
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); Happy coding—and don’t let the ghosts scare you
from graphics import Canvas # Common in CodeHS Python graphics
: In your start() or main() function, call drawGhost at different positions to fill your canvas. Why This Matters
class Ghost: def (self, canvas, x, y, color): self.canvas = canvas self.x = x self.y = y self.color = color self.ghost_id = canvas.create_oval(x, y, x+40, y+50, fill=color) canvas.create_oval(x+10, y+15, x+18, y+25, fill='white') canvas.create_oval(x+22, y+15, x+30, y+25, fill='white')
Remember: every programmer has faced a stubborn "ghost" in their code. The cure is methodical debugging, not a quick Google copy-paste. Happy coding—and don’t let the ghosts scare you!
: Inside this function, call sub-functions like drawBody() and drawEyes() .
: Establish the heights, widths, and offsets for every part of the ghost.
If you can share or which part you're stuck on, I can give you a precise solution.
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);
from graphics import Canvas # Common in CodeHS Python graphics