N
NoFontNL
Guest
Hi all! I've wooden blocks. (rectangles) and I added gravity with the code:
This is what happens (perfectly as expected) http://prntscr.com/j2hjpo
How can I add angular damping? Or if not possible, how to do it with physics. (I don't know anything about physics so yeah.)
Thank you ^^.
EDIT: I want it to fall as in the real world. You know balancing stuff.
Code:
///Create Event
grav = 0.8;
vsp = 0;
hsp = 0;
///Step event
if vsp < 100 vsp+=grav;
if (place_meeting(x,y+vsp,par_ground)) {
while !(place_meeting(x,y+sign(vsp),par_ground)) {
y+= sign(vsp);
}
vsp = 0
}
y += vsp;
if (place_meeting(x+hsp,y,par_ground)) {
while !(place_meeting(x+sign(hsp),y,par_ground)) {
x+= sign(hsp);
}
hsp = 0
}
x+=hsp
How can I add angular damping? Or if not possible, how to do it with physics. (I don't know anything about physics so yeah.)
Thank you ^^.
EDIT: I want it to fall as in the real world. You know balancing stuff.