Comunidad Game Maker

Ayuda => Preguntas y respuestas => Mensaje iniciado por: axel luna en Julio 03, 2014, 01:12:10 AM

Título: ayuda con mini mapa fps
Publicado por: axel luna en Julio 03, 2014, 01:12:10 AM
hola amigos

tengo una duda como podria crear un mini mapa para un juego fps creado con game maker 8, e intentado con los views pero me aparese un error en el modo 3d. elimino el views y el problema se arregla .
Título: Re:ayuda con mini mapa fps
Publicado por: am3500 en Julio 03, 2014, 03:51:46 AM
hola amigo estoy buscando ese codigo para ponerselo a mi juego online pero yo se hacer algo asi con las views como si el juego se pusiera pequeño enseñandote lo que esta adelante y tanbien me se un codigo para un radar para los enemigo ohhh cosa que quieres buscar por radar y
si quieres buscar otro code yo te ayudo XD on que no es estos que quieres verdad pero solo queria opinar jejejejeje  :P

GRUPO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html
Título: Re:ayuda con mini mapa fps
Publicado por: axel luna en Julio 03, 2014, 04:07:39 AM
Cita de: am3500 en Julio 03, 2014, 03:51:46 AM
hola amigo estoy buscando ese codigo para ponerselo a mi juego online pero yo se hacer algo asi con las views como si el juego se pusiera pequeño enseñandote lo que esta adelante y tanbien me se un codigo para un radar para los enemigo ohhh cosa que quieres buscar por radar y
si quieres buscar otro code yo te ayudo XD on que no es estos que quieres verdad pero solo queria opinar jejejejeje  :P

GRUPO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html


si asi tipo radar pero a la ves un mapa para que el jugador sepas en donde estas en el nivel del juego
sabes donde puedo consegir ese codec
Título: Re:ayuda con mini mapa fps
Publicado por: am3500 en Julio 03, 2014, 04:45:34 AM
claro que si yo te lo dare bien eso si que cambia los objetos ok
1-creas un scripts llamado
Citarscr_draw_motionblur
2-en ese scripts pones este codigo
//scr_draw_motionblur(speed,direction,x,y);

var len,dir,xp,yp,rot,i,quality,rotorig;

len=argument0;
dir=argument1;
xp=argument2;
yp=argument3;
rot=argument4;
rotorig=rot;
if(rot<0)
rot*=-1;

if(len>0||rot>0)
{
quality=3;
len/=quality;
rot/=quality*2;
rotorig/=quality*2;

var lenx,leny,times,rotinc;

times=rot;
if(len>times)
times=len;

lenx=0;
leny=0;
if(len>0)
{
lenx=lengthdir_x(len/times*quality,dir);
leny=lengthdir_y(len/times*quality,dir);
}

rotinc=rotorig/times*2*quality;

for(i=times;i>0;i-=1)
{
draw_sprite_ext(sprite_index,image_index,xp+i*lenx,yp+i*leny,image_xscale,image_yscale,image_angle+rotinc*i,image_blend,image_alpha/(times/2))
}
}else
draw_sprite_ext(sprite_index,image_index,xp,yp,image_xscale,image_yscale,image_angle,image_blend,image_alpha);

3-creas otro scripts llamado
Citardraw_circle_sector
4-y dentro de ese scripts pon este codigo /*  draw_circle_sector()
**  by SoulRed12
**
**  General form: draw_circle_sector(dir,rad,ang,seg,col,ful)
**
**  Argument list:
**    argument0 (dir):  current direction
**    argument1 (rad):  circle radius
**    argument2 (ang):  size of arc in degrees
**    argument3 (seg):  arc segments
**    argument4 (col):  color of lines
**
**  Usage: Draws a circle sector on the screen
*/
draw_set_color(argument4); //Set the color

//Draw a bunch of lines to approximate an arc
for (cc=-argument2/2; cc<argument2/2; cc+=argument2/argument3)
{
    draw_line(x+lengthdir_x(argument1,argument0+cc),y+lengthdir_y(argument1,argument0+cc),x+lengthdir_x(argument1,argument0+cc+argument2/argument3),y+lengthdir_y(argument1,argument0+cc+argument2/argument3));
}

