Phaser Js Treasure hunter

Does anyone know the anwsers to the whole entire phaser js treasure hunter project? Ive really been struggling and the answers would really help me with my pathway. Anything helps, thanks

The best way for anyone to help you is if you post your formatted code so people can see what you’ve tried so far, what works and what doesn’t work. Then people can talk you through any confusion or help with debugging code.

Could anyone assist me with this code? When I “run” the game loads; however, when I click a plot, nothing happens. It will not allow me to play.
Code:
https://www.codecademy.com/workspaces/660441f43c68216153beeedb

There might be other issues, but here are a few things you may wish to investigate in GameScene.js:

  • You wrote    let comp;    but I don’t see anywhere in GameScene.js where you are doing something with this variable. So, what is comp supposed to be?

  • You are making use of grid in multiple places in GameScene.js, but you haven’t declared and/or initialized this variable anywhere.

  • In the decideCoinLocations function, you wrote:

if (arr.indexOf(value) === -1) {
    coinCollection.push(selectedPlot);
}

but what is arr? What is value? Both of these variables are non-existent. Did you just copy a hint? Perhaps, arr is supposed to be coinCollection and value is supposed to be selectedPlot?

1 Like

https://www.codecademy.com/workspaces/66046d4458b1a8e62186a57a
Thank you! I fixed those issues. Now, it will allow me to click, but it freezes afterwards.