コード例 #1
0
ファイル: Rocket.cs プロジェクト: AllosProject/AllosProject
        public override void update(GameTime gameTime)
        {
            base.update(gameTime);

            if ((gameTime.TotalGameTime.TotalMilliseconds - Timer) > Factor)
            {
                float randomSize = (float)Util.getNextDouble() * Util.getNextInt(1, 3);
                Smoke smoke = new Smoke(Body.Position, randomSize, Body.LinearVelocity);
                GameControl.particleManager.addParticle("Smoke", smoke);
                Timer = (float)gameTime.TotalGameTime.TotalMilliseconds;
            }
        }
コード例 #2
0
 private static Particle createParticle(Particle particle,ParticleEnum particleType)
 {
     if (particleType == ParticleEnum.Smoke)
     {
         Smoke smoke = new Smoke(particle.data.Position, particle.data.Scaling, particle.data.direction);
         smoke.init(null);
         return smoke;
     }
     if (particleType == ParticleEnum.Explosion)
     {
         Explosion explosion = new Explosion(particle.data.Position,particle.data.Scaling,particle.data.direction);
         explosion.init(null);
         return explosion;
     }
     return null;
 }