fixed the max gravity
This commit is contained in:
parent
e023942ac2
commit
932b69a234
@ -61,7 +61,7 @@ body {
|
||||
<center>
|
||||
<div id="screen">
|
||||
<h2 id="title">Gravity Pong!</h2>
|
||||
<div id="msg"></div>
|
||||
<div id="msg">press <space> 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…
Reference in New Issue
Block a user