Note that there are some explanatory texts on larger screens.

plurals
  1. POdebug output of game objects in Haskell/Yampa and HOOD
    primarykey
    data
    text
    <p>I'm stuck with generating debug output for my game objects using Haskell/Yampa (=Arrows) (with HOOD).</p> <p>My engine basically runs a list of game objects which produce Output states (line, circle) which are then rendered.</p> <pre><code>data Output = Circle Position2 Double | Line Vector2 output :: [Output] -&gt; IO () output oos = mapM render oos render :: Output -&gt; IO () render (Circle p r) = drawCircle p r render (Line vec) = drawLine (Point2 0 0) vec </code></pre> <p>The player object just moves to the right and is represented as a (positioned) circle.</p> <pre><code>playerObject :: SF () Output -- SF is an Arrow run by time p &lt;- mover (Point2 0 0) -&lt; (Vector2 10 0) returnA -&lt; (Circle p 2.0) </code></pre> <p>mover is just a simple integrator (acceleration->velocity->position) where I want to observe the velocity and render it as debug output as an (unpositioned) Line.</p> <pre><code>mover :: Position2 -&gt; SF Vector2 Position2 mover position0 = proc acceleration -&gt; do velocity &lt;- integral -&lt; acceleration -- !! I want to observe velocity position &lt;- (position0 .+^) ^&lt;&lt; integral -&lt; velocity returnA -&lt; position </code></pre> <p>How can I create additional graphical debug output for internal values of my game object functions?</p> <p>What actually should happen is in output, first render the actual object (circle) but also render additional debug output (movement vector as line). Probably I can achieve this with HOOD but I'm still not fluent in Haskell and don't know how do adopt the HOOD tutorial for my case.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload