(function (Scratch) { 'use strict'; const birdFacts = [ "Birds are the only animals with feathers.", "All birds lay eggs.", "Hummingbirds can fly backwards.", "Owls can turn their heads up to 270 degrees.", "Birds evolved from dinosaurs.", "Penguins are birds that cannot fly.", "The peregrine falcon is the fastest animal on Earth.", "Some birds migrate thousands of miles.", "Parrots can mimic human speech.", "The ostrich is the largest living bird." ]; const birdSpecies = [ "Bald eagle", "Peregrine falcon", "Barn owl", "Emperor penguin", "Ostrich", "Hummingbird", "Blue jay", "Cardinal", "Mallard duck", "Peacock" ]; class BirdsExtension { getInfo() { return { id: 'birds', name: 'BIRDS', color1: '#4A90E2', color2: '#6BB9F0', blocks: [ { opcode: 'randomFact', blockType: Scratch.BlockType.REPORTER, text: 'random bird fact' }, { opcode: 'areBirdsCool', blockType: Scratch.BlockType.BOOLEAN, text: 'are birds cool?' }, { opcode: 'speciesInfo', blockType: Scratch.BlockType.REPORTER, text: 'bird info for [SPECIES]', arguments: { SPECIES: { type: Scratch.ArgumentType.STRING, defaultValue: 'Bald eagle' } } } ] }; } randomFact() { return birdFacts[Math.floor(Math.random() * birdFacts.length)]; } areBirdsCool() { return true; } speciesInfo(args) { if (!args.SPECIES) { return "Type a bird name."; } return ( args.SPECIES + " is a bird species. (Live web lookups are disabled in PenguinMod.)" ); } } Scratch.extensions.register(new BirdsExtension()); })(Scratch);