Deno Sandbox API Test Game

Fresh x Babylon.js x Monaco Editor on Deno Sandbox API

GitHub

Game View

Code Editor

📖 Available Methods

🎮 Movement

  • moveRight()Move player to the right (+X direction)
  • moveLeft()Move player to the left (-X direction)
  • moveUp()Move player upward (+Z direction)
  • moveDown()Move player downward (-Z direction)
  • stay()Stay in the current position

🔍 Obstacle Detection

  • isObstacleRight()Returns true if obstacle is on the right
  • isObstacleLeft()Returns true if obstacle is on the left
  • isObstacleUp()Returns true if obstacle is above
  • isObstacleDown()Returns true if obstacle is below

🛠️ Utility

  • repeat(conditionFn, actionFn)Repeat actionFn while conditionFn returns true (max 10 times)
// Example:
repeat(() => isObstacleRight(), () => moveRight());

⚠️ Important Notes

  • while and for loops are not available in the sandbox.
  • Use the repeat() function instead for iteration.

© 2024 Deno Sandbox API Test by Octo8080X.