Professional Documents
Culture Documents
AnasTaher 18112444 TugasMembuatPuzzleGambarOrdo4x4
AnasTaher 18112444 TugasMembuatPuzzleGambarOrdo4x4
NIM : 18112444
MATA KULIAH : Game Developer
Tugas : Puzzle Gambar Dengan Java Netbeans
-------Code------
SlidePuzzle.java
package slidepuzzle;
import javax.swing.JFrame;
SlidePuzzleGUI.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package slidepuzzle;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
if (!_puzzleModel.moveTile(row, col)) {
Toolkit.getDefaultToolkit().beep();
}
this.repaint();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
SlideModelPuzzle.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package slidepuzzle;
_face = face;
}//end constructor
public void setFace(String newFace) {
_face = newFace;
}//end getFace
public String getFace() {
return _face;
}
public boolean isInFinalPosition(int r, int c) {
return r==_row && c==_col;
}
}