When you ask a question, don’t forget to include a link to the exercise or project you’re dealing with!
If you want to have the best chances of getting a useful answer quickly, make sure you follow our guidelines about how to ask a good question. That way you’ll be helping everyone – helping people to answer your question and helping others who are stuck to find the question and answer!
I was going through the project when I gut stuck on question 10
Now we have a function, onBurrowHit()
, that we can use to execute when the user hits a key. In update()
, there are three conditions set up for you that will identify when the user hits one of the keys:
if (Phaser.Input.Keyboard.JustDown(gameState.jKey)) { } else if (Phaser.Input.Keyboard.JustDown(gameState.kKey)) { } else if (Phaser.Input.Keyboard.JustDown(gameState.lKey)) { }
Inside each condition, call the onBurrowHit()
function with the corresponding 'j'
, 'k'
, or 'l'
key that the user hit.
I dont get what this means, heres why. This is the hint:
If you want to check your work, inside onBurrowHit()
, add a call to console.log()
and pass in the key
parameter. You should be able to hit the J, K, or L key, and see the corresponding key log out in the console.
If you’ve never used the browser JavaScript console before, this guide from Google is a good guide to opening it and seeing logged values.
Feel free to remove the console.log()
call when you’re ready to move on.
So I did the task and its fien, but the key wont ‘log’ in the game.
what do they mean by when you should be able to see the corresponding key log out in the console?
I clicked the keys and it does not work, what am I supposed to do to, or is it already correct?
heres a github of the part in at