1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-10-31 19:36:16 +00:00

ads-game:: joystick control

This commit is contained in:
Zeno Rogue 2022-10-16 09:46:04 +02:00
parent 0c38c4ad68
commit 3c867a7ff0

View File

@ -94,6 +94,20 @@ void apply_lorentz(transmatrix lor) {
}
ld read_movement() {
ld mdx = multi::axespressed[4]/30000.;
ld mdy = multi::axespressed[5]/30000.;
#if CAP_VR
if(vrhr::active()) {
mdy -= vrhr::vrgo_y;
mdx += vrhr::vrgo_x;
}
#endif
if(mdx || mdy) {
ang = atan2(mdy, mdx) / degree;
return hypot(mdx, mdy);
}
auto& a = multi::actionspressed;
bool left = a[16+1];
bool right = a[16+3];