Пример #1
0
        ///<summary>
        ///initialize using associated entity
        ///</summary>
        ///<param name="entity">associated entity</param>
        public void Initialize(Entity entity)
        {
            _projectileSlug = entity as ProjectileSlug;

            //Material =
            //   TorqueObjectDatabase.Instance.FindObject("RedBallMaterial")
            //   as SimpleMaterial;

            SimpleMaterial simpleMaterial = new SimpleMaterial();
            simpleMaterial.TextureFilename =
                @"data\images\Mindcrafters\RedBall";
            simpleMaterial.IsTranslucent = true;
            simpleMaterial.IsColorBlended = true;

            Material = simpleMaterial;

            Layer = 0;
            IsTemplate = false;
            Size = new Vector2(8, 8);
        }
Пример #2
0
        ///<summary>
        ///add a railgun to the game
        ///</summary>
        ///<param name="shooter"></param>
        ///<param name="target"></param>
        public void AddRailgunSlug(BotEntity shooter, Vector2 target)
        {
            Projectile projectile =
                new ProjectileSlug(shooter, target, new SlugSceneObject());

            Projectiles.Add(projectile);

            projectile.Name = "TempSlugName";
            //register the slug with the entity manager
            EntityManager.Instance.RegisterEntity(projectile);
            projectile.Name = "SLUG_" + projectile.ObjectId;

            LogUtil.WriteLineIfLogCreate("Adding a rail gun slug" +
                                         projectile.ObjectId + " at position " + projectile.Position);
        }