Open olehmisar opened 6 years ago
What about getBall(): x, y, radius, speedx, speedy?
Yeah, great idea. And to be consistent basro should change getPlayerList()
function which will return array of objects of this type: { id, name, team, admin, position: { x, y, speedx, speedy } }
honestly, getPlayersList does not need that, you can get the other things easily with just the id
No, it needs because you cannot get player speed anywhere
Then improve getPlayerPosition instead of getPlayerList
There is no getPlayerPosition()
function
Since the ball radius is coded inside the stadium file, maybe something like getStadium could be added as an extension of this idea.
@basro, modify onStadiumChange()
to accept stadium contents as second argument.
@olegmisar PlayerObject position : {"x": float, "y": float} The player's position in the field, if the player is not in the field the value will be null.
Omg, leo, read our conversation again, you don't understand what is going on.
You that does not understand it, im showing you the command you said it didnt exist, even though the name isnt the same because i didnt remember the name of the command the first time and i didnt want to expend time looking for that
@Leo-MapCreator You get the PlayerObject
from the getPlayerList()
function, so that's the function that has to be changed, and that's exactly what @olegmisar suggested.
Ball radius is not always fixed. Map makers can change ball size. Could you add/replace
getBallPosition()
function withgetBall()
function which returnsx
,y
, andradius
? Hope for that.