UNPKG

agentscript

Version:

AgentScript Model in Model/View architecture

29 lines (22 loc) 768 B
import Shapes from '/src/Shapes.js' // add an image and emoji shapes const shapes = new Shapes() await shapes.imagePathPromise('twitter', '/models/data/twitter.png') export default function TwoDrawOptions(div, model, patchSize = 20) { shapes.createEmojiPath('tree', 0x1f332) function turtleName(t) { return shapes.nameAtIndex(t.id) } const drawOptions = { turtlesShape: t => turtleName(t), turtlesSize: t => 3, turtlesRotate: t => !['lion', 'smiley', 'tree'].includes(turtleName(t)), } return { div, patchSize, drawOptions } } // shapes.createEmojiPath('lion', 0x1f981) // shapes.createEmojiPath('smiley', 0x1f600) // await shapes.imagePathPromise( // 'redfish', // '/models/data/redfish.png' // )