creo que "draw_getpixel" y "color_get_hue" te podrian servir, o por lo menos asi seria en 3D
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
62
Juegos en desarrollo / Re: CGM The Game: CORRUPTION [COLABORA, TE NECESITAMOS] [(v0.3)] [63%]
Junio 19, 2011, 12:59:51 PM
este mes terminan el juego???
63
Preguntas y respuestas / Equivalestes de GM6 y GM8
Junio 17, 2011, 11:25:30 AM
cuales son los argumentos de :
[gml]background_create_from_screen()
background_replace()
sprite_replace()[/gml]
y cual seria su equivalente en GM8?
+1 al que me resulva
[gml]background_create_from_screen()
background_replace()
sprite_replace()[/gml]
y cual seria su equivalente en GM8?
+1 al que me resulva
64
Preguntas y respuestas / Re: Posicicion segun direccion del personaje(2D o 3D)
Junio 14, 2011, 06:16:28 AM
ya repare los link, estaban mal adjuntos.
lo del image angle y direction ya se, lo que kiero es que el balon se situe 10 pixiles por delante del personaje, que si el personaje gira, el balon se mueva a la mueva posicion delante del personaje, parecido al movimiento de la luna alrederor de la tierra. En el editable 3D se explica un poco mas grafico
lo del image angle y direction ya se, lo que kiero es que el balon se situe 10 pixiles por delante del personaje, que si el personaje gira, el balon se mueva a la mueva posicion delante del personaje, parecido al movimiento de la luna alrederor de la tierra. En el editable 3D se explica un poco mas grafico
65
Preguntas y respuestas / Posicicion segun direccion del personaje(2D o 3D)
Junio 13, 2011, 11:10:08 AM
el titulo lo dice todo, nesecito un codigo para hacer que el balon se mueva a una nueva posicion dependiendo de su direccion, como todos los tradicionales juegos de futbol.
adjunto los editable
2D = rotacion y point_dir.gmk
3D = gol.rar
adjunto los editable
2D = rotacion y point_dir.gmk
3D = gol.rar
66
Preguntas y respuestas / Re: Problema al colisionar con esquina (Ayuda)
Junio 13, 2011, 04:47:11 AM
te recomiendo usar este script, que ademas permite slopes y doble salto(editable)
[gml]/*
** Usage:
** motion(left,up,right);
**
** Author:
** Brian 'brod' Rodriguez
**
** Arguments:
** left make object move to the left
** up make object move up (jump)
** right make object move to the right
*/
// NOTES
//////////
/*
** There are a number of variables that need to be
** called before you can use these scripts. They are
** found in objTest create event.
** Before you read, here are some notes about some of the
** functions I use.
** Functions:
** floor() returns the number given without any decimals. (floor(1.34)=1)
** ceil() returns the number given without any decimals and 1# higher. (floor(1.34)=2)
** sign() returns the sign of the number. (Negative(-1)/Positive(+1)/None(0))
** min() returns the smallest number among the arguments. (min(1,3,103)=1/min(3,103,234)=3/min(103,234,834)=103)
** max() returns the largest number among the arguments. (max(103,234,834)=834/max(3,103,234)=234/max(1,3,103)=103)
** abs() returns the number's distance from 0. (It makes negative numbers positive, if they're not positive)
*/
// CONTROLS
/////////////
if (argument0 == true) //If the object is supposed to move right
{
spr_dir = 1; //Change the object's direction
hsp = min(max_speed, hsp + acc_speed); //Make the hsp increase by ACC_SPEED until MAX_SPEED has been reached
}
if (argument1 == true) //If the object is supposed to jump
{
if (free == false) && (hold == false)
//Make sure that they're on a floor (FREE=0) and that they haven't been holding the jump key (HOLD=0)
{
vsp =-jmp_speed; //Jump!
hold = true; //The key has been pressed!
jump = 1; //The object has begun jumping
} else if (free == true) && (hold == true) && (sign(vsp) == -1) {
vsp-= grv_speed/2;
}
if (jump >= 1) && (hold == false) && (jump < max_jump) //Now, check if the object has already begun jumping(JUMP>=1),
{ //the object has pressed the jump key again (HOLD=0) and that the object hasn't reached the max amount of
//extra jumps (JUMP<MAX_JUMP)
vsp =-jmp_speed; //Jump again!
hold = true; //Them key has been pressed!
jump+= 1; //Let the script know that the object has jumped again
}
} else hold = false; //If jump key is not pressed, then that means it has been let go. So reset it.
if (argument2 == true) //If the object is supposed to move left
{
spr_dir =-1; //Change the object's direction
hsp = max(-max_speed, hsp - acc_speed); //Make the hsp increase by ACC_SPEED until MAX_SPEED has been reached
}
// HORIZONTAL MOVEMENT
////////////////////////
repeat (ceil(abs(hsp)))
//This is to make sure, the code executes the code a POSITIVE(abs) amount of times, and also an INTEGER(floor / no decimals)
{
var blk, mov;
blk = place_meeting(x + sign(hsp), y, parSolid);
//This checks, if there's a solid in the way of the object (1=Yes, 0=No)
mov = false;
if (blk == true) //There's a solid in the way! Now, to check if it's a slope
{
for (a = 1; a <= max_slp; a+=1)
//Loop to find all possible heights, starting w/ the smallest gap (1px high) to largest gap ((max_slp)px high)
{
if (place_meeting(x + sign(hsp), y - a, parSolid) == false)
//There is an empty space above it! So it IS a slope!
{
x += sign(hsp); //Move forward!
y -= a; //Move UP the slope
mov = true; //The object has moved!
break; //Stop checking for slopes, b/c the object just moved up one
}
}
if (mov == false) //If the object HAS NOT moved..
{
hsp = 0; //That must mean there was no slope. So stop the object from moving
}
} else { //There's nothing stopping the object. So now the code will check if there's a downwards slope.
for (a = max_slp; a >= 1; a-=1)
//Loop to find all possible heights, starting w/ the lowest slope ((max_slp)px below) to highest slope (1px below)
{
if (place_meeting(x + sign(hsp), y + a, parSolid) == false)
//There is an empty space below the solid! So it might be a slope!
{
if (place_meeting(x + sign(hsp), y + a + 1, parSolid) == true)
//Now check that there's a solid below that empty pixel (or else you'll go down to an empty space)
{
x += sign(hsp); //Move Forward
y += a; //Move DOWN the slope
mov = true; //The object has moved!
}
}
}
if (mov == false) //If the object has NOT moved
{
x+= sign(hsp); //Then that must mean there was no slope. So let the object go on it's way (b/c remember,
//there was no solid soliding the path!)
}
}
}
// VERTICAL MOVEMENT
//////////////////////
repeat (ceil(abs(vsp)))
//This is to make sure, the code executes the code a POSITIVE(abs) amount of times, and also an INTEGER(floor / no decimals)
{
if (place_meeting(x, y + sign(vsp), parSolid) == true) //If the object is above/below a solid
{
vsp = 0; //Then stop the object from moving
} else { //If the object is not on a solid..
if (vsp != 0) //If the vsp is not 0
{
y+= sign(vsp); //Move!
}
}
}
free = !place_meeting(x, y + 1, parSolid); //Check if it's in air (true = in air, false = on ground)
// GRAVITY & FRICTION
///////////////////////
if (free == true) //The object is not on ground
{
vsp+= grv_speed; //The object is falling, so make it fall!
if (argument0 == false) && (argument2 == false) { hsp = max(0, abs(hsp) - air_frict)*sign(hsp); }
//If the object is not moving, then slow the object down by the given AIR_FRICTion until it has stopped (0)
}
if (free == false) //The object is on ground
{
jump = 0; //The object has stopped jumping.
if (argument0 == false) && (argument2 == false) { hsp = max(0, abs(hsp) - gnd_frict)*sign(hsp); }
//If the object is not moving, then slow the object down by the given GrouND_FRICTion until it has stopped (0)
}
[/gml]
En el objeto del personaje usa lo siguiente:
CREATE
[gml]image_index = floor(random(image_number));
image_speed = 0;
//////////////////////
// Object Variables //
//////////////////////
//Mandatory variables. Don't get rid of these!
hsp = 0; //hspeed replacement
vsp = 0; //vspeed replacement
jump = 0; //Just a variable to check how many jumps you've made
free = 1; //Whether you're in the air (1) or on the ground (0)
spr_dir = 1; //Sprite direction (useful for image_xscale)
hold = 0; //Whether you're holding the left/right key
//Modify these to your heart's content.
grv_speed = 1; //Speed at which vsp increases
air_frict = 0.15; //Number to decrease hsp by when no key is pressed in air
gnd_frict = 0.85; //Number to decrease hsp by when no key is pressed on ground
max_slp = 2; //Highest slope (in px)
max_speed = 4; //Max speed to go by
acc_speed = 0.5; //How much to increase the hsp by
jmp_speed = 6; //How many pixels per step you jump by(decreases by grv_speed every step)
max_jump = 2; //Maximum amount of times you can jump before falling to ground(Starting from ground)[/gml]
STEP
[gml]motion(keyboard_check(vk_right) == true, keyboard_check(vk_up) == true, keyboard_check(vk_left) == true);
if (jump == max_jump) || (free == false) { max_jump = 2; } //Reset the max amount of jumps whenever you hit ground, or you're reached the max jump
//wrap in both direction when outside
[/gml]
PD: me funciona en 2D y 3D
[gml]/*
** Usage:
** motion(left,up,right);
**
** Author:
** Brian 'brod' Rodriguez
**
** Arguments:
** left make object move to the left
** up make object move up (jump)
** right make object move to the right
*/
// NOTES
//////////
/*
** There are a number of variables that need to be
** called before you can use these scripts. They are
** found in objTest create event.
** Before you read, here are some notes about some of the
** functions I use.
** Functions:
** floor() returns the number given without any decimals. (floor(1.34)=1)
** ceil() returns the number given without any decimals and 1# higher. (floor(1.34)=2)
** sign() returns the sign of the number. (Negative(-1)/Positive(+1)/None(0))
** min() returns the smallest number among the arguments. (min(1,3,103)=1/min(3,103,234)=3/min(103,234,834)=103)
** max() returns the largest number among the arguments. (max(103,234,834)=834/max(3,103,234)=234/max(1,3,103)=103)
** abs() returns the number's distance from 0. (It makes negative numbers positive, if they're not positive)
*/
// CONTROLS
/////////////
if (argument0 == true) //If the object is supposed to move right
{
spr_dir = 1; //Change the object's direction
hsp = min(max_speed, hsp + acc_speed); //Make the hsp increase by ACC_SPEED until MAX_SPEED has been reached
}
if (argument1 == true) //If the object is supposed to jump
{
if (free == false) && (hold == false)
//Make sure that they're on a floor (FREE=0) and that they haven't been holding the jump key (HOLD=0)
{
vsp =-jmp_speed; //Jump!
hold = true; //The key has been pressed!
jump = 1; //The object has begun jumping
} else if (free == true) && (hold == true) && (sign(vsp) == -1) {
vsp-= grv_speed/2;
}
if (jump >= 1) && (hold == false) && (jump < max_jump) //Now, check if the object has already begun jumping(JUMP>=1),
{ //the object has pressed the jump key again (HOLD=0) and that the object hasn't reached the max amount of
//extra jumps (JUMP<MAX_JUMP)
vsp =-jmp_speed; //Jump again!
hold = true; //Them key has been pressed!
jump+= 1; //Let the script know that the object has jumped again
}
} else hold = false; //If jump key is not pressed, then that means it has been let go. So reset it.
if (argument2 == true) //If the object is supposed to move left
{
spr_dir =-1; //Change the object's direction
hsp = max(-max_speed, hsp - acc_speed); //Make the hsp increase by ACC_SPEED until MAX_SPEED has been reached
}
// HORIZONTAL MOVEMENT
////////////////////////
repeat (ceil(abs(hsp)))
//This is to make sure, the code executes the code a POSITIVE(abs) amount of times, and also an INTEGER(floor / no decimals)
{
var blk, mov;
blk = place_meeting(x + sign(hsp), y, parSolid);
//This checks, if there's a solid in the way of the object (1=Yes, 0=No)
mov = false;
if (blk == true) //There's a solid in the way! Now, to check if it's a slope
{
for (a = 1; a <= max_slp; a+=1)
//Loop to find all possible heights, starting w/ the smallest gap (1px high) to largest gap ((max_slp)px high)
{
if (place_meeting(x + sign(hsp), y - a, parSolid) == false)
//There is an empty space above it! So it IS a slope!
{
x += sign(hsp); //Move forward!
y -= a; //Move UP the slope
mov = true; //The object has moved!
break; //Stop checking for slopes, b/c the object just moved up one
}
}
if (mov == false) //If the object HAS NOT moved..
{
hsp = 0; //That must mean there was no slope. So stop the object from moving
}
} else { //There's nothing stopping the object. So now the code will check if there's a downwards slope.
for (a = max_slp; a >= 1; a-=1)
//Loop to find all possible heights, starting w/ the lowest slope ((max_slp)px below) to highest slope (1px below)
{
if (place_meeting(x + sign(hsp), y + a, parSolid) == false)
//There is an empty space below the solid! So it might be a slope!
{
if (place_meeting(x + sign(hsp), y + a + 1, parSolid) == true)
//Now check that there's a solid below that empty pixel (or else you'll go down to an empty space)
{
x += sign(hsp); //Move Forward
y += a; //Move DOWN the slope
mov = true; //The object has moved!
}
}
}
if (mov == false) //If the object has NOT moved
{
x+= sign(hsp); //Then that must mean there was no slope. So let the object go on it's way (b/c remember,
//there was no solid soliding the path!)
}
}
}
// VERTICAL MOVEMENT
//////////////////////
repeat (ceil(abs(vsp)))
//This is to make sure, the code executes the code a POSITIVE(abs) amount of times, and also an INTEGER(floor / no decimals)
{
if (place_meeting(x, y + sign(vsp), parSolid) == true) //If the object is above/below a solid
{
vsp = 0; //Then stop the object from moving
} else { //If the object is not on a solid..
if (vsp != 0) //If the vsp is not 0
{
y+= sign(vsp); //Move!
}
}
}
free = !place_meeting(x, y + 1, parSolid); //Check if it's in air (true = in air, false = on ground)
// GRAVITY & FRICTION
///////////////////////
if (free == true) //The object is not on ground
{
vsp+= grv_speed; //The object is falling, so make it fall!
if (argument0 == false) && (argument2 == false) { hsp = max(0, abs(hsp) - air_frict)*sign(hsp); }
//If the object is not moving, then slow the object down by the given AIR_FRICTion until it has stopped (0)
}
if (free == false) //The object is on ground
{
jump = 0; //The object has stopped jumping.
if (argument0 == false) && (argument2 == false) { hsp = max(0, abs(hsp) - gnd_frict)*sign(hsp); }
//If the object is not moving, then slow the object down by the given GrouND_FRICTion until it has stopped (0)
}
[/gml]
En el objeto del personaje usa lo siguiente:
CREATE
[gml]image_index = floor(random(image_number));
image_speed = 0;
//////////////////////
// Object Variables //
//////////////////////
//Mandatory variables. Don't get rid of these!
hsp = 0; //hspeed replacement
vsp = 0; //vspeed replacement
jump = 0; //Just a variable to check how many jumps you've made
free = 1; //Whether you're in the air (1) or on the ground (0)
spr_dir = 1; //Sprite direction (useful for image_xscale)
hold = 0; //Whether you're holding the left/right key
//Modify these to your heart's content.
grv_speed = 1; //Speed at which vsp increases
air_frict = 0.15; //Number to decrease hsp by when no key is pressed in air
gnd_frict = 0.85; //Number to decrease hsp by when no key is pressed on ground
max_slp = 2; //Highest slope (in px)
max_speed = 4; //Max speed to go by
acc_speed = 0.5; //How much to increase the hsp by
jmp_speed = 6; //How many pixels per step you jump by(decreases by grv_speed every step)
max_jump = 2; //Maximum amount of times you can jump before falling to ground(Starting from ground)[/gml]
STEP
[gml]motion(keyboard_check(vk_right) == true, keyboard_check(vk_up) == true, keyboard_check(vk_left) == true);
if (jump == max_jump) || (free == false) { max_jump = 2; } //Reset the max amount of jumps whenever you hit ground, or you're reached the max jump
//wrap in both direction when outside
[/gml]
PD: me funciona en 2D y 3D
67
Preguntas y respuestas / Re: Uso de FPS [SOLUCIONADO]
Junio 13, 2011, 04:41:14 AM
crea que con eso si me conformo y doy como solucionado, no doy karma porque son muchos los que me aportaron, gracias a todos lo que aportaron en este post para resolver mi duda!
68
Preguntas y respuestas / Re: Uso de FPS
Junio 12, 2011, 08:30:32 AMCita de: Wadk en Junio 01, 2011, 09:21:09 PMyo pienso que esto esta mal, haria que entre mas lento el fps mas rapido la speed y yo intento lo contrario(omitir animaciones menos importantes y/o detener el juego)
Pero yo dir?a que lo mejor es no hacer ninguna comprobaci?n de ese tipo, y usar algo as?:
[gml]speed = 5 * (room_speed / fps);[/gml]
As? la velocidad real es constante independientemente de los fps.
Pero esto trae todo tipo de problemas, no te lo recomendar?a.
69
Preguntas y respuestas / Re: Problema con una torreta
Junio 12, 2011, 07:47:11 AM
Casualmente estoy haciendo algo similar en un tds
[gml]if instance_exists(obj_enemigo)=true{//verifica si existe algun enemigo
ene=instance_nearest(x,y,obj_virus)//convierte la instancia en variable
if point_distance(x,y,ene.x,ene.y)<=rango//verifica si la instancia esta dentro del rango(rango=valor numerico positivo)
{/*codigo o script para disparar*/}[/gml]
[gml]if instance_exists(obj_enemigo)=true{//verifica si existe algun enemigo
ene=instance_nearest(x,y,obj_virus)//convierte la instancia en variable
if point_distance(x,y,ene.x,ene.y)<=rango//verifica si la instancia esta dentro del rango(rango=valor numerico positivo)
{/*codigo o script para disparar*/}[/gml]
70
Preguntas y respuestas / Re: Exportar archivo bloqueado-oculto-solo lectura
Junio 09, 2011, 06:03:33 AM
podrias hacerme un editable? que no logro hacer que funcione
71
Preguntas y respuestas / Re: ?Virus en mi juego?
Junio 06, 2011, 12:33:17 AM
intentaste escanear los recursos que utilizaste en el juego?(imagenes,sonidos, musicas,dll,etc)
72
Preguntas y respuestas / Re: Problema con la colision del jugador
Junio 05, 2011, 09:59:32 PM
talves este ejemplo te ayude
73
Preguntas y respuestas / Re: sprite que se hunde
Junio 05, 2011, 09:49:40 PM
Bugs reparados:
*personaje que se hunde
*colici?n con pez
*fondo (cielo)
*cada una de las texturas de cada objeto
*indicador de tiempo
Novedades y Mejoras:
*HUB
*Puntaje
Ademas he a?adido algunas sugerencias en el Contador y el Pez y mi nombre en la info :P por si eres de los que agradece con creditos.
*personaje que se hunde
*colici?n con pez
*fondo (cielo)
*cada una de las texturas de cada objeto
*indicador de tiempo
Novedades y Mejoras:
*HUB
*Puntaje
Ademas he a?adido algunas sugerencias en el Contador y el Pez y mi nombre en la info :P por si eres de los que agradece con creditos.
74
Preguntas y respuestas / Re: Exportar archivo bloqueado-oculto-solo lectura
Junio 05, 2011, 09:42:35 PM
probare haber si funciona, gracias, de resultar te doy +1
PD: todos los que resulvan mis dudas posteadas doy +1
PD: todos los que resulvan mis dudas posteadas doy +1
75
Preguntas y respuestas / Exportar archivo bloqueado-oculto-solo lectura
Junio 05, 2011, 06:30:59 PM
Es posible exportar un archivo bloqueado, oculto y/o de solo lectura y como se haria esto??
PD: ya se importar y exportar, mi razon es a?adirle atributos al archivo exportado
PD: ya se importar y exportar, mi razon es a?adirle atributos al archivo exportado