Skip to content

Commit 1402a6a

Browse files
authored
Add files via upload
update logo and sensitivity
1 parent c455f69 commit 1402a6a

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

marble_webapp/app.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const holes = [
1515
{x: 400, y: 400, r: 15}
1616
];
1717
const friction = 0.98;
18-
const sensitivity = 0.5;
18+
const sensitivity = 0.4;
1919

2020
const keys = {};
2121
document.addEventListener('keydown', e => keys[e.key.toLowerCase()] = true);
@@ -25,8 +25,8 @@ document.addEventListener('keyup', e => keys[e.key.toLowerCase()] = false);
2525
if (window.DeviceMotionEvent) {
2626
window.addEventListener('devicemotion', e => {
2727
if (e.accelerationIncludingGravity) {
28-
angleX = e.accelerationIncludingGravity.x*0.1; // Scale down for sensitivity
29-
angleY = e.accelerationIncludingGravity.y*0.1; // Scale down for sensitivity
28+
angleX = e.accelerationIncludingGravity.x*-0.01; // Scale down for sensitivity
29+
angleY = e.accelerationIncludingGravity.y*-0.01; // Scale down for sensitivity
3030
}
3131
});
3232
}
@@ -70,10 +70,11 @@ function update() {
7070
// WASD simulation
7171
let keyboardAngleX = 0;
7272
let keyboardAngleY = 0;
73-
if (keys['w']) keyboardAngleY -= 1;
74-
if (keys['s']) keyboardAngleY += 1;
75-
if (keys['a']) keyboardAngleX -= 1;
76-
if (keys['d']) keyboardAngleX += 1;
73+
let keyboard_sensitivity = 5;
74+
if (keys['w']) keyboardAngleY -= keyboard_sensitivity;
75+
if (keys['s']) keyboardAngleY += keyboard_sensitivity;
76+
if (keys['a']) keyboardAngleX -= keyboard_sensitivity;
77+
if (keys['d']) keyboardAngleX += keyboard_sensitivity;
7778

7879
// Kombiniere Tastatur und DeviceMotion
7980
const totalAngleX = angleX + keyboardAngleX;

marble_webapp/icon.png

-57.2 KB
Loading

marble_webapp/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<title>Marble Maze Game</title>
6+
<title>Marble Maze Game v3</title>
77
<style>
88
html, body {
99
margin: 0;

0 commit comments

Comments
 (0)