Xybort (part 9)
What was intended to be a quick update to the game turned out to be another off and on coding day. What I wanted to do was just put in some code to make the background and characters different for different levels. For example, value 0a3h holds the color for the background and grid (it doesn't matter about the grid since I'm not using it).
get_bg_color mov r0,#levelnumber mov a,@r0 xrl a,#1 jz level_1_forest level_1_forest mov r0,#0a3h mov a,#21 movx @r0,a ret
This is the code to determine which background color to get based on level. Right now there's only one level, so it will get the level 1 background color. A similar thing for the characters. But it kept giving me a blank screen on Odyssey 2 while playing perfectly on O2EM. Until it decided it had enough of its little fun (perhaps I knocked some sense into the Odyssey 2) and it worked. So there there should be no difference between version 15 and 16 except if you look in the code.
So I know I've said this before, but NOW I've finally found a good stopping point for a break. When I come back to this, I'll begin work on level 2: the sky, a cyan background with horizontally moving airplane characters (if it will let me).
I wanted the code at the end so it would have minimal impact when I add stuff to it. It gets uppity and stops working if a page boundary has been crossed. Sometimes it gives an error message. But sometimes it doesn't, like when the page boundary gets crossed in the middle of a code section.
0 Comments
Recommended Comments
There are no comments to display.