Bueno durante 4 horas busque algun script que me sirviera para mi juego y bueno he decidido compartirlo XD
Citar
- Nombre del creador:tyranic-moron [GMC] (http://gmc.yoyogames.com/index.php?showtopic=209820&hl=minimap) todos los creditos a el XD
- Breve descripci?n de su funci?n:dibuja un minimapa con alpha,color,tama?o ajustable.soporta hasta 3 objetos para dibujar en el minimapa, el creador usa objetos parents para poder dibujar un grupo de objetos con el mismo color.
- Versi?n GM utilizada: :GM6: pero tambien funciona en :GM7: y :GM8:
C?digo del Script:
// Tyranic-Moron's Minimap Script
// Supports up to 3 teams.
// Just credit me if you use it, and I'll be happy :)
// PM me for more help if you need it (my username is tyranic-moron)
// To use, put the following code in the draw event of the minimap object:
// scrMinimap(ratio,alpha,color,xoffset,yoffset,usesprite,usepulse,team1,team1color,team1rad,team2,team2color,team2rad,team3,team3color,team3rad)
// see below for more detailed descriptions of each section
// Example:
// scrMinimap(200/room_width, 0.5, c_black, 0, 0, false, true, parent_player, c_lime, 1, parent_enemy, c_red, 1, parent_other, c_gray, 1)
// ratio = room to minimap ratio (use desired width / room_width) (argument0)
// alpha = alpha level for drawing (transparency) (argument1)
// color = colour of map (argument2)
// xoffset = the x-offset of the minimap (argument3)
// yoffset = the y-offset of the minimap (argument4)
// usesprite = whether or not to use a sprite (true/false) (argument5)
// usepulse = whether or not to pulse the area currently being viewed (true/false) (argument6)
// team1 = player object name, or parent of (argument7)
// team1color = colour of player objects (on map) (argument8)
// team1rad = size of player 'blips' on minimap (5 is HUGE, normally 1) (argument9)
// team2 = enemy object name, or parent of (argument10)
// team2color = colour of enemy objects (on map) (argument11)
// team2rad = size of enemy 'blips' on minimap (5 is HUGE, normally 1) (argument12)
// team3 = other object name, or parent of (argument13)
// team3color = colour of other objects (on map) (argument14)
// team3rad = size of other 'blips' on minimap (5 is HUGE, normally 1) (argument15)
var pulsecolor, dir
draw_set_alpha(argument1)
draw_set_color(argument2)
// Draws the minimap background
if (argument5 = true) {
if (gamemaker_registered = true) {
draw_sprite_ext(sprMinimap, 0, view_xview[0] + argument3, view_yview[0] + argument4, argument0*room_width, argument0*room_width, 0, argument2, argument1)
} else {
draw_sprite(sprMinimap, 0, view_xview[0] + argument3, view_yview[0] + argument4)
}
} else {
draw_rectangle(view_xview[0] + argument3, view_yview[0] + argument4, view_xview[0] + argument3 + room_width * argument0, view_yview[0] + argument4 + room_height * argument0, false)
}
// Draws a rectangle on the minimap, showing the current view in the room (if argument4 = true, it will pulse as well)
if (argument6 = true) {
if (dir = 0 or pulsecolor = 0) {
dir = 1
pulsecolor = 100
}
if (pulsecolor < 255 and dir = 1) {
pulsecolor += 5
} else {
dir = 2
}
if (pulsecolor > 100 and dir = 2) {
pulsecolor -= 5
} else {
dir = 1
}
if (pulsecolor = 255) {
dir = 2
}
if (pulsecolor = 100) {
dir = 1
}
} else {
pulsecolor = 255
}
draw_set_alpha(argument1/2)
draw_set_color(make_color_rgb(pulsecolor,pulsecolor,pulsecolor))
draw_rectangle(view_xview[0] + argument3 + view_xview[0] * argument0, view_yview[0] + argument4 + view_yview[0] * argument0, view_xview[0] + argument3 + (view_xview[0] + view_wview[0]) * argument0, view_yview[0] + argument4 + (view_yview[0] + view_hview[0]) * argument0, false)
// Draw the dots for each object
draw_set_alpha(argument1)
with(argument7) {
draw_set_color(argument8)
draw_circle(view_xview[0] + argument3 + x * argument0, view_yview[0] + argument4 + y * argument0, argument9, false)
}
with(argument10) {
draw_set_color(argument11)
draw_circle(view_xview[0] + argument3 + x * argument0, view_yview[0] + argument4 + y * argument0, argument12, false)
}
with(argument13) {
draw_set_color(argument14)
draw_circle(view_xview[0] + argument3 + x * argument0, view_yview[0] + argument4 + y * argument0, argument15, false)
}
// Move view to clicked point on minimap
if ((mouse_x >= view_xview[0] + argument3 and mouse_x <= view_xview[0] + argument3 + (argument0 * room_width)) and (mouse_y >= view_yview[0] + argument4 and mouse_y <= view_yview[0] + argument4 + (argument0 * room_height)) and mouse_check_button(mb_left)) {
view_xview[0] = ((mouse_x - view_xview[0] - argument3) / argument0) - (view_wview[0] / 2)
view_yview[0] = ((mouse_y - view_yview[0] - argument4) / argument0) - (view_hview[0] / 2)
}
// Stops the view going outside the room
if (view_xview[0] < 0) {
view_xview[0] = 0
}
if (view_xview[0] > room_width - view_wview[0]) {
view_xview[0] = room_width - view_wview[0]
}
if (view_yview[0] < 0) {
view_yview[0] = 0
}
if (view_yview[0] > room_height - view_hview[0]) {
view_yview[0] = room_height - view_hview[0]
}
ejemplo adjunto que lo disfruten