bubble-box-example.js

total 0
used 0
limit 0
/* title: Bubble Box Example categories: minimal velocity files: head point pointlist stroke stage mouse dragging ../point_src/random.js ../point_src/screenwrap.js ../point_src/velocity.js --- The minimal requirements include the _head_, _stage_, and the _point_. */ class MainStage extends Stage { canvas = 'playspace' mounted() { let pin = this.center.copy().update({radius: .1}) this.points = PointList.generate.random(1000, 400, pin) // this.points = PointList.generate.random(300, 400, pin) this.reactor = new VelocityReactor() this.reactor.points = this.points let direction = new Point(-1, 1) this.reactor.randomize() this.points.forEach(p=>{ // speed relative to size. p.xy = random.within(pin, 600) // turn to direction of travel faceVelocity(p) let v = p.radius * 12 let s = 100 - v//(p.velocity.length() * 100) p.color = `hsl(200, ${s}%, ${v}%)` }) // this.screenWrap.setDimensions({ // top: 100 // , left: 100 // , bottom: 500 // , right: 500 // }) // this.dragging.add(this.points) } draw(ctx){ this.clear(ctx) this.reactor.step() // this.points.forEach(p=>this.screenWrap.perform(p)) this.screenWrap.performMany(this.points) // this.points.pen.indicator(ctx) this.points.pen.fill(ctx,) } } stage = MainStage.go(/*{ loop: true }*/)
Run
Meta Data
title Bubble Box Example
imports ()
files ('head', 'point', 'pointlist', 'stroke', 'stage', 'mouse', 'dragging', '../point_src/random.js', '../point_src/screenwrap.js', '../point_src/velocity.js')
unused_keys ()
unknown_keys ('categories',)
categories ['minimal', 'velocity']
filepath_exists True
path bubble-box-example.js
filepath bubble-box-example.js
clean_files ('../point_src/core/head.js', '../point_src/pointpen.js', '../point_src/compass.js', '../point_src/center.js', '../point_src/point-content.js', '../point_src/pointdraw.js', '../point_src/relative-xy.js', '../point_src/pointcast.js', '../point_src/point.js', '../point_src/pointlistdraw.js', '../point_src/pointlistgradient.js', '../point_src/pointlistshape.js', '../point_src/pointlistgenerator.js', '../point_src/unpack.js', '../point_src/pointlist.js', '../point_src/pointlistpen.js', '../point_src/setunset.js', '../point_src/stroke.js', '../point_src/stage-resize.js', '../point_src/functions/resolve.js', '../point_src/stage.js', '../point_src/events.js', '../point_src/automouse.js', '../point_src/functions/clamp.js', '../point_src/distances.js', '../point_src/protractor.js', '../point_src/text/beta.js', '../point_src/dragging.js', '../point_src/random.js', '../point_src/screenwrap.js', '../point_src/velocity.js')
markdown {'html': '<p>The minimal requirements include the <em>head</em>, <em>stage</em>, and the <em>point</em>.</p>', 'content': 'title: Bubble Box Example\ncategories: minimal\n velocity\nfiles:\n head\n point\n pointlist\n stroke\n stage\n mouse\n dragging\n ../point_src/random.js\n ../point_src/screenwrap.js\n ../point_src/velocity.js\n---\n\nThe minimal requirements include the _head_, _stage_, and the _point_.'}