Beispiel #1
0
 private void DecorationClick(object sender, EventArgs e)
 {
     this.currentPlaceable = (Placeable)this.map.decorationFactory.GetDecoration(((sender as PlaceableButton).Item as Decoration).Type, 0.0f, 0.0f, false, false, false, false);
     if (this.currentPlaceable.GetTexture() != null)
     {
         this.currentTexture     = this.currentPlaceable.GetTexture();
         this.currentAnimTexture = (AnimatedTexture)null;
     }
     else
     {
         this.currentAnimTexture = this.currentPlaceable.GetAnimatedTexture();
         this.currentTexture     = (Texture2D)null;
     }
 }
Beispiel #2
0
 private void PickupClick(object sender, EventArgs e)
 {
     this.currentPlaceable = (Placeable)this.map.pickupFactory.GetPickup(((sender as PlaceableButton).Item as Pickup).Type, 0.0f, 0.0f);
     if (this.currentPlaceable.GetTexture() != null)
     {
         this.currentTexture     = this.currentPlaceable.GetTexture();
         this.currentAnimTexture = (AnimatedTexture)null;
     }
     else
     {
         this.currentAnimTexture = this.currentPlaceable.GetAnimatedTexture();
         this.currentTexture     = (Texture2D)null;
     }
 }
Beispiel #3
0
        public virtual void GotoState()
        {
            if (this.actionState != this.prevState)
            {
                switch (this.actionState)
                {
                case Entity.TorsoState.IdleRight:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.IdleRight];
                    break;

                case Entity.TorsoState.IdleLeft:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.IdleLeft];
                    break;

                case Entity.TorsoState.JumpLeft:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.JumpLeft];
                    break;

                case Entity.TorsoState.JumpRight:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.JumpRight];
                    break;

                case Entity.TorsoState.RunLeft:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.RunLeft];
                    break;

                case Entity.TorsoState.RunRight:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.RunRight];
                    break;

                case Entity.TorsoState.SlideLeft:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.SlideLeft];
                    break;

                case Entity.TorsoState.SlideRight:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.SlideRight];
                    break;

                case Entity.TorsoState.WallLeapLeft:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.WallLeapLeft];
                    break;

                case Entity.TorsoState.WallLeapRight:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.WallLeapRight];
                    break;

                case Entity.TorsoState.BraceWallLeft:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.BraceWallLeft];
                    break;

                case Entity.TorsoState.BraceWallRight:
                    this.torsoTexture = this.bodyTextures[Entity.TorsoState.BraceWallRight];
                    break;

                case Entity.TorsoState.AttackLeft:
                    this.torsoTextures[Entity.TorsoState.AttackLeft].Reset();
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.AttackLeft];
                    break;

                case Entity.TorsoState.AttackRight:
                    this.torsoTextures[Entity.TorsoState.AttackRight].Reset();
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.AttackRight];
                    break;

                default:
                    this.torsoTexture = this.torsoTextures[Entity.TorsoState.IdleRight];
                    break;
                }
            }
            if (this.legTextures == null || this.actionLegState == this.prevLegState)
            {
                return;
            }
            switch (this.actionLegState)
            {
            case Entity.LegState.IdleRight:
                this.legTexture = this.legTextures[Entity.LegState.IdleRight];
                break;

            case Entity.LegState.IdleLeft:
                this.legTexture = this.legTextures[Entity.LegState.IdleLeft];
                break;

            case Entity.LegState.RunRight:
                this.legTexture = this.legTextures[Entity.LegState.RunRight];
                break;

            case Entity.LegState.RunLeft:
                this.legTexture = this.legTextures[Entity.LegState.RunLeft];
                break;

            case Entity.LegState.JumpRight:
                this.legTexture = this.legTextures[Entity.LegState.JumpRight];
                break;

            case Entity.LegState.JumpLeft:
                this.legTexture = this.legTextures[Entity.LegState.JumpLeft];
                break;

            case Entity.LegState.Nothing:
                this.legTexture = (AnimatedTexture)null;
                break;

            default:
                this.legTexture = this.legTextures[Entity.LegState.IdleRight];
                break;
            }
        }