Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Day 1

Done today (and yesterday)

  • Bitbucket and Godot projects
  • Player-controlled tank
  • Camera following the tank
  • Cannon that aims and shoots at the mouse position

Graphic resolution

I spent waaaaayyyyy too much time (over)thinking about the game’s graphic resolution. By default, Godot seems to configure the project as 1024x600. While this is a near-enough ratio for a lot of variants, I prefer to aim for a 16:9 ratio, so it scales perfectly on 720p, 1080p and 4K. However, I want to be able to embed the game on a web page, so going for 1920x1080 is a no-go. Also, 1280x720 (720p) does not scale exactly for the very common 1080p (pixels would be 1.5x). To be pixel perfect with all possibilities, 640x360 would fit the bill: 2x for 720p, 3x for 1080p, etc. But, not being a (pixel) artist myself, it seems a bit too cramped.

In the end, I decided to go with 960x540. This is slightly smaller than the default size in Godot, exactly 50% of 1080p to which it will scale perfectly if needed, while still being able to fit within a web page when deployed in HTML5.

Assets

I’ll start my development using the Kenney Game Assets 3 bundle, more specifically the Top-down Tanks Redux pack. I was (and still am) not sure the player’s war machine should be, but something like a tank sounds like a good place to start. I also like how the assets from that back allow me to assemble different parts on the tank, to fit with the core gameplay element of customization. I will need to tweak some things, and probably some weapons will not show visually when on the battlefield.

War machine

Starting with the basics, I created the player’s war machine. For now, I’m focusing on keyboard and mouse input, so moving with arrows or WASD, and aiming and shooting with the mouse.

I made the controls responsive, but I wanted to add a nice visual by making the tank rotate slowly as the player moves. Nothing fantastic, but it took me some time to get the maths done, without any exception when wrapping the angle over zero or tau. Also, the cannon follows where the mouse is, as one more visual indicator. The only thing though, the bullet always spawns at the rotation point, and not at the end of the cannon. Noted as a FIXME for now.

The war machine is currently assembled as a Godot scene, hardcoded to a specific hull, cannon and projectile.

What’s next?

For tomorrow, I plan to complete the following:

  • Crosshair instead of mouse pointer for aiming
  • Collidable objects in the battlefield
  • Warmachines that can be assembled by code/config