当前位置: 首页>>代码示例>>C#>>正文


C# Projectile.Initialize方法代码示例

本文整理汇总了C#中Projectile.Initialize方法的典型用法代码示例。如果您正苦于以下问题:C# Projectile.Initialize方法的具体用法?C# Projectile.Initialize怎么用?C# Projectile.Initialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Projectile的用法示例。


在下文中一共展示了Projectile.Initialize方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Shoot

        public bool Shoot(double elapsedTime, Projectile ammunitionType)
        {
            coolDownElapsed += elapsedTime;
            if (coolDownElapsed <= coolDownTime)
            {
                IsBeingUsed = false;
                return false;
            }
            coolDownElapsed = 0;
            IsBeingUsed = true;
            foreach (Projectile projectile in ammo.Where(projectile => !projectile.IsVisible))
            {
                projectile.Fire(owner.Center, owner.Target.Center);
                return true;
            }

            ammunitionType.Initialize();
            ammunitionType.Fire(owner.Center, owner.Target.Center);
            ammo.Add(ammunitionType);
            return true;
        }
开发者ID:ruairitobrien,项目名称:Nathaniel-WP7,代码行数:21,代码来源:ProjectileWeapon.cs

示例2: AddTurretProjectile

        private void AddTurretProjectile(Turret tur)
        {
            Projectile projectile = new Projectile();
            projectile.Initialize(this.ScreenManager.GraphicsDevice.Viewport, this.turretProjTexture, new Vector2(tur.Position.X, tur.Position.Y), tur);

            this.projectiles.Add(projectile);
            SoundCaller turretShotFired = new SoundCaller(this.turretSound);
        }
开发者ID:klimentt,项目名称:KurtVonnegut,代码行数:8,代码来源:GameplayScreen.cs

示例3: AddPlayerProjectile

 private void AddPlayerProjectile(Vector2 position)
 {
     Projectile projectile = new Projectile();
     projectile.Initialize(this.ScreenManager.GraphicsDevice.Viewport, this.projectileTexture, position, this.player);
     this.projectiles.Add(projectile);
     SoundCaller shotFired = new SoundCaller(this.shotSound);
 }
开发者ID:klimentt,项目名称:KurtVonnegut,代码行数:7,代码来源:GameplayScreen.cs

示例4: Initialize

        public override void Initialize()
        {
            // Define initial state of the catapult
            currentState = CatapultState.Idle;

            // Load the idle texture
            idleTexture = curGame.Content.Load<Texture2D>(idleTextureName);

            // Initialize the projectile
            Vector2 projectileStartPosition;
            if (isAI)
                projectileStartPosition = new Vector2(630, 340);
            else
                projectileStartPosition = new Vector2(175, 340);

            // TODO: Update hit offset
            projectile = new Projectile(curGame, spriteBatch,
                "Textures/Ammo/rock_ammo", projectileStartPosition,
                60, isAI, gravity);
            projectile.Initialize();

            IsActive = true;
            AnimationRunning = false;
            stallUpdateCycles = 0;

            // Initialize randomizer
            random = new Random();

            base.Initialize();
        }
开发者ID:Clancey,项目名称:Castles,代码行数:30,代码来源:Catapult.cs

示例5: AddProjectile

        private void AddProjectile(Vector2 position)
        {
            //moving to top
            int projDamage = player.DamageMod + 3;
            Projectile projectile = new Projectile();
            projectile.Initialize(ScreenManager.GraphicsDevice.Viewport, projectileTexture, position, projDamage);

            projectiles.Add(projectile);
        }
开发者ID:urvaius,项目名称:SaturnsTurn2,代码行数:9,代码来源:GameplayScreen.cs


注:本文中的Projectile.Initialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。