• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Angular Damping without Physics.

N

NoFontNL

Guest
Hi all! I've wooden blocks. (rectangles) and I added gravity with the code:
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
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.
 
I

icuurd12b42

Guest
Enable Physics and learn how it works... 4-8 hours of learning... as opposed to 4-8 days to try to do it yourself
 
Top