public MainScreen(GameData theData, int theLevel = 1) { data = theData; level = theLevel; cursor = new Cursor(); marker = new Marker(); }
public WelcomeScreen(GameData theData) { data = theData; Vector2 buttonPos = new Vector2(0.5f, 0.9f); playButton = new MyButton(data, buttonPos); }
public MainScreen(GameData theData, bool Restart = true) { data = theData; restart = Restart; cursor = new Cursor(); marker = new Marker(); }
public Plant(GameData theData, bool flower = false) { data = theData; Color = Color.SpringGreen ; //Color = Color.PaleGreen; Score = 7; hasFlower = flower; }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; data = new GameData(this); currentState = State.Welcome; prevIsKeyDown = false; }
public PlayAgainScreen(GameData theData) { data = theData; Vector2 yesPos = new Vector2(0.5f, 5 / 8f); yesButton = new MyButton(data, yesPos); Vector2 noPos = new Vector2(0.5f, 6 / 8f); noButton = new MyButton(data, noPos); }
List<Target> winners; // subset of targets #endregion Fields #region Constructors /// <summary> /// Constructs new bonus screen /// </summary> /// <param name="theData"></param> public BonusScreen(GameData theData) { data = theData; player = new BonusPlayer(theData); numberOfTargets = 12; targets = new List<Target>(); winners = new List<Target>(); player = new BonusPlayer(data); currentTarget = null; }
/// <summary> /// Constructs a player /// </summary> /// <param name="theData"></param> public Player(GameData theData) : base(true) { data = theData; OffsetPos = new Vector2(-57, -14); FacingLeft = true; Scale = new Vector2(1.0f, 1.0f); Score = 25; }
/// <summary> /// Constructs a bonus player and adds it to the game in the /// bonus area /// </summary> /// <param name="theData"></param> public BonusPlayer(GameData theData) { data = theData; Position = new Vector2( data.screenWidth / 2, data.screenHeight / 2); destination = new Vector2(); Direction = new Vector2(); isLeft = false; }
/// <summary> /// Constructs a target /// </summary> /// <param name="theData">Global game data</param> /// <param name="thePosition"></param> /// <param name="theColor">Specified color</param> /// <param name="theObjective">Correct objective color</param> public Target(GameData theData, Vector2 thePosition, Color theColor, Color theObjective) : base(theData, thePosition) { isAlive = true; isLeft = false; isDropped = false; score = 24; color = theColor; objective = theObjective; angle = 0; prevTime = -1; }
/// <summary> /// Contructs an enemy, aka hostile dinosaur /// </summary> /// <param name="theData"></param> public Enemy(GameData theData) : base() { data = theData; IsAlive = true; Color = Color.White; Score = 15; // Initialize Direction/Velocity Direction = randomDirection(); FacingLeft = false; }
public WelcomeScreen(GameData theData) { data = theData; Vector2 buttonPos = new Vector2(0.5f, 0.6f); playButton = new MyButton(data, buttonPos); buttonPos = new Vector2(0.5f, 0.75f); optionsButton = new MyButton(data, buttonPos); buttonPos = new Vector2(0.5f, 0.9f); creditsButton = new MyButton(data, buttonPos); }
public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; data = new GameData(this); currentState = State.Welcome; level = 0; loading = false; numFrames = 0; maxLoadingFrames = 50; prevIsKeyDown = false; }
public PlayAgainScreen(GameData theData, Boolean isTheWinner = false) { data = theData; isWinner = isTheWinner; System.Console.Out.WriteLine("isWinner", isWinner); Vector2 yesPos = new Vector2(0.5f, 5 / 8f); yesButton = new MyButton(data, yesPos); Vector2 noPos = new Vector2(0.5f, 6 / 8f); noButton = new MyButton(data, noPos); Vector2 winnerPos = new Vector2(0.5f, 0.2f); winner = new MyButton(data, winnerPos); }
/// <summary> /// Constructs the Bonus Text /// </summary> /// <param name="data"></param> /// <param name="theIndex"></param> public BonusText(GameData data, int theIndex) { screenWidth = data.screenWidth; screenHeight = data.screenHeight; index = theIndex; }
/// <summary> /// Creates a custom button with the given position and texture. /// </summary> /// <param name="theData"></param> The global game data /// <param name="thePosition"></param> The desired position of the center /// of the button relative to the screen width and screen hight /// <param name="theTexture"></param> public MyButton(GameData theData, Vector2 thePosition) { position = new Vector2(); position.X = thePosition.X * theData.screenWidth; position.Y = thePosition.Y * theData.screenHeight; }