예제 #1
0
        public GameManager(SpriteFont f, SpriteFont sf, HoleManager h, AcidManager a, PlayerManager p, PowerUpManager pu,
            Board bo,Table tab, Texture2D st, Texture2D help, Texture2D ls)
        {
            font = f;
            scoreFont = sf;
            holeManager = h;
            acidManager = a;
            playerManager = p;
            powerupManager = pu;
            board = bo;
            table = tab;
            gamestate = GameState.normal;
            folds = 0;
            level = 0;

            startScreen = st;
            helpScreen = help;
            levelScreen = ls;
            for (int i = 0; i <= endLevel; i++)
            {
            levelsPics.Add(Game1.content.Load<Texture2D>("level" + i));
            levelsPicsBtn.Add(new Rectangle(300 + ((levelsPics.ElementAt(i).Width+30) * ((i<3)? i : i-3)), (i < 3) ? 220 : 400, levelsPics.ElementAt(i).Width, levelsPics.ElementAt(i ).Height));
            }
        }
예제 #2
0
 /// <summary>
 /// LoadContent will be called once per game and is the place to load
 /// all of your content.
 /// </summary>
 protected override void LoadContent()
 {
     device = graphics.GraphicsDevice;
     // Create a new SpriteBatch, which can be used to draw textures.
     spriteBatch = new SpriteBatch(GraphicsDevice);
     SpriteFont font = Content.Load<SpriteFont>(@"font");
     SpriteFont scoreFont = Content.Load<SpriteFont>("scoreFont");
     HoleManager holeManager = new HoleManager(Content.Load<Texture2D>("hole2"), Content.Load<Effect>("effects"));
     AcidManager acidManager = new AcidManager(Content.Load<Texture2D>("acid"), Content.Load<Effect>("effects"));
     PlayerManager playerManager = new PlayerManager(Content.Load<Texture2D>("gum"), Content.Load<Effect>("effects"), Content.Load<Texture2D>("dupGum"), Content.Load<Texture2D>("staticGum"));
     PowerUpManager powerupManager = new PowerUpManager(Content.Load<Texture2D>("inkspot"), Content.Load<Effect>("effects"));
     Board board = new Board(Content.Load<Texture2D>("paper"), Content.Load<Effect>("effects"));
     Table table = new Table(Content.Load<Model>("Table"));
     camera = new Camera(this);
     input = new InputHandler(this);
     ourGame = new GameManager(font, scoreFont, holeManager, acidManager, playerManager, powerupManager, board,table, Content.Load<Texture2D>("startScreen"), Content.Load<Texture2D>("help"), Content.Load<Texture2D>("levelsScreen"));
     ourGame.loadCurrLevel();
 }