//Now draw lines to show sides of circle sector
draw_line(x,y,x+lengthdir_x(argument1,argument0+argument2/2),y+lengthdir_y(argument1,argument0+argument2/2));
draw_line(x,y,x+lengthdir_x(argument1,argument0-argument2/2),y+lengthdir_y(argument1,argument0-argument2/2));


5-creas un objeto llamado radar o como quieras llamarle jejejeje  :P
6-dentro del objeto radar ledas al evento create y pones este codigo/code
rad=65; //the radius of the circle drawn for the base of the minimap
minRad=0; //the mini outline expanding circle's radius (starting) (this is only to give it that radar feel, you can take it out)
len=950; //the distance you want to see in the minimap
scale=len/rad; //the scale of the map (don't worry about why it's here)
alarm[0]=20; //the alarm which is used to increase the size of the mini expanding circle (if you don't want the expanding circle outline, take this out)

7-dale al evento que nose como se llama  :P que parese un relo y le pones el primero que es un 0 y ponle este codigo //if you don't want the expanding circle outline, take this out
if (minRad < rad) //if the radius of expanding circle is smaller than the radius of the minimap base
{
    minRad+=1; //add 1 onto the radius of the expanding circle
}
else //if the radius of expanding circle is greater than or equal the radius of the minimap base
{
    minRad=0; //set the radius of the expanding circle to 0
}
alarm[0]=2; //set this alarm again


vamos por el 8 o asi es  :P
aqui tienes que cambiar los nombre de los objetos
8-te dejo el codigo //to move into view if your view follows a player or something

//Minimap base:
draw_set_alpha(9.0); //set alpha to make the minimap partially transparent
draw_circle_color(x,y,rad,c_green,c_green,false); //draw the minimap base
//Expanding mini circle outline:
draw_set_alpha(4.0); //set alpha to make the line partially transparent
draw_circle_color(x,y,minRad,c_green,c_green,true); //draw the expanding mini circle
draw_set_alpha(1); //reset alpha to 1
//Outline of minimap base:
draw_circle(x,y,rad,true); //draw a basic outline of the base

with (Other) //draw the enemies (this loops through them)
{
    if (point_distance(objPlayer.x,objPlayer.y,x,y) < other.len) //if the distance between the player and the enemy is less than the radar's range (len)
    {
        draw_circle_color(other.x+(cos(degtorad(point_direction(objPlayer.x,objPlayer.y,x,y)))*(point_distance(objPlayer.x,objPlayer.y,x,y)/other.scale)),other.y-(sin(degtorad(point_direction(objPlayer.x,objPlayer.y,x,y)))*(point_distance(objPlayer.x,objPlayer.y,x,y)/other.scale)),2,c_red,c_red,false); //draw the enemy icon (basic circle)
    }
}
with (objPlayer) //draw the player
{
    draw_circle_color(other.x,other.y,2,c_yellow,c_yellow,false); //draw the player icon (basic circle)
}


olle bien con atencion donde dice objPlayer ahi va tu jugador y donde dice Other ahi ba la cosa ohh enemigo que quieres poner  asi que editalo como quieras  :P esque lo saque de mi juego online XD


GRUPO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html


ollle se me quito esto
Título: Re:ayuda con mini mapa fps
Publicado por: am3500 en Julio 03, 2014, 04:56:02 AM
olle perdon por durar tanto es que este internet ya me tiene halto  si halto por que soy dominicano
jejejejejejejejejeje perdon  :P  :-[

Grupo: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html
Informacion: http://gmunidad.blogspot.com/2014/06/informacion.html

amix si quieres ser parte de un proyecto que estamos creando entra a informacion
Informacion: http://gmunidad.blogspot.com/2014/06/informacion.html
Título: Re:ayuda con mini mapa fps
Publicado por: Clamud en Julio 03, 2014, 05:58:30 AM
Acabo de modificar el ejemplo del tutorial de FPS de Yoyo Games, le agregué este código (en el evento draw del objeto obj_gun):
[gml]
d3d_set_projection_ortho( obj_player.x-320, obj_player.y-240, 640, 480, -obj_player.direction+90 );
with( all ) { draw_self(); }
d3d_set_projection_ortho(0,0,640,480,0);
[/gml]
De ésta forma se ve un mapa al estilo Doom, necesitaría varios arreglos, pero tal vez te de ideas.
Título: Re:ayuda con mini mapa fps
Publicado por: axel luna en Julio 03, 2014, 07:15:00 PM
Cita de: am3500 en Julio 03, 2014, 04:45:34 AM
claro que si yo te lo dare bien eso si que cambia los objetos ok
1-creas un scripts llamado
Citarscr_draw_motionblur
2-en ese scripts pones este codigo
//scr_draw_motionblur(speed,direction,x,y);

var len,dir,xp,yp,rot,i,quality,rotorig;

len=argument0;
dir=argument1;
xp=argument2;
yp=argument3;
rot=argument4;
rotorig=rot;
if(rot<0)
rot*=-1;

if(len>0||rot>0)
{
quality=3;
len/=quality;
rot/=quality*2;
rotorig/=quality*2;

var lenx,leny,times,rotinc;

times=rot;
if(len>times)
times=len;

lenx=0;
leny=0;
if(len>0)
{
lenx=lengthdir_x(len/times*quality,dir);
leny=lengthdir_y(len/times*quality,dir);
}

rotinc=rotorig/times*2*quality;

for(i=times;i>0;i-=1)
{
draw_sprite_ext(sprite_index,image_index,xp+i*lenx,yp+i*leny,image_xscale,image_yscale,image_angle+rotinc*i,image_blend,image_alpha/(times/2))
}
}else
draw_sprite_ext(sprite_index,image_index,xp,yp,image_xscale,image_yscale,image_angle,image_blend,image_alpha);

3-creas otro scripts llamado
Citardraw_circle_sector
4-y dentro de ese scripts pon este codigo /*  draw_circle_sector()
**  by SoulRed12
**
**  General form: draw_circle_sector(dir,rad,ang,seg,col,ful)
**
**  Argument list:
**    argument0 (dir):  current direction
**    argument1 (rad):  circle radius
**    argument2 (ang):  size of arc in degrees
**    argument3 (seg):  arc segments
**    argument4 (col):  color of lines
**
**  Usage: Draws a circle sector on the screen
*/
draw_set_color(argument4); //Set the color

//Draw a bunch of lines to approximate an arc
for (cc=-argument2/2; cc<argument2/2; cc+=argument2/argument3)
{
    draw_line(x+lengthdir_x(argument1,argument0+cc),y+lengthdir_y(argument1,argument0+cc),x+lengthdir_x(argument1,argument0+cc+argument2/argument3),y+lengthdir_y(argument1,argument0+cc+argument2/argument3));
}

//Now draw lines to show sides of circle sector
draw_line(x,y,x+lengthdir_x(argument1,argument0+argument2/2),y+lengthdir_y(argument1,argument0+argument2/2));
draw_line(x,y,x+lengthdir_x(argument1,argument0-argument2/2),y+lengthdir_y(argument1,argument0-argument2/2));


5-creas un objeto llamado radar o como quieras llamarle jejejeje  :P
6-dentro del objeto radar ledas al evento create y pones este codigo/code
rad=65; //the radius of the circle drawn for the base of the minimap
minRad=0; //the mini outline expanding circle's radius (starting) (this is only to give it that radar feel, you can take it out)
len=950; //the distance you want to see in the minimap
scale=len/rad; //the scale of the map (don't worry about why it's here)
alarm[0]=20; //the alarm which is used to increase the size of the mini expanding circle (if you don't want the expanding circle outline, take this out)

7-dale al evento que nose como se llama  :P que parese un relo y le pones el primero que es un 0 y ponle este codigo //if you don't want the expanding circle outline, take this out
if (minRad < rad) //if the radius of expanding circle is smaller than the radius of the minimap base
{
    minRad+=1; //add 1 onto the radius of the expanding circle
}
else //if the radius of expanding circle is greater than or equal the radius of the minimap base
{
    minRad=0; //set the radius of the expanding circle to 0
}
alarm[0]=2; //set this alarm again


vamos por el 8 o asi es  :P
aqui tienes que cambiar los nombre de los objetos
8-te dejo el codigo //to move into view if your view follows a player or something

//Minimap base:
draw_set_alpha(9.0); //set alpha to make the minimap partially transparent
draw_circle_color(x,y,rad,c_green,c_green,false); //draw the minimap base
//Expanding mini circle outline:
draw_set_alpha(4.0); //set alpha to make the line partially transparent
draw_circle_color(x,y,minRad,c_green,c_green,true); //draw the expanding mini circle
draw_set_alpha(1); //reset alpha to 1
//Outline of minimap base:
draw_circle(x,y,rad,true); //draw a basic outline of the base

with (Other) //draw the enemies (this loops through them)
{
    if (point_distance(objPlayer.x,objPlayer.y,x,y) < other.len) //if the distance between the player and the enemy is less than the radar's range (len)
    {
        draw_circle_color(other.x+(cos(degtorad(point_direction(objPlayer.x,objPlayer.y,x,y)))*(point_distance(objPlayer.x,objPlayer.y,x,y)/other.scale)),other.y-(sin(degtorad(point_direction(objPlayer.x,objPlayer.y,x,y)))*(point_distance(objPlayer.x,objPlayer.y,x,y)/other.scale)),2,c_red,c_red,false); //draw the enemy icon (basic circle)
    }
}
with (objPlayer) //draw the player
{
    draw_circle_color(other.x,other.y,2,c_yellow,c_yellow,false); //draw the player icon (basic circle)
}


olle bien con atencion donde dice objPlayer ahi va tu jugador y donde dice Other ahi ba la cosa ohh
enemigo que quieres poner  asi que editalo como quieras  :P esque lo saque de mi juego online XD


GRUPO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html


ollle se me quito esto


grasias por el codigo amigo te lo agradesco mucho me interes tu idea de un juego online de gta tal ves participe
Título: Re:ayuda con mini mapa fps
Publicado por: am3500 en Julio 03, 2014, 07:36:52 PM
jejejejejeje no ahi de que agradecer XD  :P
Título: Re:ayuda con mini mapa fps
Publicado por: axel luna en Julio 03, 2014, 07:49:10 PM
Cita de: am3500 en Julio 03, 2014, 07:36:52 PM
jejejejejeje no ahi de que agradecer XD  :P

tengo una duda como podria colaborar con tu juego online
Título: Re:ayuda con mini mapa fps
Publicado por: am3500 en Julio 03, 2014, 08:16:08 PM
nose porque ahi diferentes cosas que hacer en este proyecto por ejemplo
1-grupo-code/codigos
2-grupo-draw/dibujar
3-grupo-fondos
4-grupo-sonido/musica
5-grupo-ideas
6-grupo-errores

en que grupo saves o deseas estar en el proyecto por ejemplo yo tengo ya la base del juego y todo echo nada mas faltan comensar a crear cosa yo estoy en casi todos los grupo porque si quieres puedes estar en todos como yo  :P   XD menos en el de fondo porque no se hacer ni un fondo bien XD pero puedes copera como quieras aqui en nuestro foro

FORO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html
Título: Re:ayuda con mini mapa fps
Publicado por: axel luna en Julio 03, 2014, 08:47:43 PM
Cita de: am3500 en Julio 03, 2014, 08:16:08 PM
nose porque ahi diferentes cosas que hacer en este proyecto por ejemplo
1-grupo-code/codigos
2-grupo-draw/dibujar
3-grupo-fondos
4-grupo-sonido/musica
5-grupo-ideas
6-grupo-errores

en que grupo saves o deseas estar en el proyecto por ejemplo yo tengo ya la base del juego y todo echo nada mas faltan comensar a crear cosa yo estoy en casi todos los grupo porque si quieres puedes estar en todos como yo  :P   XD menos en el de fondo porque no se hacer ni un fondo bien XD pero puedes copera como quieras aqui en nuestro foro

FORO: http://gmunidad.blogspot.com/2014/06/que-estas-pensando.html



participare en todo los foro enviame un mp se accepta mi colaboracion te mande un mp con alguna contradicciones que tengo este mes