Confused.

Posted by jester602 on June 27, 2006, 10:50 a.m.

I'm totally confused on a level I'm making, I want the platforms to move but when my char jumps on them they stop and I realize that the character would just slip off the platform.

Can somebody please help me with this :P. I want to make that level. D;

Comments

Alpha Man 17 years, 10 months ago

Make it check if the Character is on the platform, and if he is, he moves like the platform does… And how exactly are they moving and stopping from the character touching them? =/

djrellik 17 years, 10 months ago

I've submitted an example about making moving platforms like this but it is still in queue to be approved. Though I can still write you simple way to do it. I don't know what kind of platform you want (like horizontal or vertical) but making an horizontal on is very easy, vertical can be a bit harder.

For an horizontal put this code in the step event of the main character

{if place_meeting(x,y+1,****)

{myplatform = instance_place(x,y+1,****)

x += myplatform.hspeed}}

Change **** by the name of the platform object and be sure to make it solid.

oh and if you say that the char stop when you touch the platform, I suggest you to first, make your character not solid, and put this code in the collision event of the moving platform

{

if (vspeed > 0 && not place_free(x,y+vspeed)) move_contact(270);

vspeed = 0;

}

hope you understand what I said