Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Programming/Scripting/Development/Web Design

Gbz80: How to generate a random number between $xx and $yy - Page 1

Gbz80: How to generate a random number between $xx and $yy

Posted by: Couldntthinkofaname
Date: 2017-10-16 08:56:05
I'm making a small ACE game for Pokemon Red. I want a block to be placed at a random x and y value, and due to screen limitations, the x value must be between $00 and $13 (inclusive) and the y value must be between $00 and $11 (also inclusive)

My question is this: Is there any way to make an RNG that is between two different values?

Re: Gbz80: How to generate a random number between $xx and $yy

Posted by: ISSOtm
Date: 2017-10-16 14:25:38
`call Random` each time. Far from perfect due to the way the game's RNG is implemented, but it should suffice.