Esempio n. 1
0
        protected override void LoadContent()
        {
            //dessa tre integers ändrar du på om du ändrat tilestorleken, eller mängden tiles
            int tileSize         = 32;
            int screenWidth      = 24;
            int screenHeight     = 16;
            int tileAmountWidth  = 5;
            int tileAmountHeight = 1;

            playerStartPos = new Point(100, 100);

            graphics.PreferredBackBufferHeight = screenHeight * tileSize;
            graphics.PreferredBackBufferWidth  = screenWidth * tileSize;

            spriteBatch = new SpriteBatch(GraphicsDevice);
            playerTex   = Content.Load <Texture2D>(@"PlayerSimpleSheet");
            spriteFont  = Content.Load <SpriteFont>(@"spriteFont");
            hurtTex     = Content.Load <Texture2D>(@"hurtboxgraphic");
            Texture2D IslandTiles = Content.Load <Texture2D>("islandTiles");

            wheelCactusTex = Content.Load <Texture2D>(@"WheelCactus tex");

            player          = new Player(playerTex, playerStartPos, spriteFont, hurtTex);
            mapManager      = new MapManager(IslandTiles, tileSize, tileAmountWidth, tileAmountHeight);
            mapGrid         = mapManager.Mapbuilder();
            testWheelCactus = new WheelCactus(wheelCactusTex, new Point(300, 300));
            enemies         = new List <Enemy>();
            enemies.Add(testWheelCactus);
        }
Esempio n. 2
0
 private void GameObjectCreator()
 {
     spriteBatch     = new SpriteBatch(GraphicsDevice);
     player          = new Player(playerTex, playerStartPos, spriteFont, hurtTex);
     mapManager      = new MapManager(islandTiles, tileSize, tileAmountWidth, tileAmountHeight);
     mapBackground   = mapManager.MapBackgroundBuilder();
     mapForeground   = mapManager.MapForegroundBuilder();
     testWheelCactus = new WheelCactus(wheelCactusTex, new Point(300, 300));
     enemies         = new List <Enemy>();
     enemies.Add(testWheelCactus);
 }