Conteúdo do Curso
Ninja Game
Ninja Game
Practice. Pick and Move to the Sushi Center of the Box
In this chapter, you'll get tasked with picking up sushi and moving it to a designated spot.
Let's quickly recap the methods you'll be using:
pickSushi()
: This method allows the ninja to pick up sushi from the current cell and add it to the inventory.putSushi()
: This method enables the ninja to place sushi from the inventory onto the current cell.
Here's an example of how you might move a ninja to pick up a sushi and place it in a new location:
ninja.js
index.html
preset.js
Swipe to show code editor
Goal: Collect sushi and place it in the center of the box.
In this exercise, you'll see two maps below task. The first map shows the starting position of the sushi, and the second map indicates where you need to place the sushi.
Use the methods pickSushi()
and putSushi()
to complete the task.
Solução
Starter Map
Goal Map
Obrigado pelo seu feedback!
ninja.js
index.html
preset.js
Practice. Pick and Move to the Sushi Center of the Box
In this chapter, you'll get tasked with picking up sushi and moving it to a designated spot.
Let's quickly recap the methods you'll be using:
pickSushi()
: This method allows the ninja to pick up sushi from the current cell and add it to the inventory.putSushi()
: This method enables the ninja to place sushi from the inventory onto the current cell.
Here's an example of how you might move a ninja to pick up a sushi and place it in a new location:
ninja.js
index.html
preset.js
Swipe to show code editor
Goal: Collect sushi and place it in the center of the box.
In this exercise, you'll see two maps below task. The first map shows the starting position of the sushi, and the second map indicates where you need to place the sushi.
Use the methods pickSushi()
and putSushi()
to complete the task.
Solução
Starter Map
Goal Map
Obrigado pelo seu feedback!