Example #1
0
 public void Update(paddle p, FireBallBar fbb)
 {
     position.Y += velocity;
     if (position.Intersects(p.bounds))
     {
         fbb.numOfBalls++;
     }
 }
Example #2
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            ms = new MouseState();

            myGrid = new Grid(new Rectangle(0, 0, graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight), 20, 40);
            myBall = new Ball(this, "Ball");
            myPaddle = new paddle(1);
            myCursor = new Cursor(this, ms, "Cursor");
            myFireBar = new FireBallBar(this, "FireBallBar", new Rectangle(0, 550, 100, 50), ms);

            base.Initialize();
        }
        public void Update(paddle p, FireBallBar fbb)
        {
            for (int i = 0; i < fireTokens.Count; i++)
            {
                FireToken temp = fireTokens[i];

                temp.Update(p, fbb);
            }
        }