Writing games is often about dealing with health and damage. With entity component system this is fun to do. Furthermore you can give any entity health or damage any time, it is literally only adding the health or damage or both component to that entity. Bullets And Characters To handle health and damage we need […]
Tag: game programming

History Back and Forth
Whenever you write a level editor or maybe a turn-based game (like chess) it would be of great help having undo and redo functionality at hand. Based on the Game Programming Patterns book from Robert Nystrom I did like to implement an undo/redo history class. The design pattern is based on the Design Patterns book […]

Game Programming Patterns
I recently read Game Programming Patterns from Robert Nystrom one of the best books about programming I’ve ever read. I get commissions for purchases made through the following link I read the entire book from beginning to end in one go, I couldn’t stop. Normally I use programming books to fall asleep, the design pattern […]

Test Driven Development Integration Test
Beside unit tests, it is a good idea to have some integration tests. An integration test only makes sure that the new feature is in place. An integration test does not ponder on edge cases. It’s crucial to keep an integration test as simple as possible. Make the Greeter App Modular The greeter app from […]

Test Driven Development Fixtures
We all tend to write helper classes for testing, which clutters the test code and makes it harder to understand. A test should be like a story that you simply can read from top-down. I like test story better than fixture and I will use story and fixture interchangeable. Why a Story Is More Powerful […]

Test Driven Development Mantra
This is the mantra Think of a piece of code you want to add Write a test which fails because that piece of code is not in place Write that piece of code to make the failing test succeed Refactor the code Refactor the test and you do that over and over again. Why did […]

Test Driven Development Get Started
The start is always the hard part. Most often we face existing code where we have to add some new functionality. In always all cases there are little to no unit tests, but ugly and complicated looking integration or system tests which sometimes fail because of timing, network, or database issues. If you have already […]

Test Driven Development is Pretty Cool
A couple of years ago I stumbled over one of the best articles about test-driven development I ever read. Even the title is crispy I mean Stepping Through the Looking Glass: Test-Driven Game Development how cool sounds that? Noel did a decent job to explain the mantra write a test, see it fail, write code, […]

ECS Pattern: Follow Entity
When I write games I have always something following something else. The camera follows a hero. Light follows ghost. Goody follows the space ship. Weapon follows the player. And so on and so on. This is a very common pattern in games. In the object-oriented world, I would probably have a reference to the object […]

ECS Pattern: Decay
This blog post is based on Entity Component System are Crazy Cool. There are so many things in-game that have a lifetime. Bullets, effects, debris, blood, vanishing tiles in a can’t stop running-game, and many more things which have a lifetime. In the past, I would have done it separately depending on which situation something […]