fixed the max gravity

master
Abhinav Sarkar 9 years ago
parent e023942ac2
commit 932b69a234
  1. 4
      resources/public/index.html
  2. 3
      src/cljs/frpong/core.cljs

@ -61,7 +61,7 @@ body {
<center>
<div id="screen">
<h2 id="title">Gravity Pong!</h2>
<div id="msg"></div>
<div id="msg">press &lt;space&gt; to start</div>
<svg id="canvas">
<circle id="mass" />
<text id="score">0</text>
@ -75,7 +75,7 @@ body {
</div>
use W-S and Up-Down keys to move the paddles / use Left-Right keys to change gravity
<div style="float: right">
<a target="_blank" href="https://github.com/abhin4v/frpong">Source</a>
<a target="_blank" href="http://github.com/abhin4v/frpong">github</a>
</div>
</div>
</div>

@ -87,7 +87,7 @@
(go-loop
(let [k (:keyCode (<! keydowns))]
(when (contains? actions k)
(do (swap! *gravity* #(max 0 (min 10 ((actions k) %))))
(do (swap! *gravity* #(max 0 (min 0.1 ((actions k) %))))
(dom/set-attr! (dom/by-id "mass") "r" (mass-radius))))))))
(defn layout-game
@ -356,5 +356,4 @@
(defn ^:export frpong []
(setup-gravity-control)
(layout-game)
(dom/set-text! (dom/by-id "msg") "press <space> to start")
(start-on-space))

Loading…
Cancel
Save