-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated all Classes because merge failed
- Loading branch information
Gavin Li
committed
Apr 10, 2015
1 parent
87f4d44
commit fce685a
Showing
7 changed files
with
406 additions
and
194 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package sprites; | ||
|
||
import java.awt.Graphics2D; | ||
import java.awt.Rectangle; | ||
|
||
public class MerchantSprite { | ||
private int x, y; | ||
private static final int WIDTH = 30; | ||
|
||
public MerchantSprite(int row, int col) { | ||
this.x = col*WIDTH; | ||
this.y = row*WIDTH; | ||
} | ||
|
||
/** | ||
* Paints the sprite at its current location | ||
* @param g Graphics2D for painting | ||
*/ | ||
public void paint(Graphics2D g) { | ||
g.fillRect(x, y, WIDTH, WIDTH); | ||
} | ||
|
||
/** | ||
* Gets the bounds of the sprite in the form of a Rectangle | ||
* @return the Rectangle formed by the sprite | ||
*/ | ||
public Rectangle getBounds() { | ||
return new Rectangle(x, y, WIDTH, WIDTH); | ||
} | ||
} |
Oops, something went wrong.