Skip to content

Game#25

Merged
avanderlinden merged 22 commits intomasterfrom
game
Sep 15, 2017
Merged

Game#25
avanderlinden merged 22 commits intomasterfrom
game

Conversation

@mkhattat
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown
Collaborator

@IvoSchols IvoSchols left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Javadoc comments are necessary and commented code should not be in the master branch.

System.out.println("Hi");

public static void main(String[] args) {
//StartupScreen startupScreen = new StartupScreen();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

*/
private Launcher() {
public void launch() {
//StartupScreen startupScreen = new StartupScreen();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

}
dragAnimation.end();
dragAnimation = null;
//System.out.println("End Drag Animation");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

add(mainFrame, JLayeredPane.DEFAULT_LAYER);
setPreferredSize(mainFrame.getPreferredSize());

//MyMouseAdapter mouseAdapter = new MyMouseAdapter(this);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove commented code.


}

private void createHeaderLabel() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

}

@Override
public void start(Point p) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already in the interface class.

}

@Override
public void update(Point p) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already in the interface class.

}

@Override
public void end() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already in the interface class.

mainScreen.refreshBoard();
}

private void restoreScreen() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

mainScreen.refreshBoard();
}

private void drawItems(LinkedList<JLabel> list) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing javadoc comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@Samtaklimi87
Copy link
Copy Markdown
Collaborator

using the interface for UI was good ,i see some java docs are missing but Ivo noticed that nicely.

@IvoSchols
Copy link
Copy Markdown
Collaborator

Javadoc comments are added, so the branch seems good to go.

@IvoSchols IvoSchols closed this Sep 14, 2017
@IvoSchols IvoSchols reopened this Sep 14, 2017
IvoSchols
IvoSchols previously approved these changes Sep 14, 2017
Copy link
Copy Markdown
Collaborator

@avanderlinden avanderlinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall seems good. Maybe we can move the checking of the 3-on-row to a separate class or in de game class.

public static final int BOARD_HEIGHT = 10;
public static final int SCREEN_WIDTH = 800;
public static final int SCREEN_HEIGHT = 600;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number of x and y items on the board are related to the dimensions of the screen. They could be linked together.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed them. They are not needed anymore!

originalYGridPosition = tile.getGridPosition().y;
int x = (SwingUtilities.convertPoint(tile.getImageIcon(), tile.getImageIcon().getX(),
tile.getImageIcon().getY(), mainScreen.getGridBoard())).x;
deltaX = x - MARGIN;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deltaX name is a bit vague. The x position shouldn't have to change if you move vertically right?

Copy link
Copy Markdown
Owner Author

@mkhattat mkhattat Sep 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change it to something more clear.

}

originalXGridPosition = tile.getGridPosition().x;
int y = (SwingUtilities.convertPoint(tile.getImageIcon(), tile.getImageIcon().getX(),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't tile.getImageIcon().getX() be tile.getImageIcon().getY() if you try to compute the y position?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the code and using tile.getX is enough.

Copy link
Copy Markdown
Collaborator

@avanderlinden avanderlinden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good now!

@avanderlinden avanderlinden merged commit 48b13b7 into master Sep 15, 2017
@mkhattat mkhattat deleted the game branch September 28, 2017 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants