privateQueue<Bullet>Bullets=newLinkedList<>();// max on the screen at the same time, can be change ltr;
publicPlayer(){
super(0,0,0);//this should be the image number for the player
x=screenW/2;//haven't implement it yet
y=9*screenH/10;//haven't implement it yet
}
//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
@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.
publicbooleantouching(intxx,intyy)
{
if(super.touching(xx,yy)){
looseHealth();
returntrue;
}else{
returnfalse;
}
}
// when looseHealth drop the help to 0, call the destroy function. which we will override ltr
publicvoidlooseHealth(){
health-=1;
if(health==0){
destroy();
}
}
publicvoidshoot(){
Bullets.add(newBullet(x,y));
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.
}
}
@Override
publicvoiddestroy(){
//call animation also.
//this should call the pulse function for the game, and manu would pop up.