Phaser.js - FastFoodie project

Hello,
I’m having an issue understanding what step 13 on the Fast Foodie project in the pro course phaser.js is telling me what to do it would be very helpful if someone explained.
It says:
After setting gameState.customerIsReady to false , derive a new property called gameState.currentCustomer from the array gameState.customers.children.entries . The correct element will be at the index of gameState.customersServedCount .

Thank you.

It is asking you to select gameState.customersServedCount as the index in the array you are searching through. gameState.currentCustomer = gameState.customers.children.entries[gameState.customersServedCount];
See how gameState.customersServedCount is inside the brackets. We are selecting it as the index we are looking for.

1 Like

Thank you for helping me,
I was also wondering if you could explain what it is telling me to do in the next step

Now that all the building blocks are complete, you can make the next customer move to the front of the line! Do so by creating a tween and making gameState.currentCustomer the target.

  • The tween should have a 1-second duration .
  • There should be a delay of 100 milliseconds.
  • The customer should face the chef at an angle of 90 (degrees).
  • The customer should tween horizontally to gameState.player.x (they’ll face each other).
  • Set the ease style to 'Power2' .

You should now see your first customer move down the line and turn to the server.

Those should be properties of the tween object. So user phasers syntax for making a tween and use these properties and values as your tween’s props and vals.

Thank you, but I didn’t understand what to type when it tells me

  • The customer should face the chef at an angle of 90 (degrees).
  • There should be a delay of 100 milliseconds.
    The customer should tween horizontally to gameState.player.x (they’ll face each other)