Java Edition


So, my little Radiant clone is getting closer and closer to the original game.

However, there were a few drawbacks, including my bad code that I have hopefully fixed, and others.

Don't take me wrong, I really like C, but it's a compiled language with all pros and cons of it.

What I mean, is that the game may not work properly on every OS or device. The best example is MacOS. I am compiling the binaries on my own computer with a deployment script. I have two of them - one native for Linux, and the other one for Windows (using MinGW).

And MacOS? I don't have a mac, and I don't think there is a cross-compiling platform. Not to mention, that apple's toolchain uses clang, which is a disaster, as it uses some different memory allocation strategy than gcc, causing my arraylist library - and the whole game in turn - to crash.

To solve this problem I would need a programming language that uses a virtual machine, so it's cross platform while being faster than python. There are two most well known VM languages - Java (JVM) and C# (CLR), both having a raylib binding.

And I decided to go with Java. Some say C# is faster than Java, but there are serious reasons:

  • C# is made by Micro$oft.
  • Relating to previous, using it on Linux is very ... ummm ... bad? To install any additional libraries you need to have a proprietary "dotnet" tool that does not work on my PC :|
  • IMO C#'s naming conventions are just bad. This may sound biased as I am used to Java's and C's ones, but really, who - except for raylib, but it's their specific - starts function names with uppercase letters!?
  • The namespaces are just a bad convention.

So, after some time of work I present you (though if you saw my git you may already know it) PixelAbyss: Java Edition.

It should run on every major OS and architecture, just some sidenotes:

  • As of writing this post it's not yet finished, and the jar distributed here is an early build. I am porting features of the C version, and each day getting closer to it, JE still lacks some critical features like asteroids. On the other hand it has some exclusive features like the fact that settings get saved to file.
  • The performance varies. The README of Jaylib states that every call to C is costly, and that it achieves only 84% of the C version. Most of the time you see no difference, although lag spikes are occasionally noticeable.

Files

pixab.jar 4.6 MB
Nov 27, 2023

Get PixelAbyss

Leave a comment

Log in with itch.io to leave a comment.