I want to make a method that subtracts 25 from an my hp value, but there is an issue
<p>So far i have this if logic</p>

<pre><code>if (d.intersects(r1) &amp;&amp; en.visible == true &amp;&amp; en.isAlive == false)
{
    hit = 25;
    // System.out.println(enemy_count);
    hitmang(hit);
}

if (d.intersects(r2) &amp;&amp; en2.visible == true &amp;&amp; en2.isAlive == false)
{
    hit = 25;
    hitmang(hit);
    //  System.out.println(enemy_count);
}
</code></pre>

<p>with this method</p>

<pre><code>private void hitmang(int x) { 
    p.user_hp = p.user_hp - x;
}
</code></pre>

<p>these are both my enemies</p>

<pre><code>en = new Enemy(700, 150);
en2 = new Enemy (980, 150);
</code></pre>

<p>I want to make it so that when i hit the enemy it only subtracts 25 hp from me, but because the area of the enemy is large (113, 134) it is subtracting 25 until i leave that range making my hp ~-6000 (obviously an issue), is there a way to make it so it only subtracts once.</p>
