agentscript
Version:
AgentScript Model in Model/View architecture
31 lines (25 loc) • 789 B
HTML
<html>
<head>
<title>Template</title>
</head>
<body>
<script type="module">
import Animator from '/src/Animator.js'
import TwoDraw from '/src/TwoDraw.js'
import Model from '/models/TemplateModel.js'
import TwoDrawOptions from './templateOptions.js'
const model = new Model()
model.setup()
const view = new TwoDraw(model, TwoDrawOptions('modelDiv', model))
const anim = new Animator(
() => {
model.step()
view.draw()
},
500, // run for 500 steps
30 // at 30 steps/second
)
</script>
<div id="modelDiv"></div>
</body>
</html>