pixeltroid
Member
The platforms move the way I want them to but whats happening is that when the player jumps on the moving platform, he just slides away to the right!
objects used:
1. obj_movingplatform
2. obj_player
3. obj_blocker (an invisible object placed at the end of the moving platforms path)
-------------------------------------
1. for obj_movingplatform
Create:
Step:
Collision with obj_solid (used for floors, walls, ceilings etc):
Collision with obj_blocker that limits movement of platform is same as above
2. For obj_player
Collision with obj_movingplatform
What am I doing wrong with the code???? How can I modify the code to make it work?
objects used:
1. obj_movingplatform
2. obj_player
3. obj_blocker (an invisible object placed at the end of the moving platforms path)
-------------------------------------
1. for obj_movingplatform
Create:
Code:
vspeed = 2
Code:
with (obj_player)
{
if (place_meeting(x,y-4, obj_blocker))
{
with (obj_movingplat)
{
vspeed = 2;
}
}
}
Code:
if (vspeed > 0)
{
vspeed = -2;
}
else
{vspeed = 2;
}
if (place_meeting(x,y-1,obj_player))
{
obj_player.y -=5;
}
2. For obj_player
Collision with obj_movingplatform
Code:
{
move_contact_solid(direction, 3);
vspeed = other.vspeed;
}
What am I doing wrong with the code???? How can I modify the code to make it work?
Last edited: