Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (724)
Games in Android Showcase (216)
games submitted by our members
Games in WIP (791)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1] 2 3 ... 6
1  Games Center / Contests / Re: End of 4K. Thanks all! on: 2014-11-30 14:28:31
Just keep the site running for historical reasons, be a shame to lose all those games. Smiley

Even though half of them are broken.
With some combination of old JRMs and decompile-tweak-recompile it should be possible to get most of the broken ones working.

The biggest problem is that some of the older web start games were not hosted on the java 4k site, and their URLs no longer point to the game.  It would be nice to create an archive of those lost games (if anyone has them), but that would require possibly tracking down the ownership rights.
2  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (v1.1) on: 2014-06-14 02:50:00
I just tried the links:

and they seem to be working for me.  Let me know which site you're having difficulty with, and I'll investigate the issues.
3  Games Center / 4K Game Competition - 2014 / Re: Results due soon on: 2014-03-21 02:09:42
Well done for all the entrance, and especially big thanks to the judges for putting in the time on the write ups.

4  Games Center / 4K Game Competition - 2014 / Re: Community voting on: 2014-03-04 15:12:42
On the community voting page - the point remaining tally starts at 30, but then after the first number is allocated, the tally jumps up to be 50 point based.  If you use up all those 50 points and click submit, an error is displayed reporting that you use more than the 50 points.
5  Games Center / 4K Game Competition - 2014 / Re: Community voting on: 2014-03-04 03:54:09
Are we going to advertise the Java4k launcher on the site as an alternative to the big scary security settings?
6  Games Center / 4K Game Competition - 2014 / Re: Raid On Java 4K on: 2014-02-10 21:56:07
A few things for the optimization:

I changed the class name to "R", because that saves a few bytes.  I also removed the package, as that saves even more.

I replaced the processEvent method with:

    public boolean handleEvent(Event e) {
        boolean down = true;
        if ( == Event.KEY_RELEASE || == Event.KEY_ACTION_RELEASE) {
            down = false;
        if ( >= Event.KEY_PRESS && <= Event.KEY_ACTION_RELEASE) {
            keyboardMap[e.key] = down;
        return false;

Followed by removing the enableEvents call, and replaced all the VK_ values with local definitions of the key mappings.

(full source:

These changes, when run through my compressor tool chain ( brought the size down to 4124 bytes.  Not quite there.

Another big optimization you can do is change the image maps from 1 character = 1 pixel down to 1 bit = 1 pixel (you have currently '.' or 'X' to be a on or off value).  Because you have 32 pixels horizontally, this maps to 2 characters per line.  For the case where you have the "O" to indicate a third color, this could either be eliminated for space, or you could hard-code in the range for when it's the specific other color.  Something like this:

            char[] copterBase =
                    (char) 0x0000 + (char) 0x0000 + // "................................" + //
                    (char) 0x8000 + (char) 0x0005 + // "...............XX.X............." + //
                    (char) 0x8000 + (char) 0x0007 + // "...............XXXX............." + //
                    (char) 0x8000 + (char) 0x0005 + // "...............XX.X............." + //

7  Games Center / 4K Game Competition - 2014 / Re: Raid On Java 4K on: 2014-01-30 05:39:04
It's great to see another entry here.

The graphics look smooth and great.  The heat effect for the explosions and bullets turned out well.

It's too bad about the factories just looking like squares - at first, I didn't read the instructions closely and thought that they were landing pads.  I had cleared out all the enemies but never dropped a bomb on them.  Then, I went back and read the instructions.  The game definitely improves once you level up a few times.
8  Games Center / 4K Game Competition - 2014 / Re: Hero Band Revolution 4k on: 2014-01-20 02:39:51
The sound seems to work fine on my Mint Maya (based on Ubuntu Precise) desktop, although I'm not certain about the graphics: there's a very weird glyph in the bottom-left which seems to be caused by overlaying strings which should be separate.

Thanks for the testing.  I updated the game to use musical notes instead of the burst of accents.  It's been accepted on the site now.
9  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (Final) on: 2014-01-14 16:57:58
I added the fixes to the security classes, image size parsing, and some other little nuggets that were hiding around.  Still no judges comments  Sad

Java4K.exe doesn't work and neither does the JAR. Running the BAT file works.
The error with the JAR is a NullPointerException in File's constructor when you call it at line 80 of your Security class.

The direct-from jar launching should report a better error now.  As for the Java4k.exe - if run the "no bundled jre" version, it expects a 32-bit version of the JRE to be installed.  If you only have the 64-bit version, I'm guessing it won't run.  Which version did you try out?
10  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (Final) on: 2014-01-12 23:29:42
The Supway issue was due to a parsing problem with the applet size. Launching the tool from the jar directly isn't supported, so I added better error reporting. I'm still looking into the exe issue.

The issue around The Dark is actually due to a threading issue (I wouldn't have been able to find it without the posted source - thanks Gef!).  This is the same issue that some applets encountered when running on a Mac - the applet container wasn't ready when the graphics context was requested. Some applets will loop at the start, waiting for the isAvailable() call to return true.

I don't know the right fix for this one. Should the launcher be made to match of one specific JVM behavior (Windows) or another?
11  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (RC4) on: 2014-01-12 17:19:29
I'll check out those issues soon and post an update when I have a fix.

If someone wants to volunteer to make a Mac bundle, please stand up.  Or, I guess I coulld invest some time looking into this article (, but I don't have any way to test it.

I could make that for you. I'm having holidays till this friday.
That would be greatly appreciated!

Also you should add judge comments Smiley

I'll check with Appel to see if he could add those to the Json output.
12  Games Center / 4K Game Competition - 2014 / Re: Hero Band Revolution 4k on: 2014-01-10 18:40:36
I've given up on the getting the Linux javax.sound working right on my Gentoo box - the SourceDataLine.write isn't blocking when the buffer is full, and none of the query methods report the correct status information.

Please let me know how it plays on your machines.  I'm interested to know if this really is Windows only at this point.
13  Games Center / 4K Game Competition - 2014 / Hero Band Revolution 4k on: 2013-12-31 18:31:45

Now on

A music strum-along rhythm game.  Play along with the melody on your 2-string fretted bass!


Completed and posted on Java4k.

Old status:

It's mostly done now.  I'm just working through the songs.

I've only really tested it on Windows.  Linux was giving me issues because it isn't blocking on SourceDataLine.write, and I don't have a Mac on which I can test it.
14  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (RC4) on: 2013-12-12 01:02:24
RC4 - improved the applet experience by centering the applet frame when it appears, and gave it focus so keyboard applets don't require the initial click.


Added a version of the launcher that includes a windows executable (created using launch4j), and a version that has that executable + a bundled JRE 1.7 for Windows.

A Windows-based installer could be made to go with these.  I'll look into NSIS later.

If someone wants to volunteer to make a Mac bundle, please stand up.  Or, I guess I coulld invest some time looking into this article (, but I don't have any way to test it.
15  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (RC1) on: 2013-12-11 15:31:20
RC1 is available.
Apo found a bug with Class.getResource() not finding the file in the jar.  RC2 fixed this.

EDIT: but there were still permission issues around loading the resource and temp file writing by ImageIO.  RC3 fixes that.
16  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher (RC1) on: 2013-12-11 03:10:56
RC1 is available.  Please send me your bugs or improvement requests soon, so we can get this published out on the site.

It's only available as a jar + startup scripts, so no EXE bundle available.  If you have suggestions on how to bundle this with a JRE, or want to volunteer to do this yourself, please feel free to pitch in.
17  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-08 04:17:03
New version, with performance improvements, better webstart compatibility, and better messages.

The next big feature I'm planning on adding is showing and submitting comments.
18  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-07 15:10:12
I also managed to fix bin/java4k and get it to run:
The bundle ant task should automatically fix the line endings for both java4k and java4k.bat.  That way, you can edit the file in your own line ending OS, and the distribution will be in the correct one.

Does the program actually use the cache? It seems to reload everything on-demand, even though I've primed the cache. (Since it just took 5 minutes to launch Snakes on a Plane, allowing me to fill the cache overnight would make it a lot more usable).

I'm going to open a ticket or two on Pikacode when my registration confirmation comes through.
Yes, it does use the cache, but I have been working through the security manager settings - apparently it was too restrictive, and the code was silently not allowing URLs to be created for local files.  When I open up the permissions for the shipped jar, the thing runs much faster.
19  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-06 08:09:43
I posted a new version, and the bundled zip download should be working now.
20  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-06 04:28:49
Those of you who have actually managed to run this: how did you handle the problem with not being a JNLP file? I'm not sure what to change to allow load-cache to finish.
The file under resources/net/javagaming/java4k/launcher/fixed-urls.json was made with this purpose in mind.  You'll need to add an entry in that file to note the changed URL.  In this case, I recommend creating a local jnlp file that's essentially a no-op replacement.

One of the tasks I have is to make the cache loading tool skip bad files like this, so soon it shouldn't be an issue.  The current code can keep going now.
21  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-03 21:14:54
A new version of the launcher is available that's compatible with the updated data.  If you have an existing version, you'll need to wipe out the cache directory.
22  Games Center / 4K Game Competition - 2014 / Re: Java4k Launcher on: 2013-12-03 09:11:21
I was able to get the WebStart games to sort of work.  However, it seems that many of the JNLP files redirect to other sites, and many of those are no longer available.  There could be some hacks to redirect those using the caching mechanisms, but would it instead be possible to host those files directly on the java4k site?

I know that this is lower priority, because we want people playing the new games for this year's contest, but I would like to be able to look at some of those old games for historical preservation purposes.
23  Games Center / 4K Game Competition - 2014 / Java4k Launcher (v1.1) on: 2013-12-02 17:30:50
Download the current version (v1.1) (2.0 mb) which includes a Windows executable that detects the current win32 JRE.  If you only have the 64-bit JRE installed, you'll need to run the bat file.  It also includes shell scripts for Linux and (fingers crossed) Mac.

Download the current version (v1.1) for Windows with a bundled 32-bit JRE (36.4 mb)

Source code and project is hosted here:

You can open tickets on that site, or post bugs on this thread:

24  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-12-01 04:09:33
Open up Dec 1st (tomorrow) as is?

Applet launcher can appear on the site when it's ready. I'm going to add json services to retrieve game list and such, so it doesn't depend on some html code that could possibly change.

Sounds like a good plan.  Developers can start testing out the launcher as it updates (located here:  Once the new forum opens, I'll start a thread there for bugs, feature requests, updates, and so on.
25  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-29 13:16:13
Here's a screenshot from the current build:

Here's my current list of to-dos:
  • The rest of the details needs to be loaded from the Java4k page.  Right now that's not happening.
  • There's some general Swing layout issues.  The details view of the active game needs a lot of improvement.  The layout is just not done right. I'm no Swing expert, and forms have always given me trouble. The default location for the splitters needs to be set to a reasonable value - right now, you need to manually adjust them at the start.  It'd be nice to add in some pretty icons.
  • Conversion from the HTML non-ascii characters and the Java string isn't working right - you'll notice some of the names aren't showing up right.
  • Add support for WebStart.  It's partly there, I just need to add code to parse the JNLP, and all the life cycle management code.
  • The pop-up dialogs for the progress bars and error messages are showing the "applet warning" note.  That needs to be fixed somehow in the security policy file, but I'm not sure which property manages that.
  • There's a bunch of code cleanup that needs to happen.  There's some places where it's pretty messy.  In particular, the management of the applet classloader needs to be tighter so that it can be property garbage collected.
26  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-29 02:55:40
Grobo and Apo have both offered to help merge the work I've done with the project on pikacode.
I finished my merge into PikaCode (, and added the capability to look at the different entries over the years.  I included progress bars and separated out the work for downloads into more reasonable places.  It still has a large amount of work to make it look pretty, and I know my use of SwingWorker can be better done, but the basics are there.

Somewhere along the line I introduced a bad bug where the loaded applets are returning "null" from a getGraphics() call.  I'm assuming I'm just not parenting it correctly.  This is part of the reason the applets weren't visible - they were crashing! UPDATE: I found the source of the issue and fixed it.

I'd like to see either caching of entries, or (possibly additionally) allowing for a zip download that includes all the previous entries to limit the amount of downloads we put on the java4k web site.

As to the other questions:

The use of launcher.dir in the policy file caused me some grief initially, and specifying the jar in the codebase means it can't be run directly from the Run menu in Eclipse (you have to build the jar first.)  Maybe we can just grant the higher permissions to all code on the classpath instead?
There's some options we can do here, like have a debug property that, if set and the launcher.dir isn't set, then we just don't install a security manager.

My code to get the list of games and the game details is quite a bit simpler than what's currently in the pikacode repository.
Yes, and the nice part is, yours works!  Hopefully the code I pulled in for this can be easily swapped out with a feed reader if we get to that point.

It looks like Groboclown's code runs the applets in a separate thread.  Is that necessary?  Is it for some security concerns, or something else?
It's for security reasons, and being able to force a badly running applet to die.  Applets are supposed to not be able to create new top-level thread groups, so that the running tool can just kill all the threads running in that thread group.  It's also used for ensuring that the applet is running in the right security context.  I also have all the thread stuff there so that we make sure that each of those different tasks runs under that thread group.
27  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-28 18:32:53
I just downloaded your code, and I'm looking into pulling it into the PikaCode codebase now.
28  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-27 16:58:09
I'm having a few issues merging what I had already done with Groboclown's project, so it will be a bit until I can commit it there.
I started working on making it work with WebStart apps, so it can potentially be used to run all the previous entries as well as the new ones.  I'm holding off new changes until you merge in.

Should we look into adding Mac compatibility to fix the issue it has with key release?
29  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-23 23:01:54
One thing to note about using the SecurityManager - some of the Oracle documentation makes note that the default security manager isn't restrictive enough on the thread group permissions.  Special care must be taken to ensure that the applet cannot create a new thread group outside its original parent.
30  Games Center / Contests / Re: Discuss the future of 4k contest on: 2013-11-23 01:10:44
Well I've hacked together a pack.gz loader, but it does require a temporary file to put the unpacked jar in. Any better ideas?
I found an alternative library that can load a zip file into memory (, because the ZipInputStream doesn't handle all cases of zips.

Security is also a pain, as unless I load all the games in before setting the SecurityManager, I lose access to the files.  Might have to allow network access.

Yes.  Proper security managers are quite the pain.  The only way I could explicitly get it to work was to load a policy file, where the executing class is in the list of allowable classes, and explicitly limit everything else (  I also limited my applet class loader to prevent the loading of any of these special classes, to prevent a backdoor.
Pages: [1] 2 3 ... 6
Archive (35 views)
2017-04-27 17:45:51

buddyBro (244 views)
2017-04-05 03:38:00

CopyableCougar4 (668 views)
2017-03-24 15:39:42

theagentd (666 views)
2017-03-24 15:32:08

Rule (715 views)
2017-03-19 12:43:22

Rule (689 views)
2017-03-19 12:42:17

Rule (691 views)
2017-03-19 12:36:21

theagentd (705 views)
2017-03-16 05:07:07

theagentd (637 views)
2017-03-15 22:37:06

theagentd (478 views)
2017-03-15 22:32:18
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!