You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add Launch4J configuration and a new Gradle taks launch4j for generating an Windows exe file
- Use a Gradle plugin to create MAC OS X app package and a dmg file
- Remove the publish HiScores functionality, as it did not work
- Remove the webapp source folder, since there is no web page anymore
- Small code improvements
- Update Gradle wrapper to version 2.5
- Update the documentation
Copy file name to clipboardExpand all lines: README.md
+45-9Lines changed: 45 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,18 @@
1
-
# Jetris - A Java-Based Tetris Clone
1
+
# JETRIS - A Java-Based Tetris Clone
2
2
3
3
## TL;DR
4
4
5
-
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.
5
+
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.
6
6
7
7

8
8
9
9
### This Readme includes:
10
10
11
11
1. System Requirements
12
12
2. How to Build JETRIS
13
+
* How to build an Windows EXE
14
+
* How to build a Mac OS APP and DMG
15
+
* How to extend JETRIS
13
16
3. Running JETRIS on Your System
14
17
4. How to Play
15
18
5. Scoring System
@@ -20,11 +23,11 @@ Jetris is a Java-based Tetris clone for the desktop. Jetris is focused on a fast
20
23
21
24
JETRIS is written in the JAVA programming language, this means that it can be run on any Operating System which has JAVA Runtime Environment (JRE).
22
25
23
-
You need JRE 1.6.0 or above. You can download JRE for free at www.java.com
26
+
You need JRE 1.7.0 or above. You can download JRE for free at www.java.com
24
27
25
28
2. How to Build JETRIS
26
29
----------------------
27
-
If you want to build JETRIS on your local machine you need to install the Java Development Kit (JDK). You need JDK 1.6.0 or above.
30
+
If you want to build JETRIS on your local machine you need to install the Java Development Kit (JDK). You need JDK 1.7.0 or above.
28
31
29
32
JETRIS uses the Gradle build system, you can build the project locally just by typing the following in the console:
30
33
@@ -37,20 +40,53 @@ On Windows use:
37
40
./gradlew.bat build
38
41
```
39
42
40
-
The generated jar file can be found in the folder _build/libs_
43
+
The generated jar file can be found in the folder _build/libs_.
44
+
45
+
### How to build an Windows EXE
46
+
The Gradle build script provides a way to build an Windows executable. You can even do this on a non-Windows machine. For that purpose you need an external application called
47
+
[Launch4j](http://launch4j.sourceforge.net/). Download it and install it on your local machine. The version used to test this feature is 3.8, but it will probably work with
48
+
other versions too. In addition to this, you need to create an environment variable called `LAUNCH4J_HOME` which points to the folder where you have installed the application.
49
+
50
+
After that you can build the exe file by running:
51
+
```
52
+
./gradlew launch4j
53
+
```
54
+
55
+
The generated exe file can be found in the folder _build/launch4j_.
56
+
57
+
### How to build a Mac OS APP and DMG
58
+
The JETRIS Gradle build script uses [MacAppBundle Plugin](https://github.com/crotwell/gradle-macappbundle) to generate Mac OS X app packages _and_ a _dmg_ distribution file.
59
+
This is done automatically with each Gradle build.
60
+
61
+
The generated app package can be found in the folder _build/macApp_ and the dmg file in _build/distributions_.
62
+
63
+
### How to extend JETRIS
64
+
If you want to import the project in an IDE such as Eclipse or IntelliJ IDEA then Gradle provides a way to generate all the necessary project files.
65
+
66
+
Generate Eclipse project:
67
+
```
68
+
./gradlew eclipse
69
+
```
70
+
71
+
Generate IntelliJ IDEA project:
72
+
```
73
+
./gradlew idea
74
+
```
41
75
42
76
3. Running JETRIS on Your System
43
77
--------------------------------
44
78
45
79
To start JETRIS try one of the following options:
46
80
47
-
* Double click on the JAR File to start JETRIS. If this didn't work, then you didn't associate your JAR Files with your JRE.
81
+
* Double click on the JAR File to start JETRIS. If this didn't work, then you didn't associate your JAR Files with your JRE.
82
+
83
+
* For Windows users we also provide an exe file, which ist just a wrapper for the JAR file. Double click on the exe file to start the application.
48
84
49
-
* Double click on JETRIS.bat for Windows users or on JETRIS for Linux/OS X users.
85
+
* Double click on `JETRIS.bat` for Windows users or on `JETRIS` for Linuxusers. This will start the application, but only if you have built it with Gradle first.
50
86
51
87
* Open the console go to your JETRIS folder and type:
52
88
```
53
-
java -jar JETRIS.jar
89
+
java -jar jetris-1.2.jar
54
90
```
55
91
56
92
4. How to Play
@@ -83,4 +119,4 @@ The current level is 20 (the highest level) and You clear 4 Lines at once, then
83
119
6. Saving Your Old HiScores
84
120
---------------------------
85
121
86
-
Copy the old JETRIS.dat File to your new version of Jetris folder.
122
+
Copy the old `JETRIS.DAT` File to your new version of JETRIS folder.
if (launch4jDir ==null||!(newFile(launch4jDir).exists())) {
50
+
thrownewGradleException("'LAUNCH4J_HOME' not defined or invalid. Launch4j (http://launch4j.sourceforge.net) is required to generare the JETRIS Windows EXE file.")
0 commit comments