However, in order to be able to create and track multiple missiles, I
need some kind of Array.
Gary C Martin created something similar in his great little Asteroids
clone, but did the logic within a javascript patch.
http://www.quartzcompositions.com/phpBB2/upload/details.php?file=378
I patched together a virtual RAM module, with Get and Set and Address inputs.
Basically I’d love to have an ‘Array’ patch which has inputs which
allow me to randomly access and edit variables inside the array.  The
patch would output a structure.

Any suggestions on how to do this with patches in QC?


Gary's approach is essentially the most useful here -- handle the logic +structure creation all in JS. Having patches that simulate low-level hardware aren't particularly efficient in QC.

here's a simple example of a simulation taking place in javascript, with QC doing the rendering:

Attachment: javascript objects.qtz
Description: application/quartzcomposer

(this doesn't expose random-access stuff, but it could be added pretty trivially)

(By the way, I _think_ iterators in Snow Leopard can have outputs, but I don't know how it works, and haven't had much time to poke about it. Perhaps that's more elegant that then above)

If you're going 10.6-only, you can also do the simulation stuff in CL, which might be snappier if you've got thousands of objects flying around.

--
[ christopher wright ]
[email protected]
http://kineme.net/

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to