Legacy GM Motion_add with Collisions (need hints)

NazGhuL

NazTaiL
Hi guys!

I have to admit that i'm not good with collision to simulate an actual, well, collision!
For the past years I tried a couple of time going for a platformer and can only recreate basic hspd and vspd collision. I need to go further into this and i'm seriously tired to fail... :confused:

So simply a ship flying around using motion_add because I like the way it drifts when you rotate it.
Gravity pulls you in 1 direction. Simple enough.
Here is the code:

Code:
var key_up = keyboard_check(vk_up);
var key_left = keyboard_check(vk_left);
var key_right = keyboard_check(vk_right);

if(key_up)
{
motion_add(Direction, 0.1);
}
else
{
speed -= Friction;
}
speed = clamp(speed, 0, Speed_Max);

if(key_left)
{
Direction += Rotation_Speed;
image_angle += Rotation_Speed;
}
if(key_right)
{
Direction -= Rotation_Speed;
image_angle -= Rotation_Speed;
}
I use the built-in variable for speed only. So what's next? I want to bump on walls! That's it! I can't paste you any code, I tried so many things thinking I used it well but nope...Can't understand where I am failing. Using the motion_add, the x/y coordinates looks like there are not updated on the step event but in the end step. Well, I think... I don't need any detailed code. Just hints and guideline. I'm not sure how to translate basic hspeed and vspeed to create a 'motion_add'. Thx.
 
S

Snail Man

Guest
Isn't motion_add compatible with hspeed/vspeed collisions? I thought they used the same system.
 
Top