Kata | 23 Apr 06:55 2013

Dynamic collections of wires with netwire?

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?
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org