コード例 #1
0
        /// <summary>
        /// Erstellt eine Representation eines PowerUps.
        /// <param name="graphics">GraphicsDeviceManager</param>
        /// <param name="powerUp">übergebenes PowerUp-Objekt</param>
        /// <param name="texture">Textur des PowerUps</param>
        /// </summary>
        public PowerUpRepresentation(PowerUp powerUp, Texture2D texture, Color color, GraphicsDeviceManager graphics)
        {
            GameItem      = powerUp;
            this.texture  = texture;
            this.model    = ViewContent.RepresentationContent.PowerUp;
            this.position = PlaneProjector.Convert2DTo3D(GameItem.Position);
            this.graphics = graphics;

            //Winkel in °
            this.angle         = 0.0f;
            this.rotationSpeed = 1.0f;
            this.World         = Matrix.CreateWorld(this.position, Vector3.Forward, Vector3.Up);

            this.powerUpGlitter = (PowerUpGlitter)createParticleEngine(ViewContent.RepresentationContent.GlitterTexture, PlaneProjector.ToScreenCoordinates(position, graphics), 0.2f, color);
            this.color          = color;
        }
コード例 #2
0
 private ParticleEngine createParticleEngine(Texture2D texture, Vector2 location, float size, Color color)
 {
     //evtl. velocity von gameitem übergeben
     this.powerUpGlitter = new PowerUpGlitter(texture, location, size, color, graphics);
     return(powerUpGlitter);
 }