# Scale Movieclips (Enemies) Added To Stage - Close=Bigger Far=Smaller

**URL:** <https://forum.kirupa.com/t/scale-movieclips-enemies-added-to-stage-close-bigger-far-smaller/328951>\
**Category:** flash\
**Created:** [July 5, 2012, 8:45pm UTC](https://forum.kirupa.com/t/scale-movieclips-enemies-added-to-stage-close-bigger-far-smaller/328951 "2012-07-05T20:45:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ravenhawke](https://avatars.discourse-cdn.com/v4/letter/r/76d3ee/32.png) [@ravenhawke](https://forum.kirupa.com/u/ravenhawke)\
**Post date:** [July 5, 2012, 8:45pm UTC](https://forum.kirupa.com/t/scale-movieclips-enemies-added-to-stage-close-bigger-far-smaller/328951/1 "2012-07-05T20:45:42Z")

</div>

[FONT=Verdana]I am creating a game, mostly for learning, but its also fun. I am adding enemies to the stage, ships, and i want them to sail across, which they do. But I don’t know how to make them look smaller if they are farther away (higher on the stage) or big if they are close (lower on the stage) help? thanks in advance.[/FONT]

[FONT=Verdana]Here is my ship class code:

[/FONT]

```auto
package{    
    import flash.display.Sprite;
    import flash.display.Graphics;
    import flash.text.TextField;
    import flash.display.MovieClip;
 
    public class Enemy extends MovieClip{
        private var health_txt:TextField;
        private var health:int;
        private var speed_x:Number;
        private var speed_y:Number;
        private var scale_x:Number;
        private var scale_y:Number;

        public function Enemy() {
            health = 2;
            speed_x = -1.5;
            speed_y = 0;
            addShip();
            draw();
        }
        
        private function addShip():void{
            var newShip:testShip = new testShip();
            this.addChild(newShip);
        }
        
        private function draw():void {        
            health_txt = new TextField();
            health_txt.height = 40; health_txt.width = 30;
            health_txt.textColor = 0xffffff;
            health_txt.x = 40;
            health_txt.y = -40;
            health_txt.text = health + "";
            addChild(health_txt);
        }
         
        public function update():void {
            x += speed_x;
            y += speed_y;
        }
        public function updateHealth(amount:int):int {
            health += amount;
            health_txt.text = health + "";
            return health;
        }
    }
}

```

[FONT=Verdana]  
[/FONT]
