Quote:
Originally Posted by Engine
I have another problem with showpoly, I figuired I might as well put it in here instead of making a new thread.
PHP Code:
function blahblah(){
polytest = showpoly(200,{blah,blah,blah,ect});
}
function ifthishappens(){
polytest.mode = 1;//works
polytest.red = 0.5;//works
polytest.blue = polytest.green = 0; //works
polytest.x = player.x; //doesnt work
polytest.y = player.y; //doesnt work
}
Is there a reason why this wont work?
|
Well, I think it's because polygons have multiple coordinates, but I'm not sure. To make it equal to the player's coordinates, you'd just draw every point on the polygon relative to them. For example:
PHP Code:
showpoly( 200, { player.x, player.y, player.x + 5, player.y } );
This would draw a straight horizontal line relative to the player's position.
It's also probably a better idea to use a
this. variable instead of a global variable.