Hi. I tried to create my first menu for a gamepad where the selection marker moves up/down between menu items. I used an array to store the Y position of the marker and this works fine so far. But I wanted to allow the user to hold down to scroll down the menu items and tap multiple times to scroll faster. I came up with the following solution. Its not perfect and sometimes it moves 2 entries at once because the timer and single trigger happen at the same time. But I was surprised how good it works for now.
Does anyone have already made such a menu and has an idea how to change it to fix this?
Here is the code: