A while ago, I tweeted about a small game I had created on top of Compose for Desktop: A small clone of the classic arcade game Asteroids, in which you control a space ship with your mouse, and navigate the vastness of space, avoiding and breaking asteroids in the process.
Today, it’s time to take a look under the hood and understand how I built a basic version of this game, and how Compose for Desktop helped me achieve it in just one evening!
In the first part of my blog post series about building a small clone of the classic arcade game Asteroids on top of Compose for Desktop, we saw how to implement the main game loop, as well as manage state and draw basic shapes. In this post, we will explore some more details of the game implementation. This includes:
Rendering details – making sure game objects don’t escape our play area, and using a device-independent coordinate system for rendering Geometry and linear algebra – the secret sauce that makes the space ships fly Frame-independent movement – so that our game works consistently.