Jump to content
  • entries
    4,944
  • comments
    2,718
  • views
    1,808,441

0-255


atari2600land

182 views

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.

  • Like 1

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...