Page 1 of 1

Pushing rocks

Posted: Thu Dec 06, 2012 4:18 pm
by Tom
I have searched both this forum and sifted through all the nice information available, but haven't been able to find an answer to this:

What exactly is the algorithm used when Rockford pushes a Boulder (in the C64 version I of BoulderDash)?
I suspect it has something to do with the random routine used to grow amoeba, but can't seem to get satisfactory results.

Posted: Thu Dec 06, 2012 6:52 pm
by subotai
  • - check if the boulder is in falling state (falling boulders can't be pushed)
    - check if there is empty space to push the boulder
    - a random number determines if the boulder is pushed or not
I'm not 100% sure, but I think that the probability for pushing boulders is 1/8. Finally it doesn't really matter which random generator you are using, because the random numbers are not predictable for pushing boulders.

Code: Select all

r:=random(8); //random number in range 0..7
if r=0 then pushboulder;
For the slime permeability, predictable random numbers are used. There's a thread about this in the forum.

Posted: Thu Dec 06, 2012 7:07 pm
by Tom
Excellent - thank you very much :!:

Tom