(GS1 script)
intended for use while level editing, this draws a line where the player is onwall on any side of them. such as using those little stone and mushroom tiles in the middle of a field where the player would be blocked in what looks like theres an open pathway (grrrr) you can walk through with this and find such places
i checked to make sure the x and y locations are precise for player movement (so you can use that for other stuff too maybe)
could probably be easily converted to gs2
PHP Code:
// NPC made by Prozac
if (created) {toweapons walltest; timeout=.05;}
if (timeout)
{
//above, dir=0
if (onwall(playerx+.5,playery)
|| onwall(playerx+1.5,playery)
|| onwall(playerx+2,playery)
)
{showpoly 1,{playerx,playery+.5,playerx+3,playery+.5};}
else {hideimg 1;}
//right, dir=1
if (onwall(playerx+2.5,playery+1)
|| onwall(playerx+2.5,playery+1.5)
|| onwall(playerx+2.5,playery+2)
|| onwall(playerx+2.5,playery+2.5)
)
{showpoly 2,{playerx+2.5,playery,playerx+2.5,playery+3};}
else {hideimg 2;}
//below, dir=2
if (onwall(playerx+.5,playery+3)
|| onwall(playerx+1.5,playery+3)
|| onwall(playerx+2,playery+3)
)
{showpoly 3,{playerx,playery+3,playerx+3,playery+3};}
else {hideimg 3;}
//left, dir=3
if (onwall(playerx,playery+1)
|| onwall(playerx,playery+1.5)
|| onwall(playerx,playery+2)
|| onwall(playerx,playery+2.5)
)
{showpoly 4,{playerx+.5,playery,playerx+.5,playery+3};}
else {hideimg 4;}
timeout=.05;
}