Arlan64
Member
Hello guys!
I'm stuck with some complexes codes (bc i'm a noob but nvm) when I try to put friction physics to create an awesome ice block for place it on my rooms.
I search to set the friction at 0.4 at begin of the hsp movement, and to set the friction at -0,4 at end of the hsp movement
I'll put my codes affected with I want to find:
Create Event:
Step Event:
(And sorry if my english is really disgusting, I'm french...)
I'm stuck with some complexes codes (bc i'm a noob but nvm) when I try to put friction physics to create an awesome ice block for place it on my rooms.
I search to set the friction at 0.4 at begin of the hsp movement, and to set the friction at -0,4 at end of the hsp movement
I'll put my codes affected with I want to find:
Create Event:
Code:
hsp = 0;
movespeed_normal = 6;
movespeed = movespeed_normal;
Code:
//Les commandes
key_right = keyboard_check(vk_right);
key_left = -keyboard_check(vk_left);
key_jump = keyboard_check(vk_up);
key_jump_held = keyboard_check(vk_up);
key_jump_pressed = keyboard_check_pressed(vk_up);
key_down = -keyboard_check_pressed(vk_down);
key_down_held = -keyboard_check(vk_down);
key_space_pressed = keyboard_check_pressed(vk_space);
//Réactions aux déplacements basiques
move = key_left + key_right;
hsp = move * movespeed;
{if (vsp < 10)
{
vsp += grav_normal;
}
}
//Prise d'appui au sol pour sauter
{if place_meeting(x,y+1,obj_floor)
{
if (key_jump) vsp = -jumpspeed;
}
}
///Collisions avec le sol/mur
//Collision horizontale
{if place_meeting(x+hsp,y,obj_floor)
{
while !place_meeting(x+sign(hsp),y,obj_floor)
{
x += sign(hsp);
}
hsp = 0;
}
}
x += hsp;
//Collision verticale
{if place_meeting(x,y+vsp,obj_floor)
{
while(!place_meeting(x,y+sign(vsp),obj_floor))
{
y += sign(vsp);
}
vsp = 0;
}
}
y += vsp;