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

Prevent Player Units Overlapping Computer Units

When you play the current movement examples, you will notice that you are still able to move your own units on top of those of the computer-controlled ones. The computer has this issue resolved because the Wargame Map Object stores a value of 100 in its array, which prevents moving onto a tile. You do not have this luxury for the player units and so have to add an additional event to prevent this from happening.

Each of the computer units has been assigned to a qualifier group called Enemies. You can view this by clicking on Enemy_Unit1 and in the properties window clicking on the Events tab. You can use this qualifier group to check that one of the placeholder objects is not overlapping the computer ...

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