I have a water animation entity and i want to add it to the background entity i gave up this idea and adding to the world but it still doesn’t work.
i am thinking now Backdrop can’t be put in Graphiclist ??? but in the document it says:
A Graphic that can contain multiple Graphics of one or various types. Useful for drawing sprites with multiple different parts, etc.
can any one help me please
public class WaterEntity extends Entity
{
private var waterPart1:Backdrop = new Backdrop(HD_Assets.WATER_FRONT);
private var waterPart2:Backdrop = new Backdrop(HD_Assets.WATER_BACK);
public var speed:Number = 2;
private var background:Graphiclist;
public function WaterEntity()
{
super();
}
override public function added():void
{
super.added();
waterPart1 = new Backdrop(HD_Assets.WATER_FRONT, true, false);
waterPart1.y = FP.screen.height - waterPart1.height;
waterPart2 = new Backdrop(HD_Assets.WATER_BACK, true, false);
waterPart2.y = FP.screen.height - waterPart1.height +5;
background.add(waterPart1);
background.add(waterPart2);
graphic = background;
}
override public function update():void
{
waterPart1.x += speed;
waterPart2.x -= speed + 3;
}
}