Vectors and Obstacles HELP
in
Programming Questions
•
1 year ago
Hello all,
please help!!!!
I have written a code using 2D vectors where ellipses are flocking and being attracted to a mouse press. I have loaded in an 2 bit gif (black and white image) and want to use it as an obstacle map. I was able to do this when i wasn't using vectors with the code:
color locationColour = get (x, y);
if (locationColour == -16777216) {
// If the object reaches a black pixel, multiply speed by -1 to turn it around.
speedX = speedX * -1;
speedY = speedY * -1;
}
but now that I am using vectors I get an error message:
"The method get(int,int) in the type PApplet is not applicable for the arguments (float,float)"
is there any way to get(float,float) or similar?
Thanks
kbwhi1 :-D
please help!!!!
I have written a code using 2D vectors where ellipses are flocking and being attracted to a mouse press. I have loaded in an 2 bit gif (black and white image) and want to use it as an obstacle map. I was able to do this when i wasn't using vectors with the code:
color locationColour = get (x, y);
if (locationColour == -16777216) {
// If the object reaches a black pixel, multiply speed by -1 to turn it around.
speedX = speedX * -1;
speedY = speedY * -1;
}
but now that I am using vectors I get an error message:
"The method get(int,int) in the type PApplet is not applicable for the arguments (float,float)"
is there any way to get(float,float) or similar?
Thanks
kbwhi1 :-D
1