Code center > Suggestions
I am back...
Botsareus:
--- Quote ---can't tell me where to respawn it
--- End quote ---
Think of it:
RespownX = feildwith /2 - X
RespownY = feildheight /2 - Y
Numsgil:
I don't think that's right.
That looks somewhat similar to the respawn for a rectangular field. Somewhat, because if you use just that you're going to get negative values for Respawn X and Y half the time.
Here's what I need:
* RespawnX = some function of the max length x ways of the ellipse and bot x position
* RespawnY = some function of the max length y ways of the ellipse and bot y position
* Domain for Bot's X and Y. That is, what are valid values for X and what are valid values for Y? In current rectangle, this looks like: x in [0, field width] y in [0, fieldheight].
Griz:
--- Quote ---I don't think that's right.
That looks somewhat similar to the respawn for a rectangular field. Somewhat, because if you use just that you're going to get negative values for Respawn X and Y half the time.
--- End quote ---
thought you were talking of the center of the field ...
be it retangular or circular ...
being (0,0).
doesn't it then work?
Numsgil:
Maybe for rectangular, but circular should depend on X amd Y for X and Y.
That is, Respawn X = some function of current X and Y.
That's simple enough to see. Where you respawn on the other side of a circle depends not only on your X position but also your Y position.
Griz:
--- Quote ---Maybe for rectangular, but circular should depend on X amd Y for X and Y.
That is, Respawn X = some function of current X and Y.
That's simple enough to see. Where you respawn on the other side of a circle depends not only on your X position but also your Y position.
--- End quote ---
ok, I see what you are saying ...
in this case you have to tweak both x and y rather than one or the other.
but need it be complicated?
as soon as a bot reaches the 'border' or strays across it by some tiny amount
[the smaller interval the better] ...
ie ... (x^2)+y^2)>radius^2 by some small amount ...
do you not know it's exact position and can you not calculate the angle from the
center of the field at which this occurs?
having the angle, can you not add 180 degress, or whatever radians is used ...
and recalculate x and y ... ensuring the signs are correct for the new quadrant ...
their unchanged delta.v placing them inside the field again on the next cycle?
or something like that?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version