The Dink Network

brain 9 sprites in bottom right corner

August 2nd, 07:55 PM
custom_simon.gif
SimonK
Peasant He/Him Australia
 
So what part of the engine or coding for brain 9 sprites ends up with them more often than not in the bottom right hand corner of the screen?

Not always, but in testing graphics for stuff I noticed that my brain 9 sprites end up in that corner, kinda stuck. I have four roaming around a screen which only has some small hardness in the center-ish, and eventually they all end up there, after a few minutes, and generally don't seem to be able to move out, at least only 1 of 4 did.
August 2nd, 08:33 PM
death.gif
Seseler
Peasant He/Him Heard Island And Mcdonald Islands
 
My possibly completely wrong guess from cursory reading of the source code is that it is because of the screen-border checks on pill_brain.


    if (spr[h].y > (playy - 15))

    {
        changedir(9,h,spr[h].base_walk);
    }         

    if (spr[h].x > (playx - 15))

    {
        changedir(1,h,spr[h].base_walk);
    }         

    if (spr[h].y < 18)
    {
        changedir(1,h,spr[h].base_walk);
    }         

    if (spr[h].x < 18) 
    {
        changedir(3,h,spr[h].base_walk);
    }      


So, a sprite near right edge it will go down-left and sprite near bottom edge it will go up-right.

August 26th, 07:14 PM
death.gif
Seseler
Peasant He/Him Heard Island And Mcdonald Islands
 
I finally got around testing this, and yes, the above code seems to be the cause.
I changed the code so that monsters choose a randomly between the two diagonals leading away from screen edge and it fixes the issue.

The code block is also behind why monsters are willing to move much closer to the left edge of the screen than the right edge as it checks if X < 18, but the status bar takes first 20 columns of the screen so the apparent screen edge starts at X=20.