i want to create 2 items on screen. each item will be different color rect.
item1 = green rect
item2 = blue rect
if user get the 1st item. than it will print bullet1 1st image.
if user get the 2nd item. than it will print bullet2 2nd image.
bullet1 = 1st image
bullet2 = 2nd image
public void Item
{
int x, y;
}
public void Bullet extends Item
{
int dx = 1;
}
i am not sure how to create 2 different color rect. bc les say in item class
public void paint(...)
{
g.setColor(Color.green);
g.fillRect(x,y,width,height);
}
but this will only create one type of item, green. how can i do this without making another item class?