Exemplo n.º 1
0
        private void Init(IAvatarPowerState state, IAvatarVerticalState action, IAvatarHorizontalState orientation)
        {
            TextureType            = typeof(Avatar);
            CollisionBox.ColorType = typeof(Avatar);

            PowerState      = state;
            VerticalState   = action;
            HorizontalState = orientation;

            Sprite = new AvatarSprite(this);
        }
Exemplo n.º 2
0
        public void Execute()
        {
            IAvatarPowerState oldPower = receiver.Level.Avatar.PowerState;

            receiver.LoadGameLevel(warp.Level);
            if (warp.X != null && warp.Y != null)
            {
                receiver.Level.Avatar.Position    = new Vector2((float)warp.X * 16, (float)warp.Y * 16);
                receiver.Level.CheckpointPosition = new Vector2((float)warp.X * 16, (float)warp.Y * 16);
            }
            receiver.Level.Avatar.PowerState = oldPower;
        }
Exemplo n.º 3
0
 public Avatar(TileMap level, Vector2 initPos, IAvatarPowerState state, IAvatarVerticalState action, IAvatarHorizontalState orientation) : base(level, initPos)
 {
     Init(state, action, orientation);
 }