L
Linio
Hello i know it may sounds stupid, but i'm currently working on a boardgame
on a grid of 20*20 squares and i'd like to write a function to know which
squares are between two square in parameter like this:
public Vector checkBetween(int X1, int Y1, int X2, int Y2);
and by calling it on for example checkBetween(18,6,15,9) in return i have
(17,7) and (16,8).
I tried to figure out a way of doing this by using a polygon but it doesn't
work at all, when i call the function on a straight line (like (15,5) and
(15,10) I have nothing in return when i call the function contains on my
polygon...
I hope I was clear because I ... am clearly not.
If someone could help me out I would appreciate.
Linio.
on a grid of 20*20 squares and i'd like to write a function to know which
squares are between two square in parameter like this:
public Vector checkBetween(int X1, int Y1, int X2, int Y2);
and by calling it on for example checkBetween(18,6,15,9) in return i have
(17,7) and (16,8).
I tried to figure out a way of doing this by using a polygon but it doesn't
work at all, when i call the function on a straight line (like (15,5) and
(15,10) I have nothing in return when i call the function contains on my
polygon...
I hope I was clear because I ... am clearly not.
If someone could help me out I would appreciate.
Linio.