[Haskell-cafe] Netwire, keyboard events, and games
Patrick Hurst
lightquake at amateurtopologist.com
Sat Feb 16 05:31:23 CET 2013
I'm using netwire to build a game; one of the things the player can do is
move around using WASD. I want to use key *events* as the 'basis' of my
wires, not the entire state vector of the keyboard so that, for example, a
press event on D increments the velocity by (200, 0) and a release event
decrements it by that much. However, this has the problem that I can't
actually get the velocity unless I have an event to feed into the wires,
which means I can only update the screen when the user presses or releases
a key. While this might make for interesting gameplay, it's not what I want.
is the right thing to do to make the input something like a Maybe KeyEvent
instead, and pass in Nothing whenever I want to get output without an event
for, e.g., a render?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130215/90f957ce/attachment.htm>
More information about the Haskell-Cafe
mailing list