public void Shoot(Filodendron filodendron) { Matrix movement = Matrix.CreateRotationY(filodendron.avatarYaw + 0.8f); World = filodendron.World * Matrix.CreateRotationY(filodendron.avatarYaw); bulletSpeed = new Vector3(-50, 0, 50); bulletSpeed = Vector3.Transform(bulletSpeed, movement); bulletPosition = filodendron.avatarPosition + bulletShift; visible = true; Debug.WriteLine(filodendron.avatarPosition); Debug.WriteLine(filodendron.avatarYaw); }
//Constructor public ParticleExplosion(GraphicsDevice graphicsDevice, Filodendron avatar, Matrix world, int lifeLeft, int roundTime, int numParticlesPerRound, int maxParticles, Texture2D particleColorsTexture, ParticleSettings particleSettings, Effect particleEffect) { this.avatar = avatar; this.world = world; this.lifeLeft = lifeLeft; this.numParticlesPerRound = numParticlesPerRound; this.maxParticles = maxParticles; this.roundTime = roundTime; this.graphicsDevice = graphicsDevice; this.particleSettings = particleSettings; this.particleEffect = particleEffect; this.particleColorsTexture = particleColorsTexture; InitializeParticleVertices(); }
protected override void LoadContent() { this.setCollectableItems(); this.setPlatforms(); this.setBlades(); platformTexture = Game.Content.Load <Texture2D>(@"textures/platformTex"); collectableItemTexture = Game.Content.Load <Texture2D>(@"textures/collTex"); bulletTexture = Game.Content.Load <Texture2D>(@"textures/bulletTex"); boxTexture = Game.Content.Load <Texture2D>(@"textures/boxtexture"); sektorMaszyn = new MachineSector(Game.Content.Load <Model>(@"models\pokoj1-24"), Matrix.Identity); sektorMaszyn.texture = Game.Content.Load <Texture2D>(@"textures/texture01-12"); sektorMaszyn.boundingBox = true; avatar = new Filodendron(Game.Content.Load <Model>(@"models\test7_textures1"), Matrix.Identity);//Matrix.CreateTranslation(2500, 2200, 3500)); avatar.skinningData = avatar.model.Tag as SkinningData; avatar.boundingBox = true; avatar.bullet = new Bullet(Game.Content.Load <Model>(@"models\box"), Matrix.Identity); avatar.slave = new Follower(Game.Content.Load <Model>(@"models\box"), Matrix.Identity); avatar.slave.master = avatar; avatar.slave.followerPosition = avatar.avatarPosition; allModels.Add(sektorMaszyn); allModels.Add(avatar.bullet); if (avatar.skinningData == null) { throw new InvalidOperationException ("This model does not contain a SkinningData tag."); } // Create an animation player, and start decoding an animation clip. avatar.animationPlayer = new AnimationPlayer(avatar.skinningData); avatar.clip = avatar.skinningData.AnimationClips["Take 001"]; avatar.avatarTexture = Game.Content.Load <Texture2D>(@"textures/texture_roslina"); avatar.CustomShader = Game.Content.Load <Effect>(@"effects/lightening"); avatar.animationPlayer.StartClip(avatar.clip); avatar.avatarPosition = new Vector3(-4000, 40, 4000); Vector3 slaveShift = new Vector3(200, 3, 200); avatar.slave.followerPosition = avatar.avatarPosition - slaveShift; avatar.bullet.rb = new BulletRigidBody(avatar.bullet); // Load explosion textures and effect explosionTexture = Game.Content.Load <Texture2D>(@"Textures\Particle"); explosionColorsTexture = Game.Content.Load <Texture2D>(@"Textures\ParticleColors"); explosionEffect = Game.Content.Load <Effect>(@"effects\particle"); // Set effect parameters that don't change per particle explosionEffect.CurrentTechnique = explosionEffect.Techniques["Technique1"]; explosionEffect.Parameters["theTexture"].SetValue(explosionTexture); //ocean ocean = new Ocean(Game.Content.Load <Model>(@"models\ocean"), Matrix.Identity); ocean.oceanEffect = Game.Content.Load <Effect>(@"effects\OceanShader"); ocean.diffuseOceanTexture = Game.Content.Load <Texture2D>(@"textures\water"); ocean.normalOceanTexture = Game.Content.Load <Texture2D>(@"textures\wavesbump"); ocean.SetupOceanShaderParameters(); base.LoadContent(); }