protected override void LoadContent() { spriteBatch = new SpriteBatch(GraphicsDevice); map = Content.Load <Texture2D>("Karta"); character = Content.Load <Texture2D>("Character Animation"); foregroundTex = Content.Load <Texture2D>("fore"); middlegroundTex = Content.Load <Texture2D>("middle"); backgroundTex = Content.Load <Texture2D>("back"); block = Content.Load <Texture2D>("block"); spriteFont = Content.Load <SpriteFont>("font"); IsMouseVisible = true; player = new Player(Content, Window); mapMenu = new MapMenu(); gameStateManager = new GameStateManager(Content, graphics); parallaxScroll = new ParallaxScroll(Content, Window); camera = new Camera(player, new Rectangle(0, 0, 1430, 1080), new Rectangle(0, 0, 50000, 3000)); }
public Player(ContentManager content, GameWindow window) { this.character = Game1.character; pos = new Vector2(100, 800); isOnGround = true; ridingPlattformForward = false; ridingPlattformBackward = false; maps = new Map(); isFalling = false; characterWidth = character.Width / 120; characterHeight = character.Height / 20; hitBox = new Rectangle((int)pos.X, (int)pos.Y - (int)characterHeight, (int)characterWidth, 1); paralaxScroll = new ParallaxScroll(content, window); frameTimer = 100; frameInterval = 100; characterFx = SpriteEffects.None; srcRect = new Rectangle(0, 0, character.Width / 12, character.Height / 2); }