//Checks where your mouse is
var dw,dh,cx,cy; 
dw=display_get_width(); 
dh=display_get_height(); 
cx=(display_mouse_get_x()-dw/2)/8; 
cy=(display_mouse_get_y()-dh/2)/400; 
direction-=cx*1.5
zdir-=cy
display_mouse_set(dw/2,dh/2); 

// set color and transparency
draw_set_alpha(1);
draw_set_color(c_white);

//Displays the projection
d3d_set_projection_ext(x,y,z+15, x+cos(direction*pi/180),y-sin(direction*pi/180),z+zdir, 0,0,1,45,dw/dh,1,32000);

//Draws the floor and ceiling
d3d_draw_floor(0,0,0,room_width,room_height,0,background_get_texture(texture_floor),16,16);
d3d_draw_floor(0,0,32,room_width,room_height,32,background_get_texture(texture_ceiling),16,16);