supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Make rumble functions configurable

Open n0toose opened this issue 1 year ago • 8 comments

Affects GameControllerManager::rumble() and JoystickManager::rumble().

The functions were overloaded so as to be made configurable, but there is a default rumble (that now lasts 100ms instead of 300ms). Just a small refactoring job.


I have not figured out how to expose the rumble function to Player.cpp in a clean way yet, but this is a start.

Related to https://github.com/SuperTux/supertux/issues/2741.

n0toose avatar Jan 24 '24 15:01 n0toose

Wait, I completely forgot about joysticks (and left in a mistake during a rebasing mistake) that skips most of the conditions.

n0toose avatar Jan 24 '24 15:01 n0toose

Should hopefully be good to go? (Note: I don't own a joystick, so the changes affecting the joystick component are untested - even if they are presumed to be fine.)

n0toose avatar Jan 24 '24 15:01 n0toose

Besides my previous comments maybe it would make sense to add rumble configuration to options menu? Because currently this change seems little bit pointless.

mrkubax10 avatar Jan 26 '24 09:01 mrkubax10

Because currently this change seems little bit pointless.

I haven't completed my work in trying to get GameControllerManager to communicate with Player yet - but I thought that I should send this very small refactor (which was the only working thing I got after completing my coding session) so that it's easier to pick it up again later or let someone else pick it up if I abandon it.

Besides my previous comments maybe it would make sense to add rumble configuration to options menu?

I do not know if I should do that yet, as that would require me to answer the following: Should I use the GameControllerManager class for storing these settings, instead of Player? I do not have a perfect understanding of how these components work together, and would appreciate some assistance.

Later on, I'd like to use information such as the direction that a player was hit from or whether the player got a fire flower more easily later.

n0toose avatar Jan 27 '24 17:01 n0toose

I think you should trigger rumble when there's any type of screenshake, which does not require player

MatusGuy avatar Jan 27 '24 17:01 MatusGuy

I think you should trigger rumble when there's any type of screenshake, which does not require player

Hm, would be a good start and one could immediately combine it with https://github.com/SuperTux/supertux/issues/2741.

n0toose avatar Jan 27 '24 18:01 n0toose

I think you should trigger rumble when there's any type of screenshake, which does not require player

I'll look at whether I can get the Camera class to talk to GameControllerManager.

n0toose avatar Jan 28 '24 15:01 n0toose

it's not a singleton?

MatusGuy avatar Feb 01 '24 17:02 MatusGuy