public PublishMenu(TextureManager textureManager, Vector2 position, float scale, int playerIndex) : base(position, scale) { this.eButton = new Button(textureManager.eButtonTexture, position, new Vector2(180, 50)); this.pButton = new Button(textureManager.pButtonTexture, position, new Vector2(80, 45)); eBookTexture = textureManager.eBookTexture; this.playerIndex = playerIndex; }
public Player(TextureManager textureManager, int playerID) { position = GetPosition(playerID); archive = new Archive(textureManager, position + offset, 0.6f, 2, 5); this.playerID = playerID; publishMenu = new PublishMenu(textureManager, position + offset, 0.75f, playerID); activeTab = archive; background = textureManager.playerBackground; doneTexture = textureManager.doneTexture; budget = 0; }
public GameManager(GameWindow window, StartMenu startMenu, TextureManager textureManager) { //Should get the number of players from the start screen or something, can send that as an argument for the GameManager this.window = window; rand = new Random(); players = new Player[startMenu.GetNumPlayers]; bookManager = new BookManager(textureManager); market = new Market(textureManager, new Vector2(20, 20), 31, 13, rand); economyManager = new Economy(); GameStart(textureManager, startMenu); backgroundTexture = textureManager.backgroundTexture; }
public Market(TextureManager textureManager, Vector2 position, int X_max, int Y_max, Random rand) { this.position = position; textures = new Texture2D[Book.numberOfGenres]; for (int i = 0; i < textures.Length; i++) { textures[i] = textureManager.bookTexture[i]; } eBookTexture = textureManager.eBookTexture; this.X_max = X_max; this.Y_max = Y_max; totalNumber = X_max * 2 + Y_max * 2 - 4; demand = new Demand[totalNumber]; emptyPos = new List<int>(); Fill(rand); }
public Archive(TextureManager textureManager, Vector2 position, float scale, int rows, int columns) : base(position, scale) { books = new List<Book>(); this.rows = rows; this.columns = columns; this.position = position; selectionTexture = new Texture2D[4]; for (int i = 0; i < selectionTexture.Length; i++) selectionTexture[i] = textureManager.middleSelection[i]; eBookTexture = textureManager.eBookTexture; lossTexture = textureManager.lossTexture; profitTexture = textureManager.profitTexture; outlineTexture = textureManager.outlineTexture; }
private void GameStart(TextureManager textureManager, StartMenu startMenu) { currentTurn = 1; phase = TurnPhase.BookPicking; inputManager = new InputManager(players.Length); for (int i = 0; i < players.Length; i++) players[i] = new Player(textureManager, i); bookManager.archive.ClearArchive(); bookManager.GenerateBooks(); }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { fontSmall = Content.Load<SpriteFont>("fontSmall"); fontLarge = Content.Load<SpriteFont>("fontLarge"); textureManager = new TextureManager(); textureManager.LoadTextures(Content, graphics.GraphicsDevice); startMenu = new StartMenu(new Vector2(200, 600), textureManager, fontLarge); //gameManager = new GameManager(Window, textureManager, 1); spriteBatch = new SpriteBatch(GraphicsDevice); gameState = GameState.StartScreen; }
public StartMenu(Vector2 position, TextureManager textureManager, SpriteFont font) { this.position = position; background = textureManager.cleanBackground; input = new Input(); this.font = font; buttons = new Button[] { new Button(textureManager.buttonTexture, position + new Vector2(0, 0), new Vector2(45, 25), "Players: ", font), new Button(textureManager.buttonTexture, position + new Vector2(300, 0), new Vector2(45, 25), "Instructions", font), new Button(textureManager.buttonTexture, position + new Vector2(600, 0), new Vector2(45, 25), "Start Game", font), }; #region Instructions string[] instructionTexts = new string[] { "Shall we publish?" + "\n\nThis is a game about managing a publishing company. Up to four " + "companies will compete against eachother over new book offers and sales.\n\n " + "As a player you need to judge the demand of the market and adjust your choices accordingly. " + "What books do you reprint? Will you take up a new book? Will that genre be profitable enough, considering the competition? " + "\n\nThe right calls will keep your business healthy.", "Genres:" + "\n\nBooks come in "+ Book.numberOfGenres.ToString() + " different genres, and every genre has a specific color." + "\n\nEvery turn players can accept one new book from an arrange of offers (displayed in the middle of the screen). " + "Books compete for sales within their genre, so try to pick up a variety of books if possible. " + "\n\nYou are also competing against the other players, so take into account what genre of books they are trying to sell.", "Accepting new books:" + "\n\nThe red bar indicates the initial one-time cost to accept the book. " + "\n\nExpensive books compete better and sell for a slightly higher price, but they do not cost more to print. " + "\n\nIf you have accepted a book you will be asked whether to publish it as an E-book or not. " + "\n\nRegular books have greater profitability; they sell more often and for a better price. However, they need to be printed (for a cost) " + "and printed books have a storage cost as well.", "Printing & selling:" + "\n\nWhen all players have finished accepting book offers, they are now free to print books." + "\n\nAt the lower left corner of every book is number representing the number of books in stock. " + "Selecting a book and clicking 'A' will increase it's stock for a price. When you are satisfied, press 'Y' to continue " + "\n\nWhen all players have finished printing books, the books will sell to the market. The market demand is represented as a border of books lining " + "the game window. Books of a genre with high demand and low competition will sell in higher numbers. " + "On each book is a bar representing the total profit and total cost of that particular book.", }; Vector2 textPosition = position + new Vector2(0, -450); instructions = new Instruction[] { new Instruction(instructionTexts[0], 60, textPosition), new Instruction(instructionTexts[1], 60, textPosition, textureManager.bookTexture.ToArray(), new Vector2[]{ new Vector2(900, 175), new Vector2(900 + Book.Width + 8, 175), new Vector2(900 + Book.Width * 2 + 16, 175), new Vector2(900 + Book.Width*0.5f, 183 + Book.Height), new Vector2(890 + Book.Width*1.5f + 16, 183 + Book.Height)}), new Instruction(instructionTexts[2], 60, textPosition, new Texture2D[]{ textureManager.examples[0], textureManager.bookTexture[0], textureManager.eBookTexture}, new Vector2[]{ new Vector2(900, 175), new Vector2(900, 340), new Vector2(900, 340)}), new Instruction(instructionTexts[3], 70, textPosition), }; #endregion }
public BookManager(TextureManager textureManager) { archive = new Archive(textureManager, new Vector2(540, 280), 0.75f, 2, 3); bookTexture = textureManager.bookTexture; detailTexture = textureManager.detailTexture; }