示例#1
0
        ///<summary>
        ///initialize using associated entity
        ///</summary>
        ///<param name="entity">associated entity</param>
        public void Initialize(Entity entity)
        {
            _projectileBolt = entity as ProjectileBolt;

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

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

            Material = simpleMaterial;

            Layer = 0;
            IsTemplate = false;
            Size = new Vector2(4, 4);
        }
示例#2
0
        ///<summary>
        ///add a bolt to the game
        ///</summary>
        ///<param name="shooter"></param>
        ///<param name="target"></param>
        public void AddBolt(BotEntity shooter, Vector2 target)
        {
            Projectile projectile =
                new ProjectileBolt(shooter, target, new BoltSceneObject());

            Projectiles.Add(projectile);

            projectile.Name = "TempBoltName";
            //register the bolt with the entity manager
            EntityManager.Instance.RegisterEntity(projectile);
            projectile.Name = "BOLT_" + projectile.ObjectId;

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