0-255
I was having trouble keeping the flying hamburger's y position visible on the screen during the title screen. Then, after I don't know how many attempts (including when I was working on the first game), it FINALLY dawned on me. The y position will give a psuedo-random number from 0 to 255. SO I HAD TO PLAN AS SUCH! I had to plan for a number being 255.
So now my code looks like this:
resetburgerx ld a,5 ld (burgerx),a call GetRandomNumber ld hl,RandomNumberGeneratorWord ld (burgery),a ld a,(burgery) cp 150 jp nc,subtract_burger_y ld a,(burgery) cp 35 jp c,add_burger_y jp titlescreen subtract_burger_y ld a,(burgery) ld b, 105 sub b ld (burgery),a jp titlescreen add_burger_y ld a,(burgery) add a,35 ld (burgery),a jp titlescreen
That means, if the random number comes back as 255, that means it would have to subtract 105 from it giving me a total of 150, which is (barely) on the Game Gear screen. Likewise, if the random number is less than 35, it would have to add 35 to it, so if it was 0 it would change to be 35. Last night I composed a new short title screen song for the game. I like it, despite it being only about 16 seconds or so long. So now what's next on my to do list is compose a new level 1 song for the outer space level.
I still am having a hard time with palette changing colors. The part I don't get is the value of colors. I would have liked level 1's numbers and letters to be yellow or blue, but I have to settle for green because I spent a half-hour trying various values to try to get blue and I never did get it. At least I got the life counter and the score's y position to be the same. And I finally fell asleep at about 10a.m. and woke up @ 4p.m. So that's 6 hours of sleep, which is more like a normal person.
- 1
0 Comments
Recommended Comments
There are no comments to display.