상속: Image
예제 #1
0
 /*
  * Initialise the ball(s)
  * */
 public void Initialise()
 {
     ResetColour();
     ball = new MovingBall(core, colour);
     Console.WriteLine("new ball");
     ball.Initialise(new Vector2(50f, 50f), StartPosition(), game);
 }
예제 #2
0
 /*
  * Update the ball, and generate new ones if necessary
  * */
 public void Update(GameTime gameTime)
 {
     if (ball.IsLive())
     {
         ball.Move();
     }
     else
     {
         ball = ballGenerator.Remove();
         ball.Position = StartPosition();
         //LoadGraphicsContent();
     }
 }
예제 #3
0
파일: Core.cs 프로젝트: kiniry-teaching/UCD
 public void UpdateLoose()
 {
     for (int i = 0; i < ballsSize; i++)
     {
         balls[i].CheckSupports();
     }
     bool redo = false;
     for (int i = 0; i < ballsSize; i++)
     {
         if (!balls[i].IsAgainstCore() && balls[i].Unsupported() && !balls[i].IsDead())
         {
             redo = true;
             MovingBall m = new MovingBall(this, balls[i].colour);
             m.Initialise(balls[i].Size, balls[i].Position, this.game);
             m.LoadGraphicsContent(balls[i].spriteBatch, balls[i].colourTexture);
             balls[i].Destroy();
             balls.Remove(balls[i]);
             ballsSize--;
             looseBalls.Add(m);
             looseBallsSize++;
         }
     }
     if (redo == true)
     {
         UpdateLoose();
     }
 }
예제 #4
0
 public void Initialise()
 {
     ball = new MovingBall(core,Image.value.green);
     ball.Initialise(new Vector2(50f, 50f), new Vector2(0f, 0f));
 }