Okay, I spent another two hours working on the movement problems I was having in Plex. After printing the moves out in my debugger I figured out the reason why movement wasn’t working was because I had it always returning false at the particular depth I was using at the time (depth 0). After fixing that the character now cannot move past blocks that are tall.
The next thing I worked on was getting the board to stop scrolling unless the character’s position can be mod by 5. I did this by setting up a local x and y value that determine where the character is on the SCREEN. This is not the same relationship as where the character is on the entire board because the entire board won’t fit on the window.
After I got that working I had to mod the character’s local x and y values by 5 to reset it back to the beginning position on the screen. This makes it look like the character has scrolled along with the screen.
Now the problem I’m having is that when the character tries to move any further right on the board, the blocks from his right are coming back into view and the character is moving off the screen. My guess is that I’m doing something wrong with my local x and y values, like subtracting from them when I shouldn’t be which results in this error.
The new code is here. Available under the GNU public license.