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.
25 lines (23 sloc)
780 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; | |
// The fuck does shipinter stand for? | |
// Also, don't forget to PascalCase class names. | |
// I won't fix this one. | |
public class Shipinter { | |
Image image; | |
public Shipinter(Image shipID){ | |
this.image = shipID; | |
} | |
// WHY IS THE IMAGE PARAMETER CALLED SHIPID? | |
//added a method to retrieve the size of the ship, so it can be drawn onto the actual game. | |
// You'll need to have a method to either get the image or to draw it-Eyal | |
//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; | |
} | |
} |