Closed OHammerpaw closed 2 years ago
I have remedied the problem of getting clues to appear in the appropriate div boxes when mousedown event happens. Still stuck on how to get my images to disappear from canvas though.
Hey Lauren, good work ! I think we should consider using the ctx.clearRect to clear the game board and redraw everything that you still need on it - maybe inelegant but should work as intended. https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/clearRect
Ok, I'll try that! It may be tricky to get it to work properly with a background image, but I'll try to figure it out- thank you!
if you have a game loop, you can put the clear at the top of it, and then render everything each game tick, which allows us to handle multiple things moving at the same time
I currently don't have a game loop yet but Ill create one
I've got it thank you!
What's the problem you're trying to solve?
I am trying to move or hide the clues when they are clicked
Post any code you think might be relevant (one fenced block per file)
If you see an error message, post it here. If you don't, what unexpected behavior are you seeing?
No error message, I am just having trouble finding a way to accomplish this effect
What is your best guess as to the source of the problem?
I think I may have coded myself into a bit of a corner. I started with making a clue class that included the render(), but I had to use drawImage to have my images appear and it made the class kind of moot. However, now that i don't have a function class with the render() baked in, I am having trouble getting the clues to disappear onmousedown.
What things have you already tried to solve the problem?
I have tried going back and recreating the class, but I run into the same problem I had before where it doesn't work smoothly with the pictures.
Paste a link to your repository here[
](https://github.com/OHammerpaw/The-Mothman)