CHANNELS:

All
f
frakeit posted 2 years ago
chris posted 2 years ago

I believe you'll want to clear your canvas before each sprite draw with:

c.clearRect(0, 0, canvas.width, canvas.height)

This'll give you a clean slate to draw on for each frame of your animation loop, effectively resolving the "stacking" issue you were mentioning.

Let me know if that works (thanks for the video by the way, makes it super helpful for debugging).

0
f
frakeit posted 2 years ago

Sorry for late response,

That's works! The main thing is we need to place the c.clearRect() or we can use c.fillRect() in the looping.

Thanks for the help.

0

Want to participate?

Create a free Chris Courses account to begin

or
Sign In

Providing the lift to launch your development career

© 2024 Chris Courses. All rights reserved.