コード例 #1
0
 public override void Update(GameTime gameTime)
 {
     timer += gameTime.ElapsedGameTime.TotalSeconds;
     if (timer >= CREATION_INTERVAL)
     {
         timer = 0;
         parent.AddComponent(new Coin(Game));
     }
     base.Update(gameTime);
 }
コード例 #2
0
 public override void Update(GameTime gameTime)
 {
     // Count up until it's time to create a new
     // coin
     timer += gameTime.ElapsedGameTime.TotalSeconds;
     if (timer >= CREATION_INTERVAL)
     {
         timer = 0;
         // Create a new coin at some random location
         parent.AddComponent(new Enemies(Game, GetRandomEnemyType(), GetRandomLocation()));
     }
     base.Update(gameTime);
 }