Skip to content
Permalink
83f39598ba
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
21 lines (18 sloc) 559 Bytes
package images;
import java.awt.Image;
public class Shipinter {
Image image;
public Shipinter(Image shipID){
this.image = shipID;
}
//added a method to retrieve the size of the ship, so it can be drawn onto the actual game.
//the Size is stored in an array where [1] is the width and [2] is the height
//it can be used for both player ships and enemy ships
public int[] getsize(){
int[] shipsize;
shipsize = new int[2];
shipsize[1] = image.getWidth(null);
shipsize[2] = image.getHeight(null);
return shipsize;
}
}