Helm gamedev. Filtering signals.

75 views
Skip to first unread message

Georgiy Lukjanov

unread,
Dec 22, 2014, 9:54:47 AM12/22/14
to helm...@googlegroups.com
Hi everyone. My name is Georgiy, i'm a computer science student from Russia.

I'm trying to build a Space Invaders like game using Helm, but have an issue with composing signals. I made a signal that describes rocket (spaceship launches them to hit invaders), this signal is desired to be changed only by timer signal, but it also must depend on signal of ship to deduce rocket's initial state. So the type of rocket's control signal looks like this: controlSignal :: Signal (Bool, Time, GameState, ShipState).  The problem is that rocket moves not only when timer ticks, but when I hit spacebar or arrow keys. 

I realize that I need a method to filter undesired signals, but I can't figure out how I should do it.

In Elm 0.14 API I see functions (keepIf, keepWhen, etc.) with desired semantics, but I don't see a way to get such behavior with helm API. 

Could anyone give me advice how to filter signals?

Sincerely, Georgiy.

P. S. Game sources are available on github: https://github.com/geo2a/monad-invaders Checkout dev branch to see latest commits.

Kaspar Emanuel

unread,
Dec 22, 2014, 6:20:57 PM12/22/14
to Georgiy Lukjanov, helm...@googlegroups.com
Hi Georgiy,

Elm 0.14 API I see functions (keepIf, keepWhen, etc.)

the best idea is probably to implement these in Helm if you can and send a pull-request.

Cheers,

Kaspar
Reply all
Reply to author
Forward
0 new messages