Defender 4000

Defender 4000
[tr]
[td][] 21 Images!
[
] Exciting sounds effects!
[] Dazzling animations and special effects!
[
] Classic Gameplay!
[*] ONLY 4,077 bytes!

Readme
Download
[/td]
[td]

http://java.dnsalias.com/defender/screenshot_small.gif
[/td]
[/tr]

Brought to you by the 4K game programming contest.

It’s totally unplayable with VSync off… :frowning:

Exception in thread “main” java.lang.UnsupportedOperationException: Cannot change display mode
at java.awt.GraphicsDevice.setDisplayMode(GraphicsDevice.java:250)
at D.(Unknown Source)
at D.main(Unknown Source)

Linux, XFree 4.3, JDK 1.4.2

That’s one crazy small jar! Smoov too.

Cas :slight_smile:

Its a miracle to me how game coders can make it that easy…

I use 4k for the gameloop/timing framework at least. Of for the keyboard input framework. Or for the entity management framework. :frowning:

Incredible how to bring a whole game in 4K!!!

Jupp, impressive stuff

[quote]Its a miracle to me how game coders can make it that easy…

I use 4k for the gameloop/timing framework at least. Of for the keyboard input framework. Or for the entity management framework. :frowning:
[/quote]
…I’ve got a 4k 3D renderer with multiple lightsources and dynamic terrain lying around somewhere here :). I kind of gave up when it got to the point where I couldn’t get it to animate anything interesting (I had a couple of mountains that grew out of the ground, then sank into it again, ad infinitum, while a sun went round in circles).

I was also a bit disheartened when I saw someone else had done similar but with smooth shading and translucent water with wave animations :(. Their source code was nearly all bitwise operations, unsurprisingly :).

Works perfectly on OS X 10.3.2 JRE 1.4.2*

Yep, it is amazing what some people can do in 4k. I remember when I did the 4k contest at CFXWeb.net that there were some really impressive entries. (I think that is where the terrain demo that blah^3 mentioned was unveiled)

[quote]Works perfectly on OS X 10.3.2 JRE 1.4.2*

Yep, it is amazing what some people can do in 4k. I remember when I did the 4k contest at CFXWeb.net that there were some really impressive entries. (I think that is where the terrain demo that blah^3 mentioned was unveiled)
[/quote]
Indeed :).

[quote]Exception in thread “main” java.lang.UnsupportedOperationException: Cannot change display mode
at java.awt.GraphicsDevice.setDisplayMode(GraphicsDevice.java:250)
at D.(Unknown Source)
at D.main(Unknown Source)

Linux, XFree 4.3, JDK 1.4.2
[/quote]
Sorry, but until Linux supports full screen you’re just kind of SOL. If I get time at some point, I’ll maybe see about making a Windowed version for Linux. (Question: The whole point of Open Source is to scratch an itch, right? So why hasn’t anyone submitted code to the Blackdown project to fix full screen mode?)

[quote]Works perfectly on OS X 10.3.2 JRE 1.4.2*
[/quote]
Excellent! I tested it on my OS X laptop, so I knew it worked on 10.2.6. Good to know that nothing’s screwed up in 10.3.

BTW, is it a bit too easy on your Mac? Part of what makes it a difficult game is the speed. On my Mac I’m able to keep going for much longer because I have more time to react.

The screen turns white with the game on the upper left part of the screen (Intel video, java 1.4.2_03). Otherwise it works okay. Gameplay could be a bit faster IMO (especially the player’s ship).

Erik

[quote]The screen turns white with the game on the upper left part of the screen (Intel video, java 1.4.2_03). Otherwise it works okay. Gameplay could be a bit faster IMO (especially the player’s ship).
[/quote]
That’s odd. It sounds like your system doesn’t support 640x480x32 mode. Are you able to change your desktop settings to that mode? What OS version are you using?

I think that PC does support that mode (it’s my desktop at work, and I’m not at work anymore), but I’ll check on monday. It’s running win2k BTW.
At home it runs great. Very smooth and all. Great blocky old school arcade like graphics :-*

Erik

[quote]It’s totally unplayable with VSync off…
[/quote]
Turn it on then ;D

But seriously, this kind of game demands vsync. Either the game should display a ‘no vsync available’ warning/error dialog or something and then bail out or fall back to throttle without vsync.

Then it wouldn’t fit in 4K! For example, I originally had code to turn off the mouse cursor. Unfortunately, it added so many class references that there was no way to keep the game under 4K. My solution was to use the Robot class to stick the cursor in the lower right hand corner.

Trust me, there’s no room for error detection. :’(

Um yeah, I can imagine it wouldn’t fit in 19 bytes hehe.
So EgonOlsen should just enable vsync then :wink:
OTOH, I think the game deserves a version without a 4k limit. Also with all the cool effects of the original (the laser and explosions in the original are so cool! :D).

Ah well, maybe I should pick up CottAGE again some day and add defender support.

Erik

[quote]Um yeah, I can imagine it wouldn’t fit in 19 bytes hehe.
So EgonOlsen should just enable vsync then :wink:
OTOH, I think the game deserves a version without a 4k limit.
[/quote]
Heh. You’ll have to find somebody else. I’m exhausted from trying to cram that much in 4K. :wink:

Everyone may be interested to know that the results are in for the 4K Game Programming contest. Defender 4000 scored second only to Abuse’s Shootey Transparency Thingy, and was given the prize for the best overall game!

Special thanks to Mlk for hosting the contest! :slight_smile: