Jump to content
  • entries
    4,943
  • comments
    2,718
  • views
    1,808,165

Some random orange knocked me in the head!


atari2600land

461 views

Back to the Oranges GB game. Today's update: Making the oranges random. Some kind people on the GB programming forums helped me with this. And I will relate it to you now.
There is a timer on the Game Boy's hardware that updates 16,384 times per second (I think that's what they said.) It is register 0xFF04. This is what Tetris used to make the shapes random. So if it's good enough for Tetris, it's good enough for me. Trouble was, I didn't know how to read it. But someone else helped me with it and now the oranges move randomly. I thought for a truly random game, the oranges' speed should be random as well, otherwise it would just return the same random number over and over again. Which while it would still be random, I want randomness...TO THE MAX! So the oranges' speed changes as well. Not very much, I can barely tell the difference between them. The next step was trying to make the guy not flash when the game restarted. This took a while until I realized that if I moved the show sprite command down to the bottom, that would work. I tried it in BGB a few times. One time I couldn't see the guy until I moved him, but I think that was the emulator or my computer being flaky because it works good on a real Game Boy. So now with the guy, one orange, score, title screen, there's still more work to be done. Like adding more oranges. What is the maximum number of sprites I can have on screen? One guy and how many oranges using the same tile map?

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...