Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ** This class inherits rectangle and draw functions from base Sprite class **
- class Player: Sprite
- {
- Texture2D image;
- Microsoft.Xna.Framework.Vector2 position;
- public bool[] isMovingHor = new bool[2];
- //public bool[] isMovingVert = new bool[2];
- ContentManager content;
- public Player(Texture2D image, Vector2 position): base(image, position)
- {
- this.image = image;
- this.position = position;
- }
- public void Update()
- {
- if (isMovingHor[0]) // right
- {
- position.X += 5;
- }
- else if (isMovingHor[1]) // left
- {
- position.X -= 5;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement