[Haskell-cafe] Dynamic collections of wires with netwire?

Kata lightquake at amateurtopologist.com
Tue Apr 23 06:55:53 CEST 2013


I'm using netwire to make a top-down shooter; the player can spawn projectiles by clicking, and projectiles will destroy themselves and whatever they hit on collisions. So the way I'm thinking of this is as a collection of wires, one for each projectile, that I can cast input events to; however, I'm not sure how to deal with the fact that the set of wires is dynamically changing, since you can't do


    projectileWires <- accum (++) [] -< newProjectiles
    projectileState <- multicast projectileWires -< ()

or whatever. Do I have to write the relevant code out by hand using stepWire/stepWireP, or is there a nicer way?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130423/0882ea3e/attachment.htm>


More information about the Haskell-Cafe mailing list