Exemplo n.º 1
0
        public void CreateNewSpawners(float deltaTime)
        {
            if (_newSpawnerTimer.Seconds >= _timeToSpawnNewSpawner && _canSpawnMore)
            {
                //_timeToSpawnNewSpawner += 10;

                Satellite     satellite     = new Satellite();
                DebrisSpawner debrisSpawner = new DebrisSpawner(0, null, false);
                Parent.AddChild(debrisSpawner);

                _newSpawnerTimer.Restart();
            }
        }
Exemplo n.º 2
0
 // What lets the Satellite shoots bullets
 public void Shoot(float deltaTime)
 {
     if (_shootTimer.Seconds >= _timeToShoot)
     {
         _shootTimer.Restart();
         Vector3   facing    = new Vector3(GetM12, GetM11, 0);
         Satellite satellite = new Satellite();
         _bullet    = new Bullet(XAbsolute, YAbsolute, satellite, "satelliteBullet.png");
         _bullet.X -= facing.x * 40;
         _bullet.Y -= facing.y * 40;
         _bullet.Rotate(GetRotation());
         if (Parent != null)
         {
             Parent.AddChild(_bullet);
         }
     }
 }