summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony Wang2024-01-30 00:15:58 +0000
committerAnthony Wang2024-04-13 04:32:17 +0000
commita039dbbccde71bcfcd0278effc49cf98e0b4c28b (patch)
tree55ea1de3d66c8c0f3a15bec82784791788055736
parent04d15f2b1dbe2bf5d051569917acdef4baa724dc (diff)
Set body margin: 0 so body fills the entire screen
-rw-r--r--script.js2
-rw-r--r--style.css1
2 files changed, 2 insertions, 1 deletions
diff --git a/script.js b/script.js
index 8e9bea7..7946f62 100644
--- a/script.js
+++ b/script.js
@@ -113,7 +113,7 @@ function collide(a, b, c, n) {
// Collision of object a with wall at position k and direction d
function wallCollide(a, k, d) {
- if ((d == 0 && Math.abs(a.x - k) < a.r) || (d == 1 && Math.abs(a.y - k) < a.r)) {
+ if ((d == 0 && Math.abs(a.x - k) < a.r + rad) || (d == 1 && Math.abs(a.y - k) < a.r + rad)) {
let c = {x: 0, y: 0, cnt: 0}
for (const p of a.p.map(x => rot(a, x))) {
if ((d == 0 && Math.abs(p.x - k) < rad) || (d == 1 && Math.abs(p.y - k) < rad)) {
diff --git a/style.css b/style.css
index 8a473a1..ddc5101 100644
--- a/style.css
+++ b/style.css
@@ -1,5 +1,6 @@
body {
position: fixed;
+ margin: 0;
overflow: hidden;
touch-action: none;
}