Falling Bricks
Informace
Legendární logická hra ve zbrusu novém silně návykovém provedení!
Tento projekt byl vytvořen jako semestrální práce do předmětu
Y36ALG (Algoritmizace).
Popis hry na Wikipedii.
Stáhni a hraj!
Dokumentace
Zdrojové kódy (prohlížení)
- fallingbricks
1: package fallingbricks; 2: import javax.swing.JFrame; 3: import java.awt.*; 4: 5: /** 6: * FallingBricks - world famous game once again! 7: * 8: * Main class. 9: * 10: * @version 1.0 11/12/08 11: * @author Ondrej Macoszek, ondra [at] macoszek [dot] cz 12: */ 13: public class FallingBricks extends JFrame 14: { 15: /** 16: * Holds the game instance. 17: */ 18: public static Game game; 19: 20: 21: /** 22: * Main method call class constructor 23: * @param args the command line arguments not used 24: */ 25: public static void main(String[] args) 26: { 27: new FallingBricks(); 28: } 29: 30: /** 31: * Set up the window, create game instance and start new round 32: */ 33: public FallingBricks() 34: { 35: // Get the center point and set window dimension 36: Point center = GraphicsEnvironment.getLocalGraphicsEnvironment().getCenterPoint(); 37: Dimension dimension = new Dimension(250, 600); 38: 39: // Positionize the window 40: setBounds( 41: center.x-dimension.width/2, 42: center.y-dimension.height/2, 43: dimension.width, 44: dimension.height 45: ); 46: 47: // Additional window settings 48: setTitle("FallingBricks"); 49: setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 50: setVisible(true); 51: 52: // Create game instance, set key listener to it and attach to window 53: game = Game.getInstance(); 54: addKeyListener(game); 55: add(game); 56: game.start(); 57: } 58: } 59:
