Haxball Headless get in specific area and an other question

Talk about haxball in here, maps, sides, players, tactics, anything related to the game.

Haxball Headless get in specific area and an other question

Postby paq » December 16th, 2019, 3:27 pm

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:
  • 0

paq
 
Posts: 2
News Articles: 0
Reputation: 0

Joined: December 16th, 2019, 9:37 am


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

Postby saviola » December 16th, 2019, 4:43 pm

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.
  • 1

User avatar
saviola
 
Posts: 144
News Articles: 0
Reputation: 661

Joined: December 9th, 2012, 5:08 pm


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

Postby paq » December 16th, 2019, 6:42 pm

Hey thanks for the answerr :) Do you maybe have an example on how that could look like regarding the rectangle?
  • 0

paq
 
Posts: 2
News Articles: 0
Reputation: 0

Joined: December 16th, 2019, 9:37 am



Return to General Haxball Discussion

Who is online

Users browsing this forum: No registered users and 20 guests

cron