More complicated Entity Test
Still entirely nondeterministic, but now I've added some more color controls. Some of these particles are positive poled and will naturally attract, some will repel. Hold down the mouse to invert the magnetic pole of the mouse (and increase the power of the magnet).
Sunday, October 28, 2007
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)
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)
Entity First Tests
First Entity Test
I'm rebuilding my particle system around a couple base objects: Entity, EntityManager, EntityEmitter(optional).
Entities are Sprites with the ability to be updated via a delta 'time' slice. They support nondeterministic animation through this system natively, but they also can each have their own timeline objects to have properties of themselves deterministic.
EntityManager objects manage groups of entities and serve as a single point of contact to update or evaluate an entire group. They also manage removal, and Affector chains.
The whole entity thing is basically a way to get things like Affectors without having emitters - so I can write an Artificial Intelligence Affector for an enemy that needs updating/main loop service.
This example has 4 entities and 3 affectors (WobbleAffector, VelocityClampAffector, RadialSoftBoundsAffector).
I'm rebuilding my particle system around a couple base objects: Entity, EntityManager, EntityEmitter(optional).
Entities are Sprites with the ability to be updated via a delta 'time' slice. They support nondeterministic animation through this system natively, but they also can each have their own timeline objects to have properties of themselves deterministic.
EntityManager objects manage groups of entities and serve as a single point of contact to update or evaluate an entire group. They also manage removal, and Affector chains.
The whole entity thing is basically a way to get things like Affectors without having emitters - so I can write an Artificial Intelligence Affector for an enemy that needs updating/main loop service.
This example has 4 entities and 3 affectors (WobbleAffector, VelocityClampAffector, RadialSoftBoundsAffector).
Flash? in my YouTube?
http://www.lostinactionscript.com/blog/index.php/2007/10/13/flash-you-tube-api/
Saved here for future usage.
Saved here for future usage.
Subscribe to:
Posts (Atom)
(RSS feed)