Tuesday, January 10, 2006

Tuesday 10th

Best laid plans being what they are, FishEd didn't reach Beta at the end of December; however, work has continued and good progress has been made over the last couple of days.

The main task in hand has involved finishing the Test Map module, which allows the user to see how their map will look when scrolled smoothly at varying speeds. I'd managed to find some code with a fairly simple scroller, so yesterday I took this code, rewrote it, then tweaked it to mimick how I wanted the Test Map system to operate.

After getting nowhere, I posted a message on the YakYak programming forum - after further investigation today, it transpired that I couldn't manipulate the MouseX and MouseY variables without first assigning them to another variable. These kinds of bugs are painful, mainly because you begin to question your programming ability when it's actually the compiler's fault. Grrr.

With this problem out of the way, today I began integrating the testbed code into the Editor; though this process took a while to debug (mainly due to the fact that the map display routine and logic routine all had to be tweaked to suit), results came thick and fast. I had to change the size of the visible area a couple of times, in order to make sure that all tile sizes can be displayed properly, so I resorted to using the current window size used by the Editor.

After a little more tinkering and debugging, the code was in and working; while holding the mouse button, tracking the cursor across the window will cause the map to scroll proportionally in the same direction (so clicking at the far right/left of the window takes the user to the far left/right of the map). This allows maximum control over the map scrolling, and feels extremely comfortable in practise.

This new system means that I'll no longer need a system for changing the scrolling speed; instead these will be applied to the Parallax layer, so that it scrolls at the correct ratio.