diff --git a/resources/public/index.html b/resources/public/index.html
index f5f239c..50ec202 100644
--- a/resources/public/index.html
+++ b/resources/public/index.html
@@ -8,13 +8,14 @@
- FPS:
- Position:
- Velocity:
-
-
+ Frame:
+ FPS:
+ Position:
+ Velocity:
+
+
diff --git a/src/cljs/frpong/core.cljs b/src/cljs/frpong/core.cljs
index ad50067..4849ba5 100644
--- a/src/cljs/frpong/core.cljs
+++ b/src/cljs/frpong/core.cljs
@@ -1,5 +1,5 @@
(ns frpong.core
- (:require [frpong.helpers :as h]
+ (:require [frpong.helpers :as h :refer [log]]
[cljs.core.async :as async
:refer [! chan put! close! sliding-buffer dropping-buffer timeout]]
[domina :as dom :refer [log]]
@@ -32,6 +32,16 @@
(defn abs [x] (.abs js/Math x))
+(defn tick-chan [frame-chan]
+ (let [c (chan)]
+ (go
+ (loop [prev (! c t))
+ (recur t))))
+ c))
+
(defn positioner [tick-chan vel-chan pos-chan-in pos-chan-out]
(go-loop
(let [tick (! c (- ts start))
(recur ts)))))
c))
+
+(defn dropping-chan [source n]
+ (let [c (chan)]
+ (go
+ (loop [count 0]
+ (if (= count 0)
+ (>! c (