TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Best stack to make a 2D game in 2023

9 pointsby snovymgodymabout 2 years ago
I first got into programming in high school, mainly by making games using Java and the 2D graphics&#x2F;UI libraries in the standard library (Java2D, Swing, awt, etc.)<p>10 years and a CS degree later, I&#x27;m employed in industry but would really like to get back into making games as a creative outlet. But I&#x27;m always stuck on deciding what language, framework, engine, and environment to use.<p>So I&#x27;m wondering, what&#x27;s the most straightforward stack and programming environment that gets me a window, event loop, canvas, etc. so that I can make whatever kind of 2D games I&#x27;m interested in? C++ with SDL? Javascript and canvas? Plain old Java again? Would like to hear what people here have a good experiences with.

8 comments

hnthrowaway0328about 2 years ago
I used to create a half-ass Ultima-spinoff (think Ultima 1-4 type of graphics) in C++ and SDL2. Tried twice but never managed to complete them, not due to technical difficulty but due to boredom once I figured out the major algorithms (path-finding, line of sight, random generation, such and such). My rendering &quot;framework&quot; only has some 200 lines of code but fits all of my rendering jobs.<p>I&#x27;d say it&#x27;s a valid option as long as you are willing to devote some time building up the foundations. But if you are more into game programming than game engine programming, Godot may be your best choice. I have never used it though so cannot say for sure.
krappabout 2 years ago
Godot.<p>C++ and SDL2 will get you a window, events, sound and other low level stuff, and you can get support for PNGs and fonts easier by including some of nothings&#x2F;stb libraries[0] (rather than the equivalent SDL libs.) Maybe toss in Lua&#x2F;LuaJIT for good measure. That will scratch a lot of itches.<p>But IMHO it&#x27;s better in the long run to just pick up Godot and save yourself months of unnecessary effort. Otherwise if you&#x27;re like me you&#x27;ll wind up in the weeds with nothing to show for it but a tilemap class you&#x27;ve rewritten a dozen times.<p>[0]<a href="https:&#x2F;&#x2F;github.com&#x2F;nothings&#x2F;stb">https:&#x2F;&#x2F;github.com&#x2F;nothings&#x2F;stb</a>
alex_lavabout 2 years ago
Godot (<a href="https:&#x2F;&#x2F;godotengine.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;godotengine.org&#x2F;</a>) has given me the best mix of freedom and helpfulness. I worked in Unity for a few years, which was terrible but popular, and have done a small amount of Unreal Engine work, and have found them to be more &quot;enterprise&quot;-y than I need&#x2F;want. Godot is FOSS and is a really incredible community. GDScript is pretty cool (if you&#x27;re familiar or enjoy Python it&#x27;ll feel pretty normal), but you can use pretty much whatever programming language you like.
dysocoabout 2 years ago
I&#x27;ve personally had a very good experience with Haxe and Haxeflixel (<a href="https:&#x2F;&#x2F;haxeflixel.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;haxeflixel.com&#x2F;</a>) although Heaps (<a href="https:&#x2F;&#x2F;heaps.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;heaps.io&#x2F;</a>) seems to be more popular nowadays.<p>Haxe is very nice as a language, can easily cross-compile to a lot of targets, Haxeflixel is heavily inspired by some Actionscript framework and has a lot of goodies. Maybe Heaps is more mature, up to date and allows for more advanced features.<p>The cool thing is you can get started right away writing code, without having to learn a full-on tool like Unity. But it has visual tools for debugging things on-screen for example.
frou_dhabout 2 years ago
Raylib (<a href="https:&#x2F;&#x2F;www.raylib.com" rel="nofollow">https:&#x2F;&#x2F;www.raylib.com</a>) is a better API than SDL for hobby 2D game development and here&#x27;s an illustrative reason why: You cannot even draw a circle with SDL.<p>Look at all this! <a href="https:&#x2F;&#x2F;github.com&#x2F;raysan5&#x2F;raylib&#x2F;tree&#x2F;master&#x2F;examples">https:&#x2F;&#x2F;github.com&#x2F;raysan5&#x2F;raylib&#x2F;tree&#x2F;master&#x2F;examples</a><p>If straying from native code then CanvasRenderingContext2D in the browser with JS&#x2F;TS is good too, particularly because you can have hot-code-replacement during development by using e.g. Vite.
canxerianabout 2 years ago
Unity. The developer experience is really excellent and there are plenty of excellent learning resources.
HeladeraDragonabout 2 years ago
Scratch (<a href="https:&#x2F;&#x2F;scratch.mit.edu" rel="nofollow">https:&#x2F;&#x2F;scratch.mit.edu</a>)
kurisufagabout 2 years ago
make your own. trust me: a minimum viable 2D gfx library based on OpenGL will take a day or two to put together, and you can hack at it as you work on your game. it&#x27;s very comfy, and provides greater motivation for when gamedev drudgery threatens to stop your work.