///<summary> ///initialize using associated entity ///</summary> ///<param name="entity">associated entity</param> public void Initialize(Entity entity) { _projectileRocket = entity as ProjectileRocket; //Material = // TorqueObjectDatabase.Instance.FindObject("HoverShellMaterial") // as SimpleMaterial; SimpleMaterial simpleMaterial = new SimpleMaterial(); simpleMaterial.TextureFilename = @"data\images\GarageGames\HoverShell"; simpleMaterial.IsTranslucent = true; simpleMaterial.IsColorBlended = true; Material = simpleMaterial; Layer = 0; IsTemplate = false; Size = new Vector2(8, 8); }
///<summary> ///add a rocket to the game ///</summary> ///<param name="shooter"></param> ///<param name="target"></param> public void AddRocket(BotEntity shooter, Vector2 target) { Projectile projectile = new ProjectileRocket(shooter, target, new RocketSceneObject()); Projectiles.Add(projectile); projectile.Name = "TempRocketName"; //register the rocket with the entity manager EntityManager.Instance.RegisterEntity(projectile); projectile.Name = "ROCKET_" + projectile.ObjectId; LogUtil.WriteLineIfLogCreate("Adding a rocket " + projectile.ObjectId + " at position " + projectile.Position); }