Sokobanski

Hello, JGO community!
This is my first finished game because I used to be that type of person who never finishes his games and softwares.

As I announced earlier, new version of Sokoban is ready for download exactly at the end of the week. I could’ve released it earlier, but since I wrote the whole version from scratch, my perfectionism delayed it. Basically, it took me so long because of my over complications for the new version. I wanted to add a lot of features, but decided yesterday to keep it simple and add other stuff later. Well, version 2.0 of this game was finally released on April 26, 2015 around midnight.

What’s new?

  • Moved from TMX maps, to simple Sokoban format maps.
  • A whole new set of 40 levels.
  • Undo and redo functions for player movement added.
  • Better look in general (outlined font) and better screen transitions.
  • Control keys are configurable now.
  • Fixed previously reported bugs (hopefully).
  • Since I wrote the whole version from scratch, code is generally better.

Download (through my website): http://ivanvinskigames.webs.com/games
Download (direct): https://www.dropbox.com/s/nqqxet6724pzz0q/Sokobanski-V2.jar?dl=1

http://s16.postimg.org/6d4ulgmh1/screenshot2.png

http://s16.postimg.org/6ejdsmdol/screenshot1.png

http://s16.postimg.org/ysotci18l/screenshot3.png

http://s16.postimg.org/ma3mi6ev9/screenshot4.png

Nobody can see your dropbox image :point:

Thanks for notifying me!

It wouldn’t open so I ran it in command line. I got this error:

Exception in thread "LWJGL Application" java.lang.NullPointerException
	at java.io.File.<init>(File.java:277)
	at com.webs.ivanvinskigames.game.util.GameData.create(GameData.java:94)
	at com.webs.ivanvinskigames.game.util.GameData.load(GameData.java:65)
	at com.webs.ivanvinskigames.game.Sokoban.create(Sokoban.java:48)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:137)
	at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)

I followed the error and it came to this:

public static String getAppData()
  {
    String os = System.getProperty("os.name").toLowerCase();

    if (os.contains("windows"))
      return System.getenv("APPDATA");
    if (os.contains("linux")) {
      return "/home/ivan/.Ivan Vinski Games/Sokobanski";
    }

So it seems the problem is because I ran it on Mac…
Reply if you need help porting the filepath to mac it should be similar to linux

I often use this:

-ClaasJG

I disagree with that post. You should always store user data for your application with the user. Always use System.getProperty(“user.home”). That will always exist no matter the OS and then you can just append your path to the result. Or you could also use the prefs utility, but that is not really meant for game data, which can get quite large.

[OT]
It stores data per user, using home or appdata or “/Library/Application Support”.
So you store data with the user always in the platform prefered way.

-ClaasJG

EDIT because I don’t want to hijack this thread :wink: and I got the feeling this is going to be a conversation between @CaptainJester and me. The edit referes to msg340220.

The posted snipped uses the platform prefered way. It is no work to detect it and expected.
Supposed we are on an unknown platform it provides a fallback solution.

 // If auto-detection failed, or if not known, fall back to user home
    if ((appdir == null) || !appdir.exists() || !appdir.isDirectory()) {
        appdir = new File(System.getProperty("user.home"));
        appName = "." + appName;
    }

[/OT]

Nice gui and polished look.
I like the music (and to be honest the music off button ;P)
Maybe you could add a ‘step counter’, not even changing the gameplay but just showing the steps.

-ClaasJG

White text on a yellow background is unreadable. White text with a black border is readable on anything!

If you are checking what OS you are on before trying to use something then you are introducing OS dependencies. This will make your code a lot less portable, as the OP found out when someone tried it on Mac. If you just use “user.home” you will never have a problem.

I haven’t been active on these forums so much lately, but I’m back and I will try to fix all those problems.

Thanks to all of you for pointing out issues and problems for my game!

Thank you for the nice words and a solution to the problem! I might create step counter soon, but I’m not sure. My first priority is fixing issues with the game as it is and to not make the same mistake with the game I’m currently working on. And to be honest, even I don’t know how to finish some of those levels, so I’ll have to create a whole set of new levels in order to put in a solution hahaha :stuck_out_tongue: ;D

With the current game I’m working on, I learned that I can outline text using FreeType extension. Thanks!

Well, since I want to use app data on Windows, I just decided to simply fall back onto “user.home” if a directory isn’t found.

Well, let’s bump for the new version! ;D