soy usuario avanzado de game maker y me gusta hacer niveles
mi correo etebanguitierres@gmail.com
mi correo etebanguitierres@gmail.com
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.
if keyboard_check_pressed(ord("C")) and !keyboard_check_pressed(ord("X"))
{
solo patada
}
else
{
combo
}
sp=20
sp1=sp//velocidad a la derecha
sp2=sp// velocidad a la izquierda
col=0
//detecta a cada pixel antes de moverse 20 pixeles por delante
for(i=0;i<sp;i+=1)
{
if place_meeting(bbox_right+i,y,pv)
{ x+=i sp1=0 }
if place_meeting(bbox_left-i,y,pv)
{x-=i sp2=0 }
}
//al apretas izquierda va para la izquierda a la velocidad de "sp"
if keyboard_check(vk_left)
{
x-=sp2
sp1=sp
}
//al apretas derecha va para la derecha a la velocidad de "sp"
if keyboard_check(vk_right)
{
x+=sp1
sp2=sp
}
//gravedad
if !place_meeting(x,y+1,ph)
{
y+=0.5
}
//si no colisiono co la pared vertical se reinicia la velocidades
if !place_meeting(x,y,pv)
{
sp1=sp
sp2=sp
}
/*
* player_get_angle( x, y, angle );
*
* =============================================
*
* This functions returns the angle of the surface at the given position & angle.
*
*/
/* This is one of the pilars of the game engine, the angle detection.
This might appear hard at the first sight but the truth is that it's a
very easy and simple method. The concept of this method is having two sensors
or spots, both at each side of the player in a distance of like... 8 pixels.
And start pushing down those two sensors or spots a limited amount of times
until they collide with any obstacle object. When this happens, the only
thing we have to do is calculate the slope or angle between those two points.
In Game Maker the function used is "point_direction" in order to calculate
the angle between the two points.
*/
// Temporal values
temporal_mask = mask_index;
mask_index = maskDot;
// Limit the angle we're using from 360 directions to 36 for preventing thikering
// when detecting the collision
argument2 = round(argument2 / 10) * 10;
// Set the starting position of the sensors (depending on angle)
point_1_x = argument0 - cos(degtorad(argument2)) * 7; // Left point
point_1_y = argument1 + sin(degtorad(argument2)) * 7;
point_2_x = argument0 + cos(degtorad(argument2)) * 7; // Right point
point_2_y = argument1 - sin(degtorad(argument2)) * 7;
// Now, perform the checking. Push down the two points in order to know the angle
repeat(18) // Repeat a limited amount of times
{
if (player_collision(floor(point_1_x), floor(point_1_y), layer) == false)
{
point_1_x += sin(degtorad(argument2));
point_1_y += cos(degtorad(argument2));
}
if (player_collision(floor(point_2_x), floor(point_2_y), layer) == false)
{
point_2_x += sin(degtorad(argument2));
point_2_y += cos(degtorad(argument2));
}
}
// Return to the old mask
mask_index = temporal_mask;
// Calculate the direction
return floor(point_direction(point_1_x,point_1_y,point_2_x,point_2_y));
Page generada en 0.123 segundos con 12 consultas.