O'Reilly logo

Going to War: Creating Computer War Games by Jason Darby

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Paying Income per Area

A similar concept to the example we just created would be to pay the player for any tiles on the map as long as they do not contain computer controlled units on those tiles. This is useful if you want the income to be based on keeping important terrain areas rather than getting the player to go out of his way to capture specific tiles.

In the following example we will show how to create an area-based income system.

First we will set the values of the three tiles. We will use the same tiles we used in the previous example. In your own games, you would apply them to any tiles that you feel are worth something in the game.

  1. Load up the file called Money2.mfa from the examples folder.

  2. Ensure that you can see the map and units ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required