O'Reilly logo

CryENGINE Game Programming with C++, C#, and Lua by Ruan Pearce-Authers, Carl-Filip Lundgren

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

Creating a basic game mode in C#

Now that we have the basic knowledge required to create a mini-game, why not do so? To start off, we'll aim towards creating a very basic system for spawning actors and entities.

Defining our intention

To start, let's clarify exactly what we want to do:

  1. Spawn our actor.
  2. Assign our actor to one of the two possible teams.
  3. Check when an actor enters the opposite team's Headquarters entity, and end it.

Creating the actor

The first thing we need to do is spawn our actor, which can't be done before we have one. To do this, we'll need to create a MyActor.cs file somewhere in the Game/Scripts directory and then add the following code:

  public class MyActor : Actor 
  {
  }

This code snippet is the bare minimum required for an actor ...

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