@Override//the return doesn't really mean anything all we need is that when any of the point hit within the hit box of player, call the loose health function.
publicbooleancheckForCollision(intxx,intyy)
{
if(super.checkForCollision(xx,yy)){
looseHealth();
loseHealth();
returntrue;
}else{
returnfalse;
}
}
// when looseHealth drop the help to 0, call the destroy function. which we will override ltr
publicvoidlooseHealth(){
// when loseHealth drop the help to 0, call the destroy function. which we will override ltr
publicvoidloseHealth(){
health-=1;
if(health==0){
destroy();
@@ -68,10 +49,7 @@ public class Player extends Sprite{
publicvoidshoot(){
Bullets.add(newBullet(xPos,yPos));
if(Bullets.size()==5){
Bullets.remove();// this should remove the first one that go into the list. it is a Que, so first in first out.