public Passus (CompositorColorCorrectionNode colorCorrectionNode, GameState state, AIManager aiManager, RendererContext rendererContext) { passusEmitter = new PassusGhostParticleEmitter (); PassusGameState = state; particlePassus = new ParticleSceneObject (passusEmitter.ParticleCount); particlePassus.Priority = 7001; state.Scene.AddObject (particlePassus); passusEmitter.Init (particlePassus, rendererContext); PassusEntity = EntityFactory.Instance.CreateWith ("Passus." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem) }); PassusEntity.GetComponent<ParticleComponent> ().Emitter = passusEmitter; PassusEntity.GetComponent<ParticleComponent> ().Particle = particlePassus; RigidBody passusBody = new RigidBody (new SphereShape (1.2f)); passusBody.AffectedByGravity = false; passusBody.AllowDeactivation = false; passusBody.Mass = 20; PassusEntity.GetComponent<PhysicsComponent> ().RigidBody = passusBody; PassusEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; PassusEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (passusBody); var AIcomp = PassusEntity.GetComponent<ArtificialIntelligenceComponent>(); AIcomp.AIManager = aiManager; AIcomp.ArtificialIntelligence = new PassusAI (PassusEntity, state, colorCorrectionNode); aiManager.RegisterEntity (PassusEntity); }
public Roaches (GameState state, AIManager aiManager, RendererContext rendererContext) { RoachGameState = state; roachGroup = new RoachGroup (state.Scene); RoachEntity = EntityFactory.Instance.CreateWith("Roach." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (PhysicsSystem), typeof (RoachGroupSystem) }); RoachEntity.GetComponent<RoachGroupComponent>().RoachGroup = roachGroup; RigidBody roachBody = new RigidBody (new CylinderShape (0.05f, 1)); roachBody.AffectedByGravity = false; roachBody.AllowDeactivation = false; roachBody.Mass = 20; roachBody.Tag = roachGroup; RoachEntity.GetComponent<PhysicsComponent> ().RigidBody = roachBody; RoachEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; RoachEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (roachBody); RoachEntity.GetComponent<ArtificialIntelligenceComponent>().AIManager = aiManager; RoachEntity.GetComponent<ArtificialIntelligenceComponent>().ArtificialIntelligence = new RoachesAI (roachGroup, RoachEntity, state); aiManager.RegisterEntity (RoachEntity); }
public Caligo (GameState state, AIManager aiManager, RendererContext rendererContext, CompositorWarpingNode warpingNode) { caligoEmitter = new CaligoParticleEmitter (); particleCaligo = new ParticleSceneObject (caligoEmitter.ParticleCount); particleCaligo.Priority = 7000; state.Scene.AddObject (particleCaligo); caligoEmitter.Init (particleCaligo, rendererContext); CaligoGameState = state; CaligoEntity = EntityFactory.Instance.CreateWith ("Caligo." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem) }); CaligoEntity.GetComponent<ParticleComponent> ().Emitter = caligoEmitter; CaligoEntity.GetComponent<ParticleComponent> ().Particle = particleCaligo; RigidBody caligoBody = new RigidBody (new SphereShape (1.2f)); caligoBody.AffectedByGravity = false; caligoBody.AllowDeactivation = false; caligoBody.Mass = 20; CaligoEntity.GetComponent<PhysicsComponent> ().RigidBody = caligoBody; CaligoEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; CaligoEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (caligoBody); var AIcomp = CaligoEntity.GetComponent<ArtificialIntelligenceComponent>(); AIcomp.AIManager = aiManager; AIcomp.ArtificialIntelligence = new CaligoAI (CaligoEntity, state, warpingNode); aiManager.RegisterEntity (CaligoEntity); }
public Viridion (GameState state, AIManager aiManager, RendererContext rendererContext, CompositorColorCorrectionNode colorCorrectionNode) { viridionEmitter = new ViridionParticleEmitter (); ViridionGameState = state; particleViridion = new ParticleSceneObject (viridionEmitter.ParticleCount); particleViridion.Priority = 7002; state.Scene.AddObject (particleViridion); viridionEmitter.Init (particleViridion, rendererContext); ViridionEntity = EntityFactory.Instance.CreateWith ("Viridion." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem), typeof(LightSystem) }); ViridionEntity.GetComponent<ParticleComponent> ().Emitter = viridionEmitter; ViridionEntity.GetComponent<ParticleComponent> ().Particle = particleViridion; var light = ViridionEntity.GetComponent<LightComponent> ().Light; light = new FreezingArcher.Renderer.Scene.Light (FreezingArcher.Renderer.Scene.LightType.PointLight); light.On = true; light.Color = new FreezingArcher.Math.Color4 (0.6f, 0.6f, 0.6f, 1.0f); light.PointLightLinearAttenuation = 0.4f; light.PointLightConstantAttenuation = 0.7f; light.PointLightExponentialAttenuation = 0.008f; ViridionEntity.GetComponent<LightComponent> ().Light = light; state.Scene.AddLight (light); RigidBody ghostBody = new RigidBody (new SphereShape (1.2f)); ghostBody.AffectedByGravity = false; ghostBody.AllowDeactivation = false; ghostBody.Mass = 20; ViridionEntity.GetComponent<PhysicsComponent> ().RigidBody = ghostBody; ViridionEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; ViridionEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (ghostBody); ViridionEntity.GetComponent<ArtificialIntelligenceComponent>().AIManager = aiManager; ViridionEntity.GetComponent<ArtificialIntelligenceComponent>().ArtificialIntelligence = new ViridionAI (ViridionEntity, state, colorCorrectionNode); aiManager.RegisterEntity (ViridionEntity); }
public FenFire (GameState state, AIManager aiManager, RendererContext rendererContext) { ghostEmitter = new FenFireParticleEmitter (); particleGhost = new ParticleSceneObject (ghostEmitter.ParticleCount); particleGhost.Priority = 7092; state.Scene.AddObject (particleGhost); ghostEmitter.Init (particleGhost, rendererContext); GhostGameState = state; GhostEntity = EntityFactory.Instance.CreateWith ("FenFire." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem), typeof(LightSystem) }); GhostEntity.GetComponent<ParticleComponent> ().Emitter = ghostEmitter; GhostEntity.GetComponent<ParticleComponent> ().Particle = particleGhost; var light = GhostEntity.GetComponent<LightComponent> ().Light; light = new FreezingArcher.Renderer.Scene.Light (FreezingArcher.Renderer.Scene.LightType.PointLight); light.On = true; light.Color = new FreezingArcher.Math.Color4 (0.0f, 0.0f, 0.6f, 1.0f); light.PointLightLinearAttenuation = 0.4f; light.PointLightConstantAttenuation = 0.7f; light.PointLightExponentialAttenuation = 0.008f; GhostEntity.GetComponent<LightComponent> ().Light = light; state.Scene.AddLight (light); RigidBody ghostBody = new RigidBody (new SphereShape (0.4f)); ghostBody.AffectedByGravity = false; ghostBody.AllowDeactivation = false; ghostBody.Mass = 20; GhostEntity.GetComponent<PhysicsComponent> ().RigidBody = ghostBody; GhostEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; GhostEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (ghostBody); GhostEntity.GetComponent<ArtificialIntelligenceComponent>().AIManager = aiManager; GhostEntity.GetComponent<ArtificialIntelligenceComponent>().ArtificialIntelligence = new FenFireAI (GhostEntity, state); aiManager.RegisterEntity (GhostEntity); }
public Scobis (GameState state, AIManager aiManager, RendererContext rendererContext) { paremitter = new ScobisParticleEmitter (); particleEye1 = new ParticleSceneObject (paremitter.RedEye1.ParticleCount); particleEye2 = new ParticleSceneObject (paremitter.RedEye2.ParticleCount); particleSmoke = new ParticleSceneObject (paremitter.Smoke.ParticleCount); particleEye1.Priority = 5999; particleEye2.Priority = 5999; particleSmoke.Priority = 6000; ScobisGameState = state; state.Scene.AddObject (particleEye1); state.Scene.AddObject (particleEye2); state.Scene.AddObject (particleSmoke); particle = new ParticleSceneObject (paremitter.ParticleCount); particle.Priority = 5998; state.Scene.AddObject (particle); paremitter.Init (particle, particleEye1, particleEye2, particleSmoke, rendererContext); ScobisEntity = EntityFactory.Instance.CreateWith ("Scobis." + InstanceCount++, state.MessageProxy, new[] { typeof (ArtificialIntelligenceComponent) }, new[] { typeof (ParticleSystem), typeof (PhysicsSystem) }); ScobisEntity.GetComponent<ParticleComponent> ().Emitter = paremitter; ScobisEntity.GetComponent<ParticleComponent> ().Particle = particle; RigidBody scobisBody = new RigidBody (new SphereShape (0.3f)); scobisBody.AffectedByGravity = false; scobisBody.AllowDeactivation = false; scobisBody.Mass = 20; ScobisEntity.GetComponent<PhysicsComponent> ().RigidBody = scobisBody; ScobisEntity.GetComponent<PhysicsComponent> ().World = state.PhysicsManager.World; ScobisEntity.GetComponent<PhysicsComponent> ().PhysicsApplying = AffectedByPhysics.Position; state.PhysicsManager.World.AddBody (scobisBody); var AIcomp = ScobisEntity.GetComponent<ArtificialIntelligenceComponent>(); AIcomp.AIManager = aiManager; AIcomp.ArtificialIntelligence = new ScobisAI (paremitter.Smoke, ScobisEntity, state); AIcomp.MaximumEntityDistance = 30; aiManager.RegisterEntity (ScobisEntity); }