/* This is the actual entry point for the engine. It can take arguments but none need to be given. */ static void Main(string[] args) { /* A new PokemonEngine is created, and then it is run. */ using (PokemonEngine game = new PokemonEngine()) { game.Run(); } }
/* The Player constructor takes a reference to the game, a string for the gender choice, and a Character object. * A World object is passed through to the Camera. */ public Player(Game game, Character character, string gender, World worldRef) { /* The gameRef, character and gender fields are set from the parameters passed in. */ gameRef = (PokemonEngine)game; this.character = character; this.gender = gender; /* The camera is initialized using the window rectangle, and a zoom of two. * CameraFollow is set to true, since we want the camera to follow the player. * The team is initialized with a length of six, and the bag is also created. */ camera = new Camera(gameRef.ScreenRectangle, 2f, worldRef); character.CameraFollow = true; team = new Pokemon[6]; bag = new Bag(); }
/* The BaseGameState constructor takes a reference to the game and the state manager, which are both passed to the parent GameState() constructor. * The GameRef field is filled with a reference to the game passed in. * The default playerIndexInControl is set to the gamepad plugged into slot one. */ public BaseGameState(Game game, GameStateManager manager) : base(game, manager) { GameRef = (PokemonEngine)game; playerIndexInControl = PlayerIndex.One; }