B
Bhreno
Guest
The obj_player has a pixel problem (-1) in collision with the wall, when it is on a platform that stops moving when it collides with this same wall. Even on the mobile platform, it must hit a wall when x + 1 or x-1 is a wall; however, it is stopping 1 pixel before and it is getting a vacant pixel between it and the wall.
The problem occurs when the obj_player is on a platform, and some x in front of it.
"colid 3": before the collision with wall (moving).
"colid 1": it worked.
"colid 2": did not work. This problem. The platform collides correctly, but the obj_player is 1 pixel away (sometimes, sometimes it hits).
CODE in STEP PLATFORM:
The problem occurs when the obj_player is on a platform, and some x in front of it.
"colid 3": before the collision with wall (moving).
"colid 1": it worked.
"colid 2": did not work. This problem. The platform collides correctly, but the obj_player is 1 pixel away (sometimes, sometimes it hits).
CODE in STEP PLATFORM:
GML:
case oPlataGroundRight:
var wallCollision = place_meeting(x+(_hspd+1), y, oSolid);
if (wallCollision)
{
_hspd = 0;
}
else
{
_hspd = _moveSpeed;
};
if place_meeting(x,y-15,obj_player) && place_meeting(x,y-47,obj_player)
{
x += _hspd;
with(obj_player)
{
if(!place_meeting(x+(other._hspd),y,oSolid))
{
x+= other._hspd;
}}}
break;
Attachments
-
1.6 KB Views: 1
-
3.3 KB Views: 1
-
3.2 KB Views: 1