Example #1
0
 // Keyboard ks = Keyboard.GetState;
 public Character(Texture2D newtexure,Texture2D newatck,SpriteFont newfont, Vector2 newPosition, int newframeHeight, int newframewidth, MainScrolling newbg1, MainScrolling newbg2)
 {
     textur = newtexure;
     atack = newatck;
     font = newfont;
     position = newPosition;
     frameHeight = newframeHeight;
     framewidth = newframewidth;
     bg1 = newbg1;
     bg2 = newbg2;
 }
Example #2
0
File: Game1.cs Project: pvo15/game
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            bg1 = new MainScrolling(Content.Load<Texture2D>("bg1"), new Rectangle(0,0,1024,480));
            bg2 = new MainScrolling(Content.Load<Texture2D>("bg2"), new Rectangle(1024, 0, 1024, 480));

            player = new Character(Content.Load<Texture2D>("walk"), Content.Load<Texture2D>("atack"),Content.Load<SpriteFont>("Font"), new Vector2(100, 375), 44, 40,bg1,bg2);
            bad = new Bad(Content.Load<Texture2D>("bad"), new Vector2(400, 360));

            platform.Add(new Patform(Content.Load<Texture2D>("platform"), new Vector2(150,290)));
            platform.Add(new Patform(Content.Load<Texture2D>("platform"), new Vector2(378, 280)));

            // TODO: use this.Content to load your game content here
        }