Permalink
Cannot retrieve contributors at this time
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?
CSE2102_group_37/src/images/Shipinter.java
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
21 lines (18 sloc)
559 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} | |
} |