public Startview(ContentManager _content, Camera _camera, SpriteBatch _spritebatch, BallSimulation _ballsim, Playersimulation _playersim, Drawmap _drawmap, GraphicsDeviceManager _graphics) { content = _content; //Camera etc.. camera = _camera; spritebatch = _spritebatch; ballsim = _ballsim; playersim = _playersim; drawmap = _drawmap; graphics = _graphics; balltexture = content.Load <Texture2D>("BALL"); //Balltexture ballcenter = new Vector2(balltexture.Width / 2, balltexture.Height / 2); //Ballcenter playersprite = content.Load <Texture2D>("Player"); playercenter = new Vector2(playersprite.Width / 2, playersprite.Height / 2); ballbackgroundtexture = content.Load <Texture2D>("Ballground"); //Sprites playerbackgroundtexture = content.Load <Texture2D>("Playergroundtile"); playercreatestexture = content.Load <Texture2D>("Playercreatingground"); maptextures.Add(ballbackgroundtexture); //Sprites added to list maptextures.Add(playerbackgroundtexture); maptextures.Add(playercreatestexture); map = lvlone.getmap(); //Gets the map totalballs = ballsim.getballs(); //Gets the amount of balls player = playersim.getplayer(); }
public void LoadContent(SpriteBatch _spritebatch, ContentManager _content, Camera _camera) { spriteBatch = _spritebatch; Content = _content; camera = _camera; ballsim = new BallSimulation(); playersim = new Playersimulation(); drawmap = new Drawmap(); lvlone = new LevelOne(); startview = new Startview(Content, camera, spriteBatch, ballsim, playersim, drawmap, graphics); //Loads the map once when the application starts. Will use update function to call a function in drawmap that allows me to place new tiles.. map = lvlone.getmap(); textures = startview.ReturnedTextures(); drawmap.Drawlevel(map, textures, spriteBatch, camera); }