I’m currently looking for a way to make a grid where i can detect collisions or mouseclicks on certain gridtiles. I’ve been reading around, and it seems i should be able to use Vector2df. However, i have no clue how to use this.
I would love if someone could give me an example!
There isn’t much need to use vectors to figure out which tile was clicked.
If your tiles are 50x50(Like in your other post) then you just take mousepos.x / 50 and mousepos.y/50 and that’ll get you the (x,y) coords of the tile you clicked.
As for collision, it’s a little more complex and depends entirely on what kind of objects you’re using, how you represent them, etc.