Implement mouse invert checkbox
This commit is contained in:
@@ -109,7 +109,7 @@ npx uglify-js build/game.packed.js \
|
|||||||
--compress --mangle toplevel --mangle-props regex=/^_/ \
|
--compress --mangle toplevel --mangle-props regex=/^_/ \
|
||||||
-o build/game.min.js
|
-o build/game.min.js
|
||||||
|
|
||||||
npx roadroller -Zab14 -Zlr1113 -Zmd16 -Zpr14 -S0,1,2,3,6,7,13,21,25,50,235,333 build/game.min.js -o build/game.roadrolled.js
|
npx roadroller -Zab14 -Zlr930 -Zmd19 -Zpr14 -S0,1,2,3,7,13,14,19,58,97,305,422 build/game.min.js -o build/game.roadrolled.js
|
||||||
|
|
||||||
# Embed source into HTML
|
# Embed source into HTML
|
||||||
sed -e '/GAME_SOURCE/{r build/game.roadrolled.js' -e 'd}' source/html_template.html > build/index.html
|
sed -e '/GAME_SOURCE/{r build/game.roadrolled.js' -e 'd}' source/html_template.html > build/index.html
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ document.body.innerHTML +=
|
|||||||
'<div id="h"></div><div id="a"></div>'+
|
'<div id="h"></div><div id="a"></div>'+
|
||||||
'<div id="msg"></div>'+
|
'<div id="msg"></div>'+
|
||||||
'</div>'+
|
'</div>'+
|
||||||
'<p>MOUSE SPEED: <input id="m" type="range" value=10 min=1 max=50></p>'+
|
'<p>MOUSE SPEED: <input id="m" type="range" value=10 min=1 max=50> INVERT: <input type="checkbox" id="mi"></p>'+
|
||||||
'<p><input id="f" type="button" value="FULLSCREEN"></p>'+
|
'<p><input id="f" type="button" value="FULLSCREEN"></p>'+
|
||||||
'<p>'+
|
'<p>'+
|
||||||
'code: <a href="https://phoboslab.org">phoboslab.org</a> / music: <a href="http://no-fate.net">no-fate.net</a>'+
|
'code: <a href="https://phoboslab.org">phoboslab.org</a> / music: <a href="http://no-fate.net">no-fate.net</a>'+
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ class entity_player_t extends entity_t {
|
|||||||
|
|
||||||
_update() {
|
_update() {
|
||||||
// Mouse look
|
// Mouse look
|
||||||
this._pitch = clamp(this._pitch + mouse_y * m.value * 0.00015, -1.5, 1.5);
|
this._pitch = clamp(this._pitch + mouse_y * m.value * (mi.checked ? -0.00015 : 0.00015), -1.5, 1.5);
|
||||||
this._yaw = (this._yaw + mouse_x * m.value * 0.00015) % (Math.PI*2);
|
this._yaw = (this._yaw + mouse_x * m.value * 0.00015) % (Math.PI*2);
|
||||||
|
|
||||||
// Acceleration in movement direction
|
// Acceleration in movement direction
|
||||||
|
|||||||
Reference in New Issue
Block a user