Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera Input still being read when using buttons on Android #21

Open
MysticAx0lotl opened this issue Sep 7, 2023 · 7 comments
Open
Labels
bug Something isn't working enhancement New feature or request Gold for MBHaxe Gold

Comments

@MysticAx0lotl
Copy link

The camera will still accept input and move when a button is being held in the Android and (I presume) iOS/Web versions of MBHaxe. This makes the game nearly impossible to control with touch controls. My solution is to turn off camera controls when a button is being held, like most other mobile games with a similar control setup.

Thanks, this port is amazing!

@MysticAx0lotl
Copy link
Author

MysticAx0lotl commented Sep 7, 2023

After playtesting a bit, I realized my idea may not work, so here's my better suggestion:

  • If the screen is tapped and a button is pressed, lock the camera
  • If the button remains held for more than about a quarter of a second, unlock the camera.

This allows you to still move the camera while bunnyhopping, but single jumps won't mess up the camera. I may see if I can implement this myself, and if so, submit a PR later.

@RandomityGuy
Copy link
Owner

RandomityGuy commented Sep 7, 2023

This is an intended feature that I took from Marble It Up Mayhem on iOS. It is meant to allow you to turn large angles while holding down a button, making the button double as more sensitive joystick for the camera.
As for your suggestion, I thought of another solution that is to add a deadzone - a certain minimum touch movement is required to recognize it, to the button which should fix the single jumps messing the camera.

Does this inconvenience happen in all the versions (MBG, MBP, MBU)?

@MysticAx0lotl
Copy link
Author

As for your suggestion, I thought of another solution that is to add a deadzone - a certain minimum touch movement is required to recognize it, to the button which should fix the single jumps messing the camera.

This is pretty much what I was thinking of above, I just communicated it really poorly 😅

Does this inconvenience happen in all the versions (MBG, MBP, MBU)?

Yes, although it's less of an issue in MBG (for some reason). I haven't tested MBP, but I'm assuming it's the same as MBG.

Another issue I realized I had with the camera is that movement is really choppy. I don't mean it lags my game, I mean it only updates every 2-3 frames instead of every frame.

@RandomityGuy RandomityGuy added bug Something isn't working enhancement New feature or request labels Sep 8, 2023
@RandomityGuy
Copy link
Owner

RandomityGuy commented Sep 22, 2023

The web versions of MBG/MBP/MBU have been updated with the touch camera deadzone changes.
Please test whether the changes are suitable.

Another issue I realized I had with the camera is that movement is really choppy. I don't mean it lags my game, I mean it only updates every 2-3 frames instead of every frame.

This may be due to the non linear curve of the camera: lower values, the exact function being
value < 3 ? sgn(value) * |value / 2|^2.7 : value

@MysticAx0lotl
Copy link
Author

Sweet, I'll test and report back as soon as I can!!

@RandomityGuy
Copy link
Owner

Any update on this?

@MysticAx0lotl
Copy link
Author

Hey, so sorry for the delay. I've had a pretty insane last few months. Whatever you did to the controls feels great

@RandomityGuy RandomityGuy added the Gold for MBHaxe Gold label Nov 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request Gold for MBHaxe Gold
Projects
None yet
Development

No branches or pull requests

2 participants