Contenido del Curso
Ninja Game
Ninja Game
Introduction to JavaScript and Ninja Game
What is Ninja Game ?
Welcome to the exciting world of the Ninja Game! This game is a fun and interactive way to learn programming concepts using JavaScript. In this game, you will control a ninja character who moves around a grid, picking up and placing sushi. Your task is to guide the ninja using JavaScript code to complete various challenges.
To get started, let's explore the basic controls of the ninja. You can move the ninja in four directions: right, left, up, and down. The methods to control these movements are goRight()
, goLeft()
, goUp()
, and goDown()
. Additionally, the ninja can interact with sushi on the grid. You can use pickSushi()
to pick up sushi and add it to the ninja's inventory, and putSushi()
to place sushi from the inventory onto the grid.
Now, let's see an example of how you can guide the ninja using these methods. In the following code, the ninja moves down three times and picks up a piece of sushi:
ninja.js
index.html
preset.js
Now, try it yourself.
Swipe to show code editor
Goal: Collect all sushi.
Write code in the code editor to move the ninja around the map and interact with sushi. Run the code and watch ninja follow your instructions. You can view starter map below task or run code in the editor to see the map.
Use the movement methods (goRight()
) and the sushi interaction methods (pickSushi()
) to complete the task.
Solución
Starter Map
¡Gracias por tus comentarios!
ninja.js
index.html
preset.js
Introduction to JavaScript and Ninja Game
What is Ninja Game ?
Welcome to the exciting world of the Ninja Game! This game is a fun and interactive way to learn programming concepts using JavaScript. In this game, you will control a ninja character who moves around a grid, picking up and placing sushi. Your task is to guide the ninja using JavaScript code to complete various challenges.
To get started, let's explore the basic controls of the ninja. You can move the ninja in four directions: right, left, up, and down. The methods to control these movements are goRight()
, goLeft()
, goUp()
, and goDown()
. Additionally, the ninja can interact with sushi on the grid. You can use pickSushi()
to pick up sushi and add it to the ninja's inventory, and putSushi()
to place sushi from the inventory onto the grid.
Now, let's see an example of how you can guide the ninja using these methods. In the following code, the ninja moves down three times and picks up a piece of sushi:
ninja.js
index.html
preset.js
Now, try it yourself.
Swipe to show code editor
Goal: Collect all sushi.
Write code in the code editor to move the ninja around the map and interact with sushi. Run the code and watch ninja follow your instructions. You can view starter map below task or run code in the editor to see the map.
Use the movement methods (goRight()
) and the sushi interaction methods (pickSushi()
) to complete the task.
Solución
Starter Map
¡Gracias por tus comentarios!