Circle user interface library targeted for artificial life simulations.
<script src="scripts/circles.js"></script>
$ npm install circles
---
> var circles = require('circles');
Creates canvas element and required styles. The element resizes automatically on window resize.
var world = circles.createWorld()
Position and radius in pixels. Color can be any canvas fill style, e.g. '#ff0000' or 'red'
var circle = world.createCircle(100, 200, 20, 'red')
Return array of circles inside the specified circle area. Use this for collision detection.
Possible events: 'tap'
Remove event handler.
Move circle to the specified direction. Angle in radians.
Move circle toward the specified point.
Possible events: 'tap'
Remove event handler.
Run tests with $ npm test
.
Build with $ npm run build
.
Serve with $ npm start
. Then see localhost:8000.
- tests