Hello guys. So i am making a rolling platform witch will move every entity it has on it in a direction.Everything was fine until i tried to put 2 entities on the platform. In this case it moves the 1st entity it founds to collide with.I don’t really know what i’m doing wrong ,but can you guys help me find a way to make the platform move every entity that it is on it? here is the code i use:
private function makeThingsMove():void
{
const MOVE_SPED:Number = 2;
const TYPES:Array = ["Player","Crate"];
var e:Entity;
if ((e = collideTypes(TYPES, x, y - 1))) {
e.moveBy( -MOVE_SPED, 0, G.entTypes);
}
}
Thx.