Quote:
Originally Posted by Ohk4y
Hello, I'm trying to simulate being in a cave on my server and I was thinking I could show a polygon that covered the whole screen except for a little circle around your player.
Here's my current script to show a black screen:
PHP Code:
showpoly(210, { 0, 0, screenwidth, 0, screenwidth, screenheight, 0, screenheight }); changeimgcolors(210, 0, 0, 0, 1);
How could I modify this to show only the area around your player? Like maybe 1 - 2 tiles around your player.
|
you have some problems here o_0 your drawing on the tile layer yet using pixel co-ordinates, if you want to draw around the player you would construct it of 4 polygons and draw it on the tile layer instead of the gui layer because the focus of the player changes. You can also calculate the outer co-ordinates of a circle using:
PHP Code:
x=cos(angle)*radius;
y=sin(angle)*radius;
I could give you the script to solve your problem but where's the fun in that

I hope this helps you.