[Prev][Next][Index][Thread]
A85: Random Numbers
Greatings,
As soon as I figured out how PutSprite worked I set out to make
my first game with it, a bowling game. Writing the pin draw, ball
movement, and ball aiming was easy. The shot detection, however, was a
pain in the ass (not short for assembly). Once I figured out a way
simple way of doing it I realized that due to my random number routine
that the chances of hitting a strike with the best shot is about 1 in
50. The random number routing that I am currently using is...
ld a, r
srl a
and 1
cp 1
etc. etc.
Whenever I try to randomize it by doing "and 3" it still only puts in the
random numbers 1 or 3. Is this possibly due to a repeative motion that
effects what the memory refresh outputs? This was the same reason that
I gave up on my version of an old game called Tapper. Could someone
please show me where there is a simple, but good random number generator
(if there is such a thing).
Thanks,
Mike
_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]
Follow-Ups:
References: