This is probably going to end up being embarrassing, but after spending quite some time trying to wrap my head around this problem, I'm getting a little frustrated. I'm trying to replicate the movement between tiles from other Picross games, namely:
The first step isn't that hard, of course. My problem starts at point #2. What it boils down to is the "feel" of the controls, as every solution I've tried so far feels awkward to play with.
I'm not going to be worrying about part #3 until #2 is solved, as the two are slightly related.
My original code for movement "worked" as follows:
The method I'm using right now feels a bit more awkward. (I don't set the button repeat counter in this version, per my previous comment about part #3 above.)
(If you care about the specifics, look here.)
For demonstration's sake, I'm providing two ROMs with the different movement code. Only download these if you are willing to put up with pre-release software.
Old movement
New movement
Other notes:
Any help/advice would be appreciated.
- Pressing a direction will move a single tile.
- If the direction is held, a small pause happens before the cursor starts to move faster.
- During a direction hold, buttons can be held to swap/mark multiple tiles.
The first step isn't that hard, of course. My problem starts at point #2. What it boils down to is the "feel" of the controls, as every solution I've tried so far feels awkward to play with.
I'm not going to be worrying about part #3 until #2 is solved, as the two are slightly related.
My original code for movement "worked" as follows:
- Grab pad state (pad_trigger(0))
- Check buttons, swap/mark tiles as needed (set button repeat counter to 0)
- Check previous pad state (pad_state(0))
- If a direction is held and !(frameCount&3), move the cursor. If a button is being held at this time, swap/mark tile as needed (set button repeat counter to 1)
The method I'm using right now feels a bit more awkward. (I don't set the button repeat counter in this version, per my previous comment about part #3 above.)
- Grab pad state (pad_trigger(0))
- Check directions; if any direction is pressed, move cursor one tile (set h=0)
- Check buttons, swap/mark tiles as needed (set button repeat counter to 0)
- Check previous pad state (pad_state(0))
- If a direction is held, check if h is less than HOLD_TIME (currently defined as 3). "relying on HOLD_TIME feels like a temporary solution..." and a terrible one, but eh. If h is less than HOLD_TIME, increment h. Otherwise, move the cursor and set h to 0 again.
(If you care about the specifics, look here.)
For demonstration's sake, I'm providing two ROMs with the different movement code. Only download these if you are willing to put up with pre-release software.
Old movement
New movement
Other notes:
- I'm using Shiru's NES library so I can program in C. The relevant subroutines and defines (in ASM) are shown here.
- There are other (game-related) bugs in those demos. They're also a bit older than the current development version. Again, only grab these if you're willing to put up with pre-release software or want to see/feel what I'm talking about.
Any help/advice would be appreciated.