Welcome to Bot Draw!(aka Project Dark Bat)
In Bot Draw, you command a small bot who can travel in 3D space. The robot can place boxes, spheres, images, and other 3D shapes. This tool borrows ideas from popular code education tools like Logo, code.org, ScriptCraft by Walter Higgins.
You can review a sample scene here: https://dark-bat.glitch.me/
You can use the keys WASD to move around the scene.
You can edit and study the code here: https://glitch.com/edit/#!/dark-bat
If you make something cool, please let us know!
Hope you find this fun and helpful!
- public/demo.js – This file provides other demo functions using bot draw.
- public/bot_aframe – Interested in enhancing the “Bot” code? This is the file for you!
Bot Draw methods
In order to draw, you start by creating an instance of the bot. The bot object has additional methods for drawing, turning, or moving.
Moving and turning:
- moveUp(steps) – Move the bot upward a few steps
- forward(steps) – Move bot forward a few steps
- moveLeft(steps) – Move bot left
- moveRight(steps) – Move bot right
- setAngle(degrees) – Set angle of direction for the robot. Enter direction in degrees
- getAngle() – Get current angle for the robot.
- turn(angle) – Turn the robot a few degrees.
- drawBoxAt(width,height,depth,x,y,z) – Draw box at a particular location.
- drawBox(width,height,depth) – Draw box at current robot location.
- drawSphere(radius) – Draw sphere at current robot location.
- drawSphereAt(radius,x,y,z) – Draw sphere at particular location
- drawImageAt(strPath,width, height, x,y,z) – Draw image at particular location. The path should be a fully qualified path to a valid web image.
- drawImage(strPath,width,height) – Draw image at bot location. The path should be a fully qualified path to a valid web image.
Remember locations, Return to locations
- saveLocation(locationName) – Store bot location and give it a name.
- moveToLocation(locationName) – Return to location by name
bot.drawColor = “red”