Page 1 of 1

Haxball Headless get in specific area and an other question

PostPosted: December 16th, 2019, 3:27 pm
by paq
Hello,
I want to program in headless that after X seconds after the game start all users get kicked who are outside of an area, for example a circle.
How can I do this?
Then I saw in the headless wiki something called "disc", what are those/is that and what does "disc" stand for?

Thank you :tongue:

Re: Haxball Headless get in specific area and an other quest

PostPosted: December 16th, 2019, 4:43 pm
by saviola
Discs are round game physics objects (players, ball, goal posts, ...).

For your problem, you need to compare player position to the area you want them to be in. For a rectangle, you just check if x/y coordinates are >= x_min/y_min and <= x_max/y_max, for a circle you check distance from the center of that circle.

Re: Haxball Headless get in specific area and an other quest

PostPosted: December 16th, 2019, 6:42 pm
by paq
Hey thanks for the answerr :) Do you maybe have an example on how that could look like regarding the rectangle?