Combat 4k

OMFG!!! Nonnus29 made a game!

Ahem,

Here’s my entry to the 2005 Java4k Game contest. It’s a remake of the ‘classic’ Atari 2600 tank battle game in stunning 3d! Well, maybe not so stunning, but I’m pleased with how smooth the game runs on my computer using only fillPolygon().

A few notes;

  • The game is an applet (I started off with an applet then I was far enough along I didn’t want to change…)
  • It’s 4038 bytes
  • the ai is very cheap
  • when you hit your opponent or your opponent hits you, game over and it resets to the start.
  • Can an applet be webstarted? Why bother?

Here’s the link. Let me know how it runs, suggestions for the remaining few bytes etc…

Here’s the jar.

[quote]Can an applet be webstarted? Why bother?
[/quote]
Hehe yes, why bother. Is the source available? I experience some flickering when programming for applet instead of Application. GUess it has something to do with lack of skills using graphics correctly.

no flickering for me, it ran smooth.

But whats the objective of the game? everytime i shoot the pink tank, i end up going back to the start…

No flickering, and quite impressive 3D for a 4K game. :slight_smile: Gameplay gets a bit limited with the “cheap AI”, but good technology display. Viewpoint might be a bit further away, and you get a funky “wobbling” of the buildings when driving. Line jumps around a bit. Probably becuse you typecast a float/double to int. If you can afford it you could add 0.5 or use Math.round() to get rid if it. Maybe I am the only one seing it because I had the same problem with Shot 4K :wink:
Maybe one more computer tank and/or display of who won if there is enough space.

Yup I like those last comments. I very much like the 3D effect :wink: I wish my tank game were 3D… anyone wanna take over RoboTank?

Thanks for input!

Yes, the lines do look jumpy; I think that’s because I’m using Graphics.fillPolygon() and Graphics.drawPolygon() to draw the polygons. I added a .5f to the vertex before casting them to ints, I can’t tell that it helped any.

I also added a ‘game over’ message and it’s now 4090 bytes.

I had the rendering+applet code squished to about 2k, but data and game logic pushed it up. If I did this again I’d use better data management to shrink the gamelogic further and a full screen JFrame. I think I could even fit some key-frame animation in there if I could find a super low poly model (ie 30 tri’s?) :o

Here’s the source, view at your own risk… To bad JCreator won’t save tabs as spaces.

If you want your applet to be run via java web start, it’s easy :
you just have to replace the usual application-desc tag by an applet-desc tag.


Lilian

ohoo, i really like the graphics. its like a 4k cartoon shader :slight_smile:
but there could be a little more gameplay, perhaps:

  • bullets which bound off walls for a few times
  • armor, so that you dont die immediately
  • a warp field
  • upgrades

anyway: very nice and smooth !!

Thanks, I liked the cartoon shading look too, plus it saved me from storing face normals and calculating hundreds of Color shades!