Help with Mole Unearther Tasks 10-15

This is the project:

I am stuck on tasks 10-15 and I have no idea what is incorrect. Currently, I am trying to figure out how to make the keys register and do something to the game. My code:

update() {

    if (timeLeft <= 0) {

      const onBurrowHit=key=>{

        if (Phaser.Input.Keyboard.JustDown(gameState.jKey)) {


} else if (Phaser.Input.Keyboard.JustDown(gameState.kKey)) {


} else if (Phaser.Input.Keyboard.JustDown(gameState.lKey)) {




      if (onBurrowHit(j,k,l)) {



      } else {



Please tell me what is wrong with my code. I would greatly appreciate it. Thanks in advance.


Can you try re-pasting your code pressing the </> button before pasting so that it formats properly?

At this point, even without looking at the code, I would put a simple statement check for the key presses eg: console.log('x key was pressed'). Then when you’re running your file, you check the console directly and see if it’s coming out. If not, always remember you can interact with the console “live” and debug accordingly from there.

Okay I will re-post it. But how do I check live console?
Only question

Right or control click on the browser, click inspect element, look for the console tab. You may need to resize it so that it’s more comfortable to use. I personally like to have projects away from the CC environment when debugging so I don’t get any extraneous messages from CC, so there’s that too.

Yeah I don’t see anything. When I press j, k, l, nothing happens in the console

Then you have to debug your key event handlers. MDN is a good resource, I don’t know what methods you’re using, so you should look them up more specifically if these linked ones don’t help.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.