//get input from the joystick, and change the location
// tbh I think this is goingto give us an error ltr, becuase we are going to call update and shoot constantly, I wonder what will happen if we write and deleting at the same time. We'll see tho
// tbh I think this is goingto give us an error ltr, because we are going to call update and shoot constantly, I wonder what will happen if we write and deleting at the same time. We'll see tho
@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.