var _format = bmap_lock(bmpWorld, 0);
var _posX = 0;
for (; _posX<32; _posX+=1) {
var _posY = 0;
for (; _posY<24; _posY+=1) {
var pixel = pixel_for_bmap(bmpWorld, player.x - 16 + _posX, player.y - 12 + _posY); // retrieve the pixel from the world bitmap
COLOR _col;
var _alpha;
pixel_to_vec(&_col, &_alpha, _format, _pixel); // transform the pixel to a color vector and alpha value
draw_quad(bmpTiles[_col.red], vector(_posX*tileSize, _posY*tileSize, 0), NULL, vector(32, 32,0), NULL, NULL, 100, 0); // draw the corresponding tile
}
}