Skip to content

Commit 0515934

Browse files
committed
JETRIS Version 1.2
- Add Launch4J configuration. - Remove the publish HiScores functionality, as it did not work. - Remove the webapp source folder, since there is no web page anymore. - Adjust documentation.
1 parent bc939e8 commit 0515934

39 files changed

+74
-606
lines changed

CHANGES.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
2015-08-06
2+
----------
3+
* JETRIS Version 1.2
4+
* Add Launch4J configuration
5+
* Remove the publish HiScores functionality, as it did not work
6+
* Remove the webapp source folder, since there is no web page anymore
7+
18
2015-08-05
29
----------
310
* JETRIS Version 1.1.1

JETRIS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/bin/sh
22

33
java -jar build/libs/jetris.jar
4+

JETRIS.bat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
rem Batch file to run JETRIS on Windows
22

33
start javaw -jar build\libs\JETRIS.jar
4+

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Jetris - A Java-Based Tetris Clone
22

3+
## TL;DR
4+
35
Jetris is a Java-based Tetris clone for the desktop. Jetris is focused on a fast gaming, so a game usually takes about 10 min.
46

5-
![](http://jetris.sourceforge.net/img/screen1.png)
7+
![](screenshot.png?raw=true)
68

79
### This Readme includes:
810

@@ -11,7 +13,7 @@ Jetris is a Java-based Tetris clone for the desktop. Jetris is focused on a fast
1113
3. Running JETRIS on Your System
1214
4. How to Play
1315
5. Scoring System
14-
6. Saving Your Old HiScores After Version Update
16+
6. Saving Your Old HiScores
1517

1618
1. System Requirements
1719
----------------------
@@ -51,7 +53,7 @@ To start JETRIS try one of the following options:
5153
java -jar JETRIS.jar
5254
```
5355

54-
3. How to Play
56+
4. How to Play
5557
--------------
5658

5759
Use the following keys to play JETRIS:
@@ -66,7 +68,7 @@ Use the following keys to play JETRIS:
6668
* H - View HiScore
6769
* Esc - Exit
6870

69-
4. Scoring System
71+
5. Scoring System
7072
-----------------
7173

7274
* Clearing 1 Line at once, gives You 100 points + 5 x the current level
@@ -78,9 +80,7 @@ Use the following keys to play JETRIS:
7880

7981
The current level is 20 (the highest level) and You clear 4 Lines at once, then You get 1600 + 80 x 20 = 2 x 1600 = 3200. So on level 20 you are making twice as much points as on level 0.
8082

81-
5. Saving Your Old HiScores After Version Update
82-
------------------------------------------------
83+
6. Saving Your Old HiScores
84+
---------------------------
8385

8486
Copy the old JETRIS.dat File to your new version of Jetris folder.
85-
86-

build.gradle

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ task wrapper(type: Wrapper) {
66
gradleVersion = '2.4.0'
77
}
88

9+
// Keep this in sync with JetrisMainFrame.NAME
10+
version='1.2'
11+
912
repositories {
1013
mavenCentral()
1114
}
@@ -18,3 +21,16 @@ jar {
1821
attributes 'Main-Class': 'JetrisMain'
1922
}
2023
}
24+
25+
// Windows wrapper configuration to generate "jetris.exe" //
26+
task launch4jConfig(type: Copy) {
27+
from 'src/main/resources/launch4j.xml'
28+
into 'build/launch4j'
29+
expand(
30+
JAR_FILE: project.jar.archivePath,
31+
VERSION: project.version,
32+
ICON: file('src/main/resources/jetris.ico')
33+
)
34+
}
35+
36+
build.dependsOn 'launch4jConfig'

gradlew

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gradlew.bat

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/com/devng/jetris/JetrisMainFrame.java

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.devng.jetris;
22
/* MainFrame created on 14.09.2006 */
33

4-
import com.devng.jetris.io.PublishHiScore;
5-
64
import javax.imageio.ImageIO;
75
import javax.swing.*;
86
import javax.swing.border.BevelBorder;
@@ -13,7 +11,8 @@
1311

1412
public class JetrisMainFrame extends JFrame {
1513

16-
private static final String NAME = "JETRIS 1.1.1";
14+
// Keep the version number in sync with build.gradle
15+
private static final String NAME = "JETRIS 1.1.2";
1716
private static final int CELL_H = 24;
1817

1918
private Font font;
@@ -54,7 +53,6 @@ public class JetrisMainFrame extends JFrame {
5453
private HelpDialog helpDialog;
5554

5655
private JPanel hiScorePanel;
57-
private PublishHandler pH;
5856

5957
private class GridThread extends Thread {
6058

@@ -192,8 +190,6 @@ public void keyPressed(KeyEvent e) {
192190
};
193191
addKeyListener(keyHandler);
194192

195-
pH = new PublishHandler();
196-
197193
font = new Font("Dialog", Font.PLAIN, 12);
198194
tg = new TetrisGrid();
199195
ff = new FigureFactory();
@@ -933,52 +929,8 @@ private void setHiScorePanel() {
933929
table.setEnabled(false);
934930

935931
hiScorePanel.add(table, BorderLayout.CENTER);
936-
JButton jb = new JButton("Publish HiScore Online");
937-
jb.addActionListener(pH);
938-
939-
hiScorePanel.add(jb, BorderLayout.SOUTH);
940-
}
941-
942-
943-
private class PublishHandler implements ActionListener {
944-
public void actionPerformed(ActionEvent ae) {
945-
JButton jb = (JButton) ae.getSource();
946-
PublishThread pt = new PublishThread(jb);
947-
pt.start();
948-
}
949-
}
950-
951-
private class PublishThread extends Thread {
952-
953-
private JButton but;
954-
955-
PublishThread(JButton source) {
956-
super();
957-
but = source;
958-
}
959-
960-
public void run() {
961-
but.setEnabled(false);
962-
boolean b = false;
963-
try {
964-
for (int i = 0; i < tg.hiScore.length; i++) {
965-
PublishHiScore.publish(tg.hiScore[i]);
966-
}
967-
} catch (Exception e) {
968-
e.printStackTrace();
969-
b = true;
970-
JOptionPane.showMessageDialog(hiScorePanel, "Could not publish HiScore online!\nTry again later!", "ERROR",
971-
JOptionPane.ERROR_MESSAGE);
972-
}
973-
if (!b) {
974-
JOptionPane.showMessageDialog(hiScorePanel, "Publishing HiScore was successfull :)", "HI SCORE",
975-
JOptionPane.INFORMATION_MESSAGE);
976-
}
977-
but.setEnabled(true);
978-
}
979932
}
980933

981-
982934
private class MenuHandler implements ActionListener {
983935

984936
public void actionPerformed(ActionEvent e) {

src/main/java/com/devng/jetris/io/PublishHiScore.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

0 commit comments

Comments
 (0)