Hellocollision=false; for(int i = 0; i< Map.CollisionPosition.Count; i++) if (MousePosition * 32 == Map.CollisionPosition[i]) { collision = true; break; }Isn'it what you're trying to do ?
sir you are a genius.
just one last question. can you tell me why my for loop didn't work and yours did?
thank you so much
The second loop works because of the "break" statement. In your loop, you kept resetting collision to false when it found the next tile to check against. It will not return true unless the collision happened in the very last tile. The break statement tells the program to exit the loop, basically saying "we found a collision, looping further isn't necessary."