Re: RE: [stella] Climber5 source and binary

Subject: Re: RE: [stella] Climber5 source and binary
From: "Andrew Davie" <atari2600@xxxxxxxxxxxxx>
Date: Fri, 18 Apr 2003 12:29:16 +1000
> > 9. if your random number generator is good and random is at least once
> > initialized to != 0 this code is superfluous:
> > RandomByte SUBROUTINE
> >    lda random
> > ;   bne .skipInit
> > ;   lda #$FF
>
> But if it's truely random, couldn't it eventually go to zero? Now that I
think about it if I does ever produce a zero value then the values wouldn't
be random anymore :)


I tend to add "eor variable" inside my random routine, where 'variable' is
something that I know changes with regularity.  Some onscreen timer,
perhaps, or the horizontal or vertical position of some object.  Or just a
byte which is incremented every frame.  Then even when your random number
gets to 0, you'll still be random.  You also don't need that 0-check and $FF
load, if you do this.

Cheers
A


----------------------------------------------------------------------------------------------
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/


Current Thread