Tuesday, October 23, 2007

Companion Sphere

Abject return value chain abuse here:

em.addAffector(new MouseAttractor(5)).assign( em.addEntity(newe(0,0xEE0000)) );
em.addAffector(new MouseAttractor(-5)).assign( [em.addEntity(newe(90)), em.addEntity(newe(180)), em.addEntity(newe(270))] );

Creates this version, with 3 of them hating the Mouse and 1 loving it

(newe() in this case just makes an entity with a circle drawn and a start angle with a velocity of 10 and a color)

No comments: