Square II

Hey all, I’ve just finished version 2 of the first game I’ve ever made. It’s inspired by the popular Tetris, but with some small twists. The new version has much better graphics, an improved gui system, a settings menu, nice transitions, multiple level sizes, and more… Oh, and it’s 100% free.

I built this in Java using Slick 2D (http://slick.cokeandcode.com/), and working with this library had been a breeze so far. I’ve built my own gui library, error handling, and other support code which I hope to reuse.

Feel free to play! I’d appreciate any feedback, especially on problems / exceptions you may encounter, even though I’ve tested this reasonably well. I’ve made a standalone installer for Windows (no Java required), which should making installing and getting started a breeze.

Features:

  • Inspired by the legendary game of Tetris
  • Complete a line of blocks of a single color and get triple points!
  • Five different modes available: from baby (extremely easy with huge blocks) to Rain of Blocks (very difficult, with tiny blocks)
  • High scores for each mode
  • Available for Windows

You can download the game from the Square2 download page.

Please let me know if you encounter any problems! In case of problems, there should be an file named error.log in the game directory where you can find more details. My next project will be a bit more challenging and a bit more original, and will involve conquering the galaxy and pew pew lasers ;D

Screenshots:

http://www.basvs.nl/wp-content/uploads/2013/11/sq2screens.png

Doesn’t work on Windows. Apparently, it seems Square2.exe was originally Square2.jar and you renamed it. Sorry but it doesn’t work that way. Also you extracted the lwjgl and slick jars into your jar when it would be best to leave them in their respective jars. You also included the natives inside your jar, however that doesn’t work. You have to either leave the natives in the folder of the game or in a subfolder. Either way, you have 3 options to be able to run this game:

  1. If you want us to run the game by double-clicking on the jar file, you will have to leave the natives in the root folder and modify the manifest to include the lwjgl and slick jars in the classpath like so:

Manifest-Version: 1.0
Main-Class: full.name.of.MainClass
Class-Path: lwjgl.jar slick.jar


(don’t forget to leave an empty line at the end)

  1. If you want to put the natives in a subfolder, you will have to create a bat file for windows or a shell script for Unix that will look like so:

java -Djava.library.path="natives/" -jar MyJar.jar

You will still have to setup the classpath like in option 1.

  1. Use a third-party application that creates an exe for Windows or the appropriate distribution format for Unix. A really good one is launch4j. You can also use our own kappa’s JarSplice which creates a jar file that has all the other jars and natives packed in there and it automatically extracts these resources to a temporary directory and deletes them once not needed :slight_smile:

EDIT: Also, don’t forget us 64-bit folks, you only packaged the 32-bit dlls :wink:

As crappy as the manifest format is, what gives you the impression that the trailing blank lines are required?

They just are, I don’t know why but if you don’t include them you’ll get a “Java Exception” when running the jar :wink:

Thank you for trying! I don’t get what you tried to do though, since I used Launch4J to wrap the executable .JAR in a windows executable. I am very well aware that simply renaming a .jar to an .exe file does not work, how did you come to the conclusion that I did?

Thanks on the advice on including jars / excluding natives, I’ll see if I can improve the packaging. And ofcourse the 64-bit ones :slight_smile:

Please note that there are two versions: one for windows (with a wrapped .exe file) and one for linux/mac. Which one did you try? I downloaded and extracted the game myself, and it works fine here.

Oh, I just noticed that I posted this topic in “Featured Games” instead of “Showcase” by accident. :-\ Shall I open a new topic in Showcase or can an admin move it? Sorry!

I came to that conclusion because when I unzipped the EXE I saw a META-INF folder with a MANIFEST.MF inside :wink:

An admin will most likely move it :slight_smile:

I started reading up on manifest files, and noticed the follwing on the Sun site:

[quote]The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
[/quote]
(http://docs.oracle.com/javase/tutorial/deployment/jar/modman.html)

So, not exactly two blank lines, but it does need a final newline (and hence one blank line).

Ah heh, I’m kind of a newbie when it comes to jars and manifests, I’m reading up on it now.

Oh so only 1 line? I must have been mistaken then :S

Try making a new EXE and include the 64-bit dlls plz :slight_smile:

I will, but I got to go for Sinterklaas-party with my family now first :slight_smile:

[quote]The text file from which you are creating the manifest must end with a new line or carriage return. The last line will not be parsed properly if it does not end with a new line or carriage return.
[/quote]
All that means is that the last line has to be properly terminated. Nothing about an extra CR/LF/CRLF required on its own line at the end. I’ve written lots of manifests before (it’s what OSGi uses for bundle metadata), and god is it ever an awful format, but I’ve not seen it require any blank lines at the end.

Doesn’t hurt tho and it does ensure you terminate the last line properly, so it’s not actually bad advice.

Funny, I didn’t know it was possible to unzip wrapped exe files. There is a manifest in the wrapped exe, though, because the exe is wrapped around the runnable jar. This runnable jar requires a manifest to point to the starting class. This is normal, right, that a wrapped exe includes a manifest file?

Anyway, I’ve been working on an Ant script to automate the build process a bit, and to improve the deployment package. The current runnable jar was generated using the Eclipse export function, but this gives very little control about what is included etc.

p.s. I see some attentive admin moved this thread, thanks.

edit: fixed typo

Very nice and polished game. Would say though in terms of gameplay I find that the board is a bit too wide, so might be a bit more fun to make it less wide as you can clear lines quicker. The gui is very nice and smooth though.

Good job on actually completing something.

It do think its something that belongs in the featured section :slight_smile:

btw your description says its available for both windows, mac and linux.

Wow, thanks for the compliment! ;D

And yes, the larger levels are a tad boring. I left them in for the possibility that someone would actually be bored enough to play through them…

My main goal for this game was indeed to make a game that was actually finished, and it feels really good to have one done now. I’m still struggling to get the deployment polished up a bit. I’ve been reading up on using Ant, One-Jar and ProGuard to automate and improve things a bit. These turned out to all be great and easy to learn tools, and now the game jar is much cleaner, optimized and includes the native DLLs that are extracted at runtime. And even better, I can now consistently make a nice deployment package. For the gameplay experience, not much should have changed.

One more thing: I’m working on a nice new mac and linux version that works (generated through my fancy new build.xml file), but that still needs a little time.

Still no 64-bit dlls :’(

Yup, sorry about the delay. However, I just uploaded new ZIP files for win, mac and linux. The windows and linux versions now also include the newest LWJGL DLLs in both 32bit and 64bit. (http://www.grunnt.nl/?page_id=21)

I hope it works on your computer now!

Yay, it works now :slight_smile:

Yep I agree with kappa, very polished and smooth, great job :slight_smile:

Thanks ;D Glad it works now, and thanks for the advice.

I’ve just put a new version of Square II online for each of the 3 platforms.

After observing some Square II gameplay sessions, I noticed that the game balance was a bit off. The baby mode wasn’t really easy, and the “huge” level size was a bit boring. In addition, the level size names turned out to confuse people (“huge” has got tiny blocks?).

In short, the changes are:

  • The level size selection has been replaced by a selection of five game “modes”, ranging from “Baby”, which is very easy, to “Rain of Blocks”, which is very hard.
  • Initial & max fall speed, and the rate in which fall speed increases has been tuned for each of the five game modes, so that in each mode the maximum falling speed is reached after 10 minutes.

Happy 2012!