Ejemplo n.º 1
0
        public Player(Texture2D texture,Ramp ramp,Rectangle frame)
        {
            this.texture = texture;
            this.frame = frame;
            rampRectangle = ramp.rectangle;

            #region creating rectangle for player
            startingRectangle = ramp.rectangle;
            startingRectangle.Height = texture.Height;
            startingRectangle.Width = texture.Width;
            startingRectangle.X = ramp.rectangle.Width - startingRectangle.Width;
            startingRectangle.Y = rampRectangle.Y - 50;
            #endregion

            currentRectangle = startingRectangle;
        }
Ejemplo n.º 2
0
        //============================================================================================
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            font = Content.Load<SpriteFont>("Debug");

            Texture_ramp = Content.Load<Texture2D>("ramp");
            Texture_player = Content.Load<Texture2D>("player");

            ramp = new Ramp(Texture_ramp, frame);
            player = new Player(Texture_player, ramp,frame);
            // TODO: use this.Content to load your game content here
        }