Tutorial to create map grid

Hi. I need to create a map grid like map grid in this AABB vs Grille But I have not any idea how to do it. Have you tutorials that clearly explain how to do that? Thanks. (Sorryfor my english)

I don’t know what you want to do (your link is in french) but check this out
http://deepnight.net/a-simple-platformer-engine-part-1-basics/
http://deepnight.net/a-simple-platformer-engine-part-2-collisions/

Hi ilambob,

The example likely uses a single dimensional array to represent a 2 dimensional array
a typical 2d array would look something like this:

map = [
[ 1, 1, 1, 1 ],
[ 1, 0, 0, 1 ],
[ 1, 0, 0, 1 ],
[ 1, 1, 1, 1 ]
]
and you would access a value by doing this:
map[x][y]

in the case where you know how wide the grid is, you don’t need to store that many arrays, and can just use a single dimensional array and get the index like so:
columns = 4
map = [
1, 1, 1, 1,
1, 0, 0, 1,
1, 0, 0, 1,
1, 1, 1, 1
]
then you can access it like this:
map[ x + y * columns ]

Hope that helps you.