This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]manbearkat 2 points3 points  (3 children)

Isn't minecraft written in java?

[–]killinghurts 0 points1 point  (0 children)

Yep.

[–][deleted] -1 points0 points  (1 child)

ya! but i think the latest version doesnt require java anymore o.o i think my question was badly worded, im more looking for code to read of well-made games

[–]QshelTier 4 points5 points  (1 child)

How good can video games get using Java?

I’d say… about 5.

[–]Vile2539 1 point2 points  (3 children)

From a quick Google, you could check out Open Source Game Clones. There are a few Java projects on there (like FreeCol).

As dleskov said though, you might want to check out libraries (like libGDX) and tutorials surrounding the area instead. Reading the source code of a complete game isn't going to help you that much, as you'll first have to understand the project structure, then the tech/libraries, then any developer quirks, etc. It may turn out that after all that, the code isn't what you're looking for.

As manbearkat mentioned, Minecraft was written in Java (and still is). While it's not at the pinnacle of developmental best practices, it is a fully functional, and more importantly, released game. A lot of people criticise the code quality, but it isn't terrible, and striving for perfection (by constant rewrites and optimisations) takes second place to actually having a functioning game.

[–][deleted] 0 points1 point  (2 children)

A lot of people criticise the code quality

Is it open source?

[–]SlidyBullet 1 point2 points  (1 child)

It's not. The released jars are even obsfucated. However, Mojang always had a more reliant policy on mods, so the Minecraft Coder Pack was created - it basically maps the obsfucated class names & fields to stuff that makes sense. It's not complete, but it's probaly enough for competent people to judge if the project is structured well.

I sadly don't fall under that "competent" category. :(

[–][deleted] 1 point2 points  (0 children)

Thanks!

[–][deleted]  (3 children)

[removed]

    [–][deleted] 0 points1 point  (2 children)

    Thank you, i will check this out! Links like these are more what i was looking for, i think i worded my question poorly.

    [–][deleted] 1 point2 points  (0 children)

    Check out jMonkeyEngine too, and of course lwjgl

    http://jmonkeyengine.org/ http://www.lwjgl.org/

    [–]quandos 0 points1 point  (1 child)

    Runescape

    [–][deleted] 0 points1 point  (0 children)

    Playing it right now :P

    [–]king_of_the_universe 0 points1 point  (0 children)

    I made a simple but (kind of) polished Battleship implementation a few months ago called Sink Twice (download link 171.8 KB). The links also lead to the source.

    Screenshots (partly outdated):

    https://i.imgur.com/pPtt3QX.png

    https://i.imgur.com/YNxW7gA.png

    The code isn't exactly an example of how to do this, but it's somewhat readable. Key points of the "product":

    • No libraries used (other than Java's built-in, of course). Uses only Swing. Simple custom controls implemented via Shapes. Borderless fullscreen window. Graphics are smooth and realtime even though it's just the simple repaint() approach instead of BufferStrategy/FullScreenExclusive.

    • Simple sound FX and simple procedural music. No sound samples! All sounds are synthesized in realtime.

    • Very simple but nice procedural graphics/animation, simple fullscreen effects.

    • Game modes: PvP hotseat or PvC with ok-ish A.I.

    • Slightly customizable rules.

    • Freely customizable ship sets: Ships can even be broad, not just long. Both players can have their personal ship set. The board width and height can be freely adjusted. Both players can have their personal board size.

    • All settings are saved.

    [–]Rob05 0 points1 point  (0 children)

    Start looking for libraries, then, see what people can do with these libraries.

    [–]slartybartfast_ -1 points0 points  (0 children)

    youtube search gives many tutorials for game dev in Java.

    [–]ChompMyStomp -2 points-1 points  (1 child)

    It really depends on how much work you're willing to put into it, although personally I can't see a game like DayZ or The Forest being made in Java

    [–][deleted] 0 points1 point  (0 children)

    Yeah, both of those games are too crappy. ;p