示例#1
0
        public void setDoShooting(bool shoot)
        {
            //------------------------------------------------------------------------------------------------------------------
            // Purpose: Method (set invader to init shooting)
            //-----------------------------------------------------------------------------------------------------------------

            if (shoot)
            {
                this.bullet = new clsInvaderBullet(base.getX() + 10, base.getY());
                this.shoot  = shoot;

                this.bullet2 = new clsInvaderBullet(base.getX() + 7, base.getY());
                //this.shoot2 = shoot;
            }
            else
            {
                this.bullet  = null;
                this.bullet2 = null;
                this.shoot   = false;
            }
        }
示例#2
0
        public void doShoot(Graphics Destination)
        {
            //------------------------------------------------------------------------------------------------------------------
            // Purpose: Method to control the invaders bullets
            //------------------------------------------------------------------------------------------------------------------


            if (this.bullet.getY() < ScreenHeight)
            {
                // Shift bullets down the screen
                if (this.bullet != null)
                {
                    this.bullet.moveBullets(Destination, 0);
                    this.bullet2.moveBullets(Destination, 2);
                }
            }
            else //- bullet has moved off the screen then kill off instance
            {
                this.bullet  = null;
                this.shoot   = false;
                this.bullet2 = null;
            }
        }
        public void setDoShooting(bool shoot)
        {
            //------------------------------------------------------------------------------------------------------------------
            // Purpose: Method (set invader to init shooting)
            //-----------------------------------------------------------------------------------------------------------------

            if (shoot)
            {
                this.bullet = new clsInvaderBullet(base.getX() + 10, base.getY());
                this.shoot = shoot;

                this.bullet2 = new clsInvaderBullet(base.getX() + 7, base.getY());
                //this.shoot2 = shoot;

            }
            else
            {
                this.bullet = null;
                this.bullet2 = null;
                this.shoot = false;
            }
        }
        public void doShoot(Graphics Destination)
        {
            //------------------------------------------------------------------------------------------------------------------
            // Purpose: Method to control the invaders bullets
            //------------------------------------------------------------------------------------------------------------------

            if (this.bullet.getY() < ScreenHeight)
            {
                // Shift bullets down the screen
                if (this.bullet != null)
                {
                    this.bullet.moveBullets(Destination,0);
                    this.bullet2.moveBullets(Destination,2);
                }
            }
            else //- bullet has moved off the screen then kill off instance
            {
                this.bullet = null;
                this.shoot = false;
                this.bullet2 = null;
            }
        }