Spaceships! – Movement

(All the pictures in this post are just diagrams, not actual gameplay)

After a few years of not dealing with any particular project for more than a few days, mainly due to time constraints, I started to mess around with Android app creation. Without any idea in my head about what to develop, I ended up getting a copy of the libGDX framework for game development. It was rather fun to work with, I dropped in a random background image, a spaceship sprite, and added some simple movement mechanics on it.

The next few days, I refined the movement some more, played around with the camera making it follow the ship, and after some play-testing I suddenly realized that I had just set up some solid and fun movement mechanics that I didn’t see in any ship-shooter game before.

This was actually a good opportunity to design a game around it.

During the following months, I continued the development very sparsely. It has just been in the last few weeks that I managed to make myself some time solely for game development, and my first objective is to finish this unnamed game!


Up, down, left and right. And rotation by sensing the device’s movement!

If there is a particular mechanic in this game that I find rare in the genre, but I think has a lot of potential in a mobile device, is the movement. The player can move freely between the two axes, but also has the possibility to rotate by physically rotating the device. The ship keeps some of its inertia, but not forever (as it should in mid-space). Letting the ship come to a stop a bit after releasing the screen, makes the game easier to control, which allows for a more rapid and dynamic gameplay.

The camera follows the player’s ship. This was the only way I found the rotation to feel natural, by keeping the ship approximately in the same screen position and rotating the camera together with the ship. It feels like a car’s steering wheel, something that definitively doesn’t happen if the ship wanders all around the place. The camera rotation is slightly delayed compared to the ship, to add a more dynamic feeling. The only disadvantage I find with this approach, is that it is possible that an enemy you are fighting with goes out of sight. I already tackled this issue, but enemies and AI deserve their own post.


Another fun feature I implemented during experimentation, and I found useful to keep, is to make the map infinite-scrolling, just like PacMan.
Well, the “map” is currently void, with some background stars (maybe layered in parallax?), however I don’t discard the possibility of adding obstacles further down the road.

Shipception… not really

The advantages I found on using a map like this, are:

  • The player can move freely anywhere he wants, not limiting his movement with an enormous wall.
  • By having a finite map, the amount of spawned enemies is directly proportional to the density of them. This means that the average amount of enemies the player sees in his screen (which actually covers about 1/32 of the map) can be controlled.

So basically, we have a finite map, but we are allowing the player to move infinitely in any direction he wants. By moving the camera together with the ship, the boundaries of the map cannot be known, and a sense of a “spherical” world is created.


I’ll be keeping a devlog of this game around here, the next post will probably be about AI and adaptive difficulty (!!!) which is practically finished already, so if it is of your interest, stay tuned.

Share your thoughts

Notify of