コード例 #1
0
        public void CreateExplosion(float Xcoord, float Ycoord, SpriteBatch spritebatch)
        {
            Vector2 mouseclick   = new Vector2(Xcoord, Ycoord);
            Vector2 explosionpos = camera.ConvertMouseToLogical(mouseclick);

            if (explosionpos.X <= 1f && explosionpos.X >= 0f && explosionpos.Y <= 1f && explosionpos.Y >= 0f)
            {
                numberofexplosions.Add(new Explosionview(camera, spritebatch, explosionpos, splittertexture, smoketexture, explosiontexture, shockwavetexture));
                firesound.Play(0.1f, 0, 0);
            }
            ballsim.killballs(explosionpos.X, explosionpos.Y, (crosshairsize / 2));
        }