View Single Post
  #3  
Old 09-21-2011, 10:26 AM
Tricxta Tricxta is offline
The Muffin Man
Tricxta's Avatar
Join Date: Oct 2010
Location: Australia
Posts: 563
Tricxta is just really niceTricxta is just really nice
Quote:
Originally Posted by Ohk4y View Post
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, {
        
00screenwidth0screenwidthscreenheight0screenheight
    
});
    
changeimgcolors(2100001); 
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.
Reply With Quote