Ejemplo n.º 1
0
        protected string getFileName()
        {
            ModelBubble bubble = (ModelBubble)displayable;

            switch (bubble.color)
            {
            case BubbleColor.red:
                return("RedBubble");

            case BubbleColor.blue:
                return("BlueBubble");

            case BubbleColor.brown:
                return("BrownBubble");

            case BubbleColor.green:
                return("GreenBubble");

            case BubbleColor.orange:
                return("OrangeBubble");

            case BubbleColor.teal:
                return("TealBubble");

            case BubbleColor.yellow:
                return("YellowBubble");
            }
            return("ball");
        }
Ejemplo n.º 2
0
        public void changeColor(BubbleColor color)
        {
            ModelBubble b = (ModelBubble)this.displayable;

            b.setColor(color);
            section = new Rectangle(locationX[(int)color], locationY[(int)color], dimensions.width, dimensions.height);
        }
Ejemplo n.º 3
0
        public override void Draw(GameTime gameTime)
        {
            ModelBubble bubble = (ModelBubble)displayable;

            world  = getBallRotation();
            world *= Matrix.CreateTranslation(new Vector3(displayable.position.x, displayable.position.y, displayable.position.z));
            world *= CameraHolder.camera.getWorldMatrix();
            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    //effect.TextureEnabled = false;
                    //effect.Texture = tempTexture;
                    //effect.Texture = otherTexture;
                    effect.EnableDefaultLighting();
                    effect.World      = transformations[mesh.ParentBone.Index] * world;
                    effect.View       = CameraHolder.camera.getView();
                    effect.Projection = CameraHolder.camera.getProjection();
                    effect.Alpha      = 1.0f;
                }

                mesh.Draw();
            }
            base.Draw(gameTime);
        }
Ejemplo n.º 4
0
        public Matrix getBallRotation()
        {
            ModelBubble bubble = (ModelBubble)displayable;

            Matrix rotations = Matrix.CreateRotationX(bubble.motionRotation.x);

            //rotations *= Matrix.CreateRotationY(bubble.motionRotation.y);
            rotations *= Matrix.CreateRotationZ(bubble.motionRotation.y);
            return(rotations);
        }
Ejemplo n.º 5
0
 public ModelBubble(ModelBubble b)
     : base(b)
 {
     color = b.color;
       motionRotation = new Point(0.0f, 0.0f, 0.0f);
 }
Ejemplo n.º 6
0
 public ModelBubble(ModelBubble b)
     : base(b)
 {
     color          = b.color;
     motionRotation = new Point(0.0f, 0.0f, 0.0f);
 }
Ejemplo n.º 7
0
 public ModelBubble(ModelBubble b)
     : base(b)
 {
     color = b.color;
 }