diff --git a/resources/public/index.html b/resources/public/index.html index cbef49c..18ab5bc 100644 --- a/resources/public/index.html +++ b/resources/public/index.html @@ -34,6 +34,12 @@ body { #canvas { border: 2px green solid; } + +#score { + font-size: 70px; + text-anchor: middle; + dominant-baseline: central; +} @@ -49,13 +55,13 @@ body { + 0
- score 0 fps 0
use W-S keys to move the left paddle and Up-Down arrow keys to move the right paddle diff --git a/src/cljs/frpong/core.cljs b/src/cljs/frpong/core.cljs index ba831df..4c0c363 100644 --- a/src/cljs/frpong/core.cljs +++ b/src/cljs/frpong/core.cljs @@ -86,6 +86,9 @@ (dom/set-attr! "r" *ball-radius*) (dom/set-attr! "cx" (first *center*)) (dom/set-attr! "cy" (second *center*))) + (doto (dom/by-id "score") + (dom/set-attr! "x" (first *center*)) + (dom/set-attr! "y" (second *center*))) (doseq [id ["lpaddle" "rpaddle"]] (doto (dom/by-id id) (dom/set-attr! "width" *paddle-width*)