X
تبلیغات
رایتل

نمایش یک نقشه ی کوچک در بالای صفحه که محل پلیر را نمایش می دهد:


{
var _mmwidth,_mmheight;
_mmwidth = room_width/10; //Width of minimap
_mmheight = room_height/10; //Height of minimap

//Draw minimap

//Draw black rectangle
draw_set_color(c_teal);
draw_rectangle(view_xview[0],view_yview[0],view_xview[0]+_mmwidth,view_yview[0]+_mmheight,1);
//Draw outline
draw_set_alpha(0.4);
draw_rectangle(view_xview[0],view_yview[0],view_xview[0]+_mmwidth,view_yview[0]+_mmheight,0);
//Draw filled rectangle

draw_set_alpha(1); //Set alpha to 1, since I want to draw some solid units on the minimap
//Draw all cicles
with (obj_player) {
//If it is inside the room, then draw it
if (x > 0 && y > 0 && x < room_width && y < room_height) {
draw_set_color(c_black);
draw_circle(view_xview[0]+(x*(_mmwidth/room_width)),view_yview[0]+(y*(_mmheight/room_height)),2,0);
}
}

}



منبع : http://game2maker.blogsky.com/pages/code/