//------------------------------------------------------------------------------ // Constructor: GreenBug_WalkRight // Author: Neil Holmes & Andrew Green // Summary: state constructor //------------------------------------------------------------------------------ public GreenBug_WalkRight(GameObject2D parent) : base(parent) { // store a reference to the green bug that owns this state this.parent = (GreenBug)parent; }
//------------------------------------------------------------------------------ // Constructor: PlayerState_WalkLeft // Author: Neil Holmes & Andrew Green // Summary: state constructor //------------------------------------------------------------------------------ public PlayerState_WalkDownRight(GameObject2D parent) : base(parent) { // store a reference to the player who owns this state this.player = (Player)parent; }
//------------------------------------------------------------------------------ // Constructor: Enemy_WalkLeft // Author: Neil Holmes & Andrew Green // Summary: state constructor //------------------------------------------------------------------------------ public Enemy_WalkLeft(GameObject2D parent) : base(parent) { // store a reference to the enemy that owns this state this.parent = (Enemy)parent; }
//------------------------------------------------------------------------------ // Method: AddObject // Author: Neil Holmes & Andrew Green // Summary: add a new 2D game object to the linked list of objects to be processed //------------------------------------------------------------------------------ public void AddObject(GameObject2D gameObject) { // tell the object being added to load it's content gameObject.LoadContent(game.Content); // add the new object to the list of active game objects gameObjects.AddFirst(gameObject); }
//------------------------------------------------------------------------------ // Method: RemoveObject // Author: Neil Holmes & Andrew Green // Summary: add an object to the list of objects to be removed at the end of this frame //------------------------------------------------------------------------------ public void RemoveObject(GameObject2D gameObject) { // add the object to the list of objects to be removed objectsToBeRemoved.AddFirst(gameObject); }
//------------------------------------------------------------------------------ // Function: GameObjectState // Author: Neil Holmes & Andrew Green // Summary: main constructor //------------------------------------------------------------------------------ public GameObjectState(GameObject2D gameObject) { // store a reference to the game object that owns this state this.gameObject = gameObject; }