コード例 #1
0
        public void EnemyShoot()
        {
            if (reloadTime >= 0)
            {
                reloadTime--;
            }

            if (reloadTime <= 0)
            {
                CannonBall newBall = new CannonBall(ballTexture);
                newBall.position  = new Vector2(position.X, position.Y);
                newBall.isVisible = true;

                ballList.Add(newBall);
            }

            if (reloadTime <= 0)
            {
                reloadTime = 80;
            }
        }
コード例 #2
0
ファイル: PlayerShip.cs プロジェクト: ullrak/old-game
        public void Shoot()
        {
            if (reloadTime >= 0)
            {
                reloadTime--;
            }

            if (shotsFired == true && reloadTime <= 0)
            {
                CannonBall newBall = new CannonBall(ballTexture);
                //try to start at cannon
                newBall.position  = new Vector2(position.X, position.Y);
                newBall.isVisible = true;

                ballList.Add(newBall);
            }

            if (shotsFired == true && reloadTime <= 0)
            {
                shotsFired = false;
                reloadTime = 30;
            }
        }