Time for action – building a computer terminal

  1. Add a new class called ComputerTerminal to the Robot Rampage project.
  2. Add the following using directives to the top of the class file:
    using Microsoft.Xna.Framework;
    using Microsoft.Xna.Framework.Graphics;
  3. Add declarations to the ComputerTerminal class:
    #region Declarations
    private Sprite activeSprite;
    private Sprite inactiveSprite;
    public Vector2 MapLocation;
    public bool Active = true;
    public float LastSpawnCounter = 0;
    public float minSpawnTime = 6.0f;
    #endregion
    
  4. Add a constructor to the ComputerTerminal class:
    #region Constructor public ComputerTerminal( Sprite activeSprite, Sprite inactiveSprite, Vector2 mapLocation) { MapLocation = mapLocation; this.activeSprite = activeSprite; this.inactiveSprite ...

Get XNA 4.0 Game Development by Example Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.