home *** CD-ROM | disk | FTP | other *** search
- package elements
- {
- import flash.display.MovieClip;
- import game.Model;
-
- public class HeadItem extends Item
- {
-
-
- private var __height:Number = 2;
-
- private var model:Model;
-
- private var rotate:Number;
-
- private var offset:Number = 10;
-
- public var _man:MovieClip;
-
- private var __width:Number = 7;
-
- public function HeadItem(param1:Number = 0, param2:Number = 0)
- {
- offset = 10;
- __height = 2;
- __width = 7;
- super(param1,param2 - offset,__width,__height);
- model = Model.getInstance();
- }
-
- public function setSize0() : void
- {
- itemHeight = itemWidth = 2;
- this.x = this.tx = this.xPosition = group.items[0].tx;
- this.y = this.ty = this.yPosition = group.items[0].ty;
- }
-
- public function resetPosition(param1:Number, param2:Number) : void
- {
- if(group.items.length > 1)
- {
- switch(Math.round(rotate / 90))
- {
- case 0:
- this.x = this.tx = this.xPosition = param1;
- this.y = this.ty = this.yPosition = param2 - offset;
- break;
- case 1:
- this.x = this.tx = this.xPosition = param1 - offset;
- this.y = this.ty = this.yPosition = param2;
- break;
- case 2:
- this.x = this.tx = this.xPosition = param1;
- this.y = this.ty = this.yPosition = param2 + offset;
- break;
- case 3:
- this.x = this.tx = this.xPosition = param1 + offset;
- this.y = this.ty = this.yPosition = param2;
- }
- }
- }
-
- override public function set rotation(param1:Number) : void
- {
- super.rotation = -param1;
- rotate = param1;
- resetPosition(group.items[0].tx,group.items[0].ty);
- if(Math.round(param1 / 90) % 2 == 0)
- {
- itemHeight = __height;
- itemWidth = __width;
- }
- else
- {
- itemHeight = __width;
- itemWidth = __height;
- }
- }
- }
- }
-