DEV Community

Trevor Lawrence
Trevor Lawrence

Posted on

Useless code #1

gui.js// Create GUI
const gui = new GUI();

// Create folder for tools
const toolsFolder = gui.addFolder('Tools');

// Define tool options
const toolOptions = ['None', 'Portal', 'Black Hole', 'Particle', 'Projectile'];

// Add dropdown menu for selecting tools
const toolControl = toolsFolder.add({ tool: 'None' }, 'tool', toolOptions);

// Define callback function for tool selection
toolControl.onChange(function (value) {
selectTool(value);
});

// Open tools folder by default
toolsFolder.open();
``

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.