Skip to content

Commit 2037d48

Browse files
committed
Added JavaDoc/Comments for Screen class
One of the most important classes for the game. Screen Class is used when ever rendering object
1 parent 292abd6 commit 2037d48

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/com/redomar/game/gfx/Screen.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ public class Screen {
1818

1919
private SpriteSheet sheet;
2020

21+
/**
22+
* Constructs the draw area
23+
* @param width width of the screen
24+
* @param height height of the screen
25+
* @param sheet Sprite-sheet selector. Constructed Spritesheet needs to be here,
26+
* Sprite-sheet cp requires path only.
27+
*/
2128
public Screen(int width, int height, SpriteSheet sheet) {
2229

2330
this.setWidth(width);
@@ -26,11 +33,21 @@ public Screen(int width, int height, SpriteSheet sheet) {
2633

2734
setPixels(new int[width * height]);
2835
}
29-
3036
public static int getMapWidthMask() {
3137
return MAP_WIDTH_MASK;
3238
}
3339

40+
41+
/**
42+
* Rendering sprites from Spritesheet onto the game world.
43+
* Render contstucter requires
44+
* @param xPos X Postion of subject
45+
* @param yPos Y Postion of subject
46+
* @param tile tile location. e.g 7 * 32 + 1 is the oblong bullet on the 7th row 2nd colomn
47+
* @param colour Using established colouring nomanclature. i.e. use com.redomar.game.gfx.Colours
48+
* @param mirrorDir flip Direction: 0x00 first 0 flip verticle, second 0 flip horizontal. 0x01 horizontal
49+
* @param scale Scale
50+
*/
3451
public void render(int xPos, int yPos, int tile, int colour, int mirrorDir,
3552
int scale) {
3653
xPos -= xOffset;

0 commit comments

Comments
 (0